Package com.sun.codemodel
Class JEnumConstant
java.lang.Object
com.sun.codemodel.JExpressionImpl
com.sun.codemodel.JEnumConstant
- All Implemented Interfaces:
JAnnotatable,JDeclaration,JDocCommentable,JExpression,JGenerable
public final class JEnumConstant
extends JExpressionImpl
implements JDeclaration, JAnnotatable, JDocCommentable
Enum Constant.
When used as an
JExpression, this object represents a reference to the enum constant.- Author:
- Bhakti Mehta (Bhakti.Mehta@sun.com)
-
Method Summary
Modifier and TypeMethodDescriptionAdds an annotation to this variable.annotate(Class<? extends Annotation> clazz) Adds an annotation to this variable.<W extends JAnnotationWriter<? extends Annotation>>
WAdds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.arg(JExpression arg) Add an expression to this constructor's argument listvoidvoidgetName()Returns the name of this constant.javadoc()Creates, if necessary, and returns the enum constant javadoc.booleanremoveAnnotation(JAnnotationUse annotation) Removes annotation from this program element.
-
Method Details
-
arg
Add an expression to this constructor's argument list- Parameters:
arg- Argument to add to argument list
-
getName
Returns the name of this constant.- Returns:
- never null.
-
javadoc
Creates, if necessary, and returns the enum constant javadoc.- Specified by:
javadocin interfaceJDocCommentable- Returns:
- JDocComment containing javadocs for this constant.
-
annotate
Adds an annotation to this variable.- Specified by:
annotatein interfaceJAnnotatable- Parameters:
clazz- The annotation class to annotate the field with
-
annotate
Adds an annotation to this variable.- Specified by:
annotatein interfaceJAnnotatable- Parameters:
clazz- The annotation class to annotate the field with
-
annotate2
Description copied from interface:JAnnotatableAdds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.- Specified by:
annotate2in interfaceJAnnotatable- Returns:
-
removeAnnotation
Description copied from interface:JAnnotatableRemoves annotation from this program element.- Specified by:
removeAnnotationin interfaceJAnnotatable- Parameters:
annotation- The annotation to be removed from the program element
-
annotations
- Specified by:
annotationsin interfaceJAnnotatable- Returns:
- Can be empty but never null.
-
declare
- Specified by:
declarein interfaceJDeclaration
-
generate
- Specified by:
generatein interfaceJGenerable
-