com.sun.tools.xjc.model
Class CEnumConstant

java.lang.Object
  extended by com.sun.tools.xjc.model.CEnumConstant
All Implemented Interfaces:
EnumConstant<NType,NClass>

public final class CEnumConstant
extends Object
implements EnumConstant<NType,NClass>

Enumeration constant.


Field Summary
 String javadoc
          Javadoc comment.
 String name
          Name of the constant.
 
Constructor Summary
CEnumConstant(String name, String javadoc, String lexical, Locator loc)
           
 
Method Summary
 CEnumLeafInfo getEnclosingClass()
          Gets the EnumLeafInfo to which this constant belongs to.
 String getLexicalValue()
          Lexical value of this constant.
 Locator getLocator()
           
 String getName()
          Gets the constant name.
(package private)  void setParent(CEnumLeafInfo parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name
Name of the constant.


javadoc

public final String javadoc
Javadoc comment. Can be null.

Constructor Detail

CEnumConstant

public CEnumConstant(String name,
                     String javadoc,
                     String lexical,
                     Locator loc)
Parameters:
name -
Method Detail

getEnclosingClass

public CEnumLeafInfo getEnclosingClass()
Description copied from interface: EnumConstant
Gets the EnumLeafInfo to which this constant belongs to.

Specified by:
getEnclosingClass in interface EnumConstant<NType,NClass>
Returns:
never null.

setParent

void setParent(CEnumLeafInfo parent)

getLexicalValue

public String getLexicalValue()
Description copied from interface: EnumConstant
Lexical value of this constant.

This value should be evaluated against EnumLeafInfo.getBaseType() to obtain the typed value.

This is the same value as written in the XmlEnumValue annotation. In the above example, this method returns "1" and "2".

Specified by:
getLexicalValue in interface EnumConstant<NType,NClass>
Returns:
never null.

getName

public String getName()
Description copied from interface: EnumConstant
Gets the constant name.

In the above example this method return "ONE" and "TWO".

Specified by:
getName in interface EnumConstant<NType,NClass>
Returns:
never null. A valid Java identifier.

getLocator

public Locator getLocator()