com.sun.codemodel
Class JEnumConstant

java.lang.Object
  extended by com.sun.codemodel.JExpressionImpl
      extended by com.sun.codemodel.JEnumConstant
All Implemented Interfaces:
JAnnotatable, JDeclaration, JExpression

public final class JEnumConstant
extends JExpressionImpl
implements JDeclaration, JAnnotatable

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
 JAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
          Adds an annotation to this variable.
 JAnnotationUse annotate(JClass clazz)
          Adds an annotation to this variable.
<W extends JAnnotationWriter>
W
annotate2(java.lang.Class<W> clazz)
          Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.
 JEnumConstant arg(JExpression arg)
          Add an expression to this constructor's argument list
 void declare(JFormatter f)
           
 void generate(JFormatter f)
           
 java.lang.String getName()
          Returns the name of this constant.
 JDocComment javadoc()
          Creates, if necessary, and returns the enum constant javadoc.
 
Methods inherited from class com.sun.codemodel.JExpressionImpl
_instanceof, band, bor, cand, complement, component, cor, decr, div, eq, gt, gte, incr, invoke, invoke, lt, lte, minus, minus, mod, mul, ne, not, plus, ref, ref, shl, shr, shrz, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

arg

public JEnumConstant arg(JExpression arg)
Add an expression to this constructor's argument list

Parameters:
arg - Argument to add to argument list

getName

public java.lang.String getName()
Returns the name of this constant.

Returns:
never null.

javadoc

public JDocComment javadoc()
Creates, if necessary, and returns the enum constant javadoc.

Returns:
JDocComment containing javadocs for this constant.

annotate

public JAnnotationUse annotate(JClass clazz)
Adds an annotation to this variable.

Specified by:
annotate in interface JAnnotatable
Parameters:
clazz - The annotation class to annotate the field with

annotate

public JAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Adds an annotation to this variable.

Specified by:
annotate in interface JAnnotatable
Parameters:
clazz - The annotation class to annotate the field with

annotate2

public <W extends JAnnotationWriter> W annotate2(java.lang.Class<W> clazz)
Description copied from interface: JAnnotatable
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.

Specified by:
annotate2 in interface JAnnotatable

declare

public void declare(JFormatter f)
Specified by:
declare in interface JDeclaration

generate

public void generate(JFormatter f)


Copyright © 2005-2009 Sun Microsystems. All Rights Reserved.