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

java.lang.Object
  extended by com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo
All Implemented Interfaces:
java.lang.Iterable<BIDeclaration>

public final class BindInfo
extends java.lang.Object
implements java.lang.Iterable<BIDeclaration>

Container for customization declarations. We use JAXB ourselves and parse this object from "xs:annotation".


Field Summary
static SchemaCache bindingFileSchema
          Lazily parsed schema for the binding file.
static BindInfo empty
          An instance with the empty contents.
 
Constructor Summary
BindInfo()
           
 
Method Summary
 void absorb(BindInfo bi)
          Merges all the declarations inside the given BindInfo to this BindInfo.
 void addDecl(BIDeclaration decl)
          Adds a new declaration.
<T extends BIDeclaration>
T
get(java.lang.Class<T> kind)
          Gets the first declaration with a given name, or null if none is found.
 BIDeclaration get(int idx)
           
 BGMBuilder getBuilder()
          Back pointer to the BGMBuilder which is building a BGM from schema components including this customization.
 BIDeclaration[] getDecls()
          Gets all the declarations
 java.lang.String getDocumentation()
          Gets the documentation parsed from <xs:documentation>s.
static JAXBContextImpl getJAXBContext()
           
 com.sun.xml.xsom.XSComponent getOwner()
           
 org.xml.sax.Locator getSourceLocation()
          Gets the location of this annotation in the source file.
 boolean isPointless()
          Returns true if this BindInfo doesn't contain any useful information.
 java.util.Iterator<BIDeclaration> iterator()
           
 void setOwner(BGMBuilder _builder, com.sun.xml.xsom.XSComponent _owner)
          Sets the owner schema component and a reference to BGMBuilder.
 int size()
          Gets the number of declarations.
 CCustomizations toCustomizationList()
          Gets the list of CPluginCustomizations from this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

empty

public static final BindInfo empty
An instance with the empty contents.


bindingFileSchema

public static final SchemaCache bindingFileSchema
Lazily parsed schema for the binding file.

Constructor Detail

BindInfo

public BindInfo()
Method Detail

isPointless

public boolean isPointless()
Returns true if this BindInfo doesn't contain any useful information. This flag is used to discard unused BindInfos early to save memory footprint.


getSourceLocation

public org.xml.sax.Locator getSourceLocation()
Gets the location of this annotation in the source file.

Returns:
If the declarations are in fact specified in the source code, a non-null valid object will be returned. If this BindInfo is generated internally by XJC, then null will be returned.

setOwner

public void setOwner(BGMBuilder _builder,
                     com.sun.xml.xsom.XSComponent _owner)
Sets the owner schema component and a reference to BGMBuilder. This method is called from the BGMBuilder before any BIDeclaration inside it is used.


getOwner

public com.sun.xml.xsom.XSComponent getOwner()

getBuilder

public BGMBuilder getBuilder()
Back pointer to the BGMBuilder which is building a BGM from schema components including this customization.


addDecl

public void addDecl(BIDeclaration decl)
Adds a new declaration.


get

public <T extends BIDeclaration> T get(java.lang.Class<T> kind)
Gets the first declaration with a given name, or null if none is found.


getDecls

public BIDeclaration[] getDecls()
Gets all the declarations


getDocumentation

public java.lang.String getDocumentation()
Gets the documentation parsed from <xs:documentation>s. The returned collection is to be added to JDocComment.append(Object).

Returns:
maybe null.

absorb

public void absorb(BindInfo bi)
Merges all the declarations inside the given BindInfo to this BindInfo.


size

public int size()
Gets the number of declarations.


get

public BIDeclaration get(int idx)

iterator

public java.util.Iterator<BIDeclaration> iterator()
Specified by:
iterator in interface java.lang.Iterable<BIDeclaration>

toCustomizationList

public CCustomizations toCustomizationList()
Gets the list of CPluginCustomizations from this.

Note that calling this method marks all those plug-in customizations as 'used'. So call it only when it's really necessary.


getJAXBContext

public static JAXBContextImpl getJAXBContext()