com.sun.xml.bind.v2.model.impl

Class EnumLeafInfoImpl<T,C,F,M>

class EnumLeafInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M> implements EnumLeafInfo<T,C>, Element<T,C>, Iterable<EnumConstantImpl<T,C,F,M>>

EnumLeafInfo implementation.
Field Summary
NonElement<T,C>baseType
Cclazz
The enum class whose information this object represents.
protected booleantokenStringType
Used to recognize token vs string.
Constructor Summary
EnumLeafInfoImpl(ModelBuilder<T,C,F,M> builder, Locatable upstream, C clazz, T type)
Method Summary
Element<T,C>asElement()
protected voidcalcConstants()
Build EnumConstants and discover/report any error in it.
booleancanBeReferencedByIDREF()
Leaf-type cannot be referenced from IDREF.
protected EnumConstantImpl<T,C,F,M>createEnumConstant(String name, String literal, F constant, EnumConstantImpl<T,C,F,M> last)
NonElement<T,C>getBaseType()
CgetClazz()
Iterable<? extends EnumConstantImpl<T,C,F,M>>getConstants()
QNamegetElementName()
LocationgetLocation()
ClassInfo<T,C>getScope()
When a bean binds to an element, it's always through XmlRootElement, so this method always return null.
Element<T,C>getSubstitutionHead()
No substitution.
TgetType()
QNamegetTypeName()
booleanisElement()
booleanisSimpleType()
booleanisToken()
Iterator<EnumConstantImpl<T,C,F,M>>iterator()
voidlink()

Field Detail

baseType

NonElement<T,C> baseType

clazz

final C clazz
The enum class whose information this object represents.

tokenStringType

protected boolean tokenStringType
Used to recognize token vs string.

Constructor Detail

EnumLeafInfoImpl

public EnumLeafInfoImpl(ModelBuilder<T,C,F,M> builder, Locatable upstream, C clazz, T type)

Parameters: clazz type clazz and type should both point to the enum class that this EnumLeafInfo represents. Because of the type parameterization we have to take them separately.

Method Detail

asElement

public Element<T,C> asElement()

calcConstants

protected void calcConstants()
Build EnumConstants and discover/report any error in it.

canBeReferencedByIDREF

public final boolean canBeReferencedByIDREF()

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

Leaf-type cannot be referenced from IDREF.

createEnumConstant

protected EnumConstantImpl<T,C,F,M> createEnumConstant(String name, String literal, F constant, EnumConstantImpl<T,C,F,M> last)

getBaseType

public NonElement<T,C> getBaseType()

getClazz

public C getClazz()

getConstants

public Iterable<? extends EnumConstantImpl<T,C,F,M>> getConstants()

getElementName

public QName getElementName()

getLocation

public Location getLocation()

getScope

public ClassInfo<T,C> getScope()

Deprecated: you shouldn't be invoking this method on ClassInfoImpl.

When a bean binds to an element, it's always through XmlRootElement, so this method always return null.

getSubstitutionHead

public Element<T,C> getSubstitutionHead()

Deprecated: if you are invoking this method directly, there's something wrong.

No substitution.

getType

public T getType()

getTypeName

public QName getTypeName()

isElement

public boolean isElement()

isSimpleType

public boolean isSimpleType()

isToken

public boolean isToken()

Returns: true if enum is restriction/extension from xs:token type, otherwise false

iterator

public Iterator<EnumConstantImpl<T,C,F,M>> iterator()

link

void link()