Top Description Methods
org.glassfish.jaxb.core.v2.model.core

public Interface EnumConstant<T, C>

Known Direct Implementers
org.glassfish.jaxb.runtime.v2.model.impl.EnumConstantImpl, com.sun.tools.xjc.model.CEnumConstant
Imports
jakarta.xml.bind.annotation.XmlEnumValue

Individual constant of an enumeration.

Javadoc in this class uses the following sample to explain the semantics:

@XmlEnum(Integer.class)
enum Foo {
  @XmlEnumValue("1")
  ONE,
  @XmlEnumValue("2")
  TWO
}
Author
Kohsuke Kawaguchi
See Also
EnumLeafInfo

Method Summary

Modifier and TypeMethod and Description
public EnumLeafInfo<T, C>

Returns:

never null.
getEnclosingClass
()

Gets the EnumLeafInfo to which this constant belongs to.

public String

Returns:

never null.
getLexicalValue
()

Lexical value of this constant.

public String

Returns:

never null. A valid Java identifier.
getName
()

Gets the constant name.

Method Detail

getEnclosingClassback to summary
public EnumLeafInfo<T, C> getEnclosingClass()

Gets the EnumLeafInfo to which this constant belongs to.

Returns:EnumLeafInfo<T, C>

never null.

getLexicalValueback to summary
public String getLexicalValue()

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".

Returns:String

never null.

getNameback to summary
public String getName()

Gets the constant name.

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

Returns:String

never null. A valid Java identifier.