com.sun.tools.xjc.model
Class CEnumConstant

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

public final class CEnumConstant
extends java.lang.Object
implements EnumConstant<NType,NClass>, CCustomizable

Enumeration constant.


Field Summary
 java.lang.String javadoc
          Javadoc comment.
 java.lang.String name
          Name of the constant.
 
Constructor Summary
CEnumConstant(java.lang.String name, java.lang.String javadoc, java.lang.String lexical, com.sun.xml.xsom.XSComponent source, CCustomizations customizations, org.xml.sax.Locator loc)
           
 
Method Summary
 CCustomizations getCustomizations()
          Gets the list of customizations attached to this model component.
 CEnumLeafInfo getEnclosingClass()
          Gets the EnumLeafInfo to which this constant belongs to.
 java.lang.String getLexicalValue()
          Lexical value of this constant.
 org.xml.sax.Locator getLocator()
          Gets the source location in the schema from which this model component is created.
 java.lang.String getName()
          Gets the constant name.
 com.sun.xml.xsom.XSComponent getSchemaComponent()
          If this model object is built from XML Schema, this property returns a schema component from which the model is built.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
Name of the constant.


javadoc

public final java.lang.String javadoc
Javadoc comment. Can be null.

Constructor Detail

CEnumConstant

public CEnumConstant(java.lang.String name,
                     java.lang.String javadoc,
                     java.lang.String lexical,
                     com.sun.xml.xsom.XSComponent source,
                     CCustomizations customizations,
                     org.xml.sax.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.

getLexicalValue

public java.lang.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 java.lang.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.

getSchemaComponent

public com.sun.xml.xsom.XSComponent getSchemaComponent()
Description copied from interface: CCustomizable
If this model object is built from XML Schema, this property returns a schema component from which the model is built.

Specified by:
getSchemaComponent in interface CCustomizable
Returns:
null if the model is built from sources other than XML Schema (such as DTD.)

getCustomizations

public CCustomizations getCustomizations()
Description copied from interface: CCustomizable
Gets the list of customizations attached to this model component.

Specified by:
getCustomizations in interface CCustomizable
Returns:
can be an empty list but never be null. The returned list is read-only. Do not modify.
See Also:
Plugin.getCustomizationURIs()

getLocator

public org.xml.sax.Locator getLocator()
Description copied from interface: CCustomizable
Gets the source location in the schema from which this model component is created.

Specified by:
getLocator in interface CCustomizable
Returns:
never null.