com.sun.tools.xjc.reader.xmlschema.bindinfo
Class BIEnum

java.lang.Object
  extended by com.sun.tools.xjc.reader.xmlschema.bindinfo.BIEnum
All Implemented Interfaces:
BIDeclaration

public final class BIEnum
extends java.lang.Object

Enumeration customization.

This customization binds a simple type to a type-safe enum class. The actual binding process takes place in SimpleTypeBuilder.

This customization is acknowledged by SimpleTypeBuilder.


Field Summary
 java.lang.String className
          Gets the specified class name, or null if not specified.
 java.lang.String javadoc
          Gets the javadoc comment specified in the customization.
 java.util.Map<java.lang.String,BIEnumMember> members
          Gets the map that contains XML value->BIEnumMember pairs.
static javax.xml.namespace.QName NAME
          Name of this declaration.
protected  BindInfo parent
           
 java.lang.String ref
           
 
Constructor Summary
BIEnum()
           
 
Method Summary
protected  BGMBuilder getBuilder()
           
 java.util.Collection<BIDeclaration> getChildren()
          Gets child BIDeclarations if any.
protected  com.sun.codemodel.JCodeModel getCodeModel()
           
 org.xml.sax.Locator getLocation()
          Gets the source location where this declaration was written.
 javax.xml.namespace.QName getName()
          Gets the name of this binding declaration, which is the same as the tag name of the binding element.
protected  com.sun.xml.xsom.XSComponent getOwner()
           
 boolean isAcknowledged()
          Checks if this declaration was acknowledged.
 boolean isMapped()
           
 void markAsAcknowledged()
          Marks this declaration to be acknowledged -- either actually used or the existence is admitted (for example when a property customization is given at the point of definition.)
 void onSetOwner()
          Called when the parent BindInfo got its owner set.
 void setParent(BindInfo p)
          Sets the parent BindInfo object of this declaration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

public java.lang.String className
Gets the specified class name, or null if not specified.


ref

public java.lang.String ref
See Also:
BIClass.getExistingClassRef()

javadoc

public final java.lang.String javadoc
Gets the javadoc comment specified in the customization. Can be null if none is specified.


members

public final java.util.Map<java.lang.String,BIEnumMember> members
Gets the map that contains XML value->BIEnumMember pairs. This table is built from <enumMember> customizations. Always return non-null.


NAME

public static final javax.xml.namespace.QName NAME
Name of this declaration.


parent

protected BindInfo parent
Constructor Detail

BIEnum

public BIEnum()
Method Detail

isMapped

public boolean isMapped()

getName

public javax.xml.namespace.QName getName()
Description copied from interface: BIDeclaration
Gets the name of this binding declaration, which is the same as the tag name of the binding element.


setParent

public void setParent(BindInfo p)
Description copied from interface: BIDeclaration
Sets the parent BindInfo object of this declaration. A declaration object can use this pointer to access context information, such as other customizations.

This method can be only called from BindInfo, and only once. This is a good opportunity to do some follow-up initialization after JAXB unmarshalling populated BIDeclaration.

Specified by:
setParent in interface BIDeclaration

getLocation

public org.xml.sax.Locator getLocation()
Description copied from interface: BIDeclaration
Gets the source location where this declaration was written. For declarations that are generated by XJC itself, this method returns null.

Specified by:
getLocation in interface BIDeclaration

getOwner

protected final com.sun.xml.xsom.XSComponent getOwner()

getBuilder

protected final BGMBuilder getBuilder()

getCodeModel

protected final com.sun.codemodel.JCodeModel getCodeModel()

isAcknowledged

public final boolean isAcknowledged()
Description copied from interface: BIDeclaration
Checks if this declaration was acknowledged.

Specified by:
isAcknowledged in interface BIDeclaration

onSetOwner

public void onSetOwner()
Description copied from interface: BIDeclaration
Called when the parent BindInfo got its owner set. This is when declarations are connected to BGMBuilder and its sibling components.

Specified by:
onSetOwner in interface BIDeclaration

getChildren

public java.util.Collection<BIDeclaration> getChildren()
Description copied from interface: BIDeclaration
Gets child BIDeclarations if any.

Specified by:
getChildren in interface BIDeclaration
Returns:
can be empty but always non-null. read-only.

markAsAcknowledged

public void markAsAcknowledged()
Description copied from interface: BIDeclaration
Marks this declaration to be acknowledged -- either actually used or the existence is admitted (for example when a property customization is given at the point of definition.)

Declarations that are not acknowledged will be considered as an error.

Specified by:
markAsAcknowledged in interface BIDeclaration