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

Class BindInfo

final class BindInfo extends Object implements Iterable<BIDeclaration>

Container for customization declarations. We use JAXB ourselves and parse this object from "xs:annotation".
Field Summary
static SchemaCachebindingFileSchema
Lazily parsed schema for the binding file.
BindInfo.Documentationdocumentation
Documentation taken from <xs:documentation>s.
static BindInfoempty
An instance with the empty contents.
Locatorlocation
Method Summary
voidabsorb(BindInfo bi)
Merges all the declarations inside the given BindInfo to this BindInfo.
voidaddDecl(BIDeclaration decl)
Adds a new declaration.
<T extends BIDeclaration> Tget(Class<T> kind)
Gets the first declaration with a given name, or null if none is found.
BIDeclarationget(int idx)
BGMBuildergetBuilder()
Back pointer to the BGMBuilder which is building a BGM from schema components including this customization.
BIDeclaration[]getDecls()
Gets all the declarations
StringgetDocumentation()
Gets the documentation parsed from <xs:documentation>s.
static JAXBContextImplgetJAXBContext()
XSComponentgetOwner()
LocatorgetSourceLocation()
Gets the location of this annotation in the source file.
booleanisPointless()
Returns true if this BindInfo doesn't contain any useful information.
Iterator<BIDeclaration>iterator()
voidsetAppinfo(BindInfo.AppInfo aib)
voidsetOwner(BGMBuilder _builder, XSComponent _owner)
Sets the owner schema component and a reference to BGMBuilder.
intsize()
Gets the number of declarations.
CCustomizationstoCustomizationList()
Gets the list of CPluginCustomizations from this.

Field Detail

bindingFileSchema

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

documentation

BindInfo.Documentation documentation
Documentation taken from <xs:documentation>s.

empty

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

location

Locator location

Method Detail

absorb

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

addDecl

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

get

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

get

public BIDeclaration get(int idx)

getBuilder

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

getDecls

public BIDeclaration[] getDecls()
Gets all the declarations

getDocumentation

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

Returns: maybe null.

getJAXBContext

public static JAXBContextImpl getJAXBContext()

getOwner

public XSComponent getOwner()

getSourceLocation

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

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.

iterator

public Iterator<BIDeclaration> iterator()

setAppinfo

void setAppinfo(BindInfo.AppInfo aib)

setOwner

public void setOwner(BGMBuilder _builder, 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.

size

public int size()
Gets the number of declarations.

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.