com.sun.tools.xjc.model

Class CEnumLeafInfo

public final class CEnumLeafInfo extends Object implements EnumLeafInfo<NType,NClass>, NClass, CNonElement

Transducer that converts a string into an "enumeration class." The structure of the generated class needs to precisely follow the JAXB spec.
Field Summary
CNonElementbase
Represents the underlying type of this enumeration and its conversion.
Stringjavadoc
Collection<CEnumConstant>members
List of enum members.
Modelmodel
The Model object to which this bean belongs.
CClassInfoParentparent
The parent into which the enum class should be generated.
StringshortName
Short name of the generated type-safe enum.
Constructor Summary
CEnumLeafInfo(Model model, QName typeName, CClassInfoParent container, String shortName, CNonElement base, Collection<CEnumConstant> _members, XSComponent source, CCustomizations customizations, Locator _sourceLocator)
Method Summary
Element<NType,NClass>asElement()
booleancanBeReferencedByIDREF()
JExpressioncreateConstant(Outline outline, XmlString literal)
StringfullName()
CAdaptergetAdapterUse()
NonElement<NType,NClass>getBaseType()
NClassgetClazz()
Collection<CEnumConstant>getConstants()
CCustomizationsgetCustomizations()
QNamegetElementName()
MimeTypegetExpectedMimeType()
CNonElementgetInfo()
LocationgetLocation()
LocatorgetLocator()
Source line information that points to the place where this type-safe enum is defined.
XSComponentgetSchemaComponent()
NTypegetType()
QNamegetTypeName()
LocatablegetUpstream()
IDidUse()
booleanisAbstract()
booleanisBoxedType()
booleanisCollection()
booleanisElement()
booleanisPrimitive()
booleanisSimpleType()
booleanneedsValueField()
The spec says the value field in the enum class will be generated only under certain circumstances.
JClasstoType(Outline o, Aspect aspect)

Field Detail

base

public final CNonElement base
Represents the underlying type of this enumeration and its conversion.

To parse XML into a constant, we use the base type to do lexical -> value, then use a map to pick up the right one.

Hence this also represents the type of the Java value. For example, if this is an enumeration of xs:int, then this field will be Java int.

javadoc

public String javadoc

members

public final Collection<CEnumConstant> members
List of enum members.

model

public final Model model
The Model object to which this bean belongs.

parent

public final CClassInfoParent parent
The parent into which the enum class should be generated.

shortName

public final String shortName
Short name of the generated type-safe enum.

Constructor Detail

CEnumLeafInfo

public CEnumLeafInfo(Model model, QName typeName, CClassInfoParent container, String shortName, CNonElement base, Collection<CEnumConstant> _members, XSComponent source, CCustomizations customizations, Locator _sourceLocator)

Method Detail

asElement

public Element<NType,NClass> asElement()

canBeReferencedByIDREF

public boolean canBeReferencedByIDREF()

Deprecated: why are you calling the method whose return value is known?

createConstant

public JExpression createConstant(Outline outline, XmlString literal)

fullName

public String fullName()

getAdapterUse

CAdapter getAdapterUse()

getBaseType

public NonElement<NType,NClass> getBaseType()

getClazz

public NClass getClazz()

getConstants

public Collection<CEnumConstant> getConstants()

getCustomizations

public CCustomizations getCustomizations()

getElementName

public QName getElementName()

getExpectedMimeType

public MimeType getExpectedMimeType()

getInfo

CNonElement getInfo()

getLocation

public Location getLocation()

getLocator

public Locator getLocator()
Source line information that points to the place where this type-safe enum is defined. Used to report error messages.

getSchemaComponent

public XSComponent getSchemaComponent()

getType

public NType getType()

getTypeName

public QName getTypeName()

getUpstream

public Locatable getUpstream()

idUse

public ID idUse()

isAbstract

public boolean isAbstract()

isBoxedType

public boolean isBoxedType()

isCollection

boolean isCollection()

isElement

public boolean isElement()

isPrimitive

public boolean isPrimitive()

isSimpleType

public boolean isSimpleType()

needsValueField

public boolean needsValueField()
The spec says the value field in the enum class will be generated only under certain circumstances.

Returns: true if the generated enum class should have the value field.

toType

public JClass toType(Outline o, Aspect aspect)