Top Description Fields Constructors Methods
com.sun.tools.xjc.reader.xmlschema

public Class BGMBuilder

extends BindingComponent
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .List, .Map, .Set, javax.xml.namespace.QName, javax.xml.transform.Transformer, .TransformerConfigurationException, .TransformerFactory, com.sun.codemodel.JCodeModel, com.sun.codemodel.fmt.JTextFile, com.sun.istack.NotNull, .Nullable, com.sun.tools.xjc.ErrorReceiver, .Options, .Plugin, com.sun.tools.xjc.generator.bean.field.FieldRendererFactory, com.sun.tools.xjc.model.CClassInfoParent, .Model, com.sun.tools.xjc.reader.ModelChecker, .Ring, com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration, .BIDom, .BIGlobalBinding, .BISchemaBinding, .BISerializable, .BindInfo, com.sun.tools.xjc.util.CodeModelClassFactory, .ErrorReceiverFilter, org.glassfish.jaxb.core.api.impl.NameConverter, org.glassfish.jaxb.core.v2.util.XmlFactory, com.sun.xml.xsom.XSAnnotation, .XSAttributeDecl, .XSAttributeUse, .XSComponent, .XSDeclaration, .XSParticle, .XSSchema, .XSSchemaSet, .XSSimpleType, .XSTerm, .XSType, .XSWildcard, com.sun.xml.xsom.util.XSFinder, org.xml.sax.Locator

Root of the XML Schema binder.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private List<Plugin>
public final String
defaultPackage1

If this is non-null, this package name takes over all the schema customizations.

public final String
defaultPackage2

If this is non-null, this package name will be used when no customization is specified.

private final BindInfo
emptyBindInfo

Used as a constant instance to represent the empty BindInfo.

private final Map<XSComponent, BindInfo>
externalBindInfos

A map that stores binding declarations augmented by XJC.

public final FieldRendererFactory
private BIGlobalBinding
globalBinding

Global bindings.

private final BindGreen
private Transformer
public final boolean
inExtensionMode

True if the compiler is running in the extension mode (as opposed to the strict conformance mode.)

public final Model
private ParticleBinder
private final BindPurple
private RefererFinder
refFinder

Lazily computed RefererFinder.

private final XSFinder
toPurple

Returns true if the component should be processed by purple.

Constructor Summary

AccessConstructor and Description
protected
BGMBuilder(String defaultPackage1, String defaultPackage2, boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory, List<Plugin> activePlugins)

Method Summary

Modifier and TypeMethod and Description
private void
private BindInfo

Returns:

null if no bind info is associated to this schema component.
_getBindInfoReadOnly
(XSComponent schemaComponent, boolean extended)

Gets the BindInfo object associated to a schema component.

private XSAnnotation
_getXSAnnotation(XSComponent schemaComponent, boolean extended)

public static Model
build(XSSchemaSet _schemas, JCodeModel codeModel, ErrorReceiver _errorReceiver, Options opts)

Entry point.

private void
buildContents()

Fill-in the contents of each classes.

private void
checkMultipleSchemaBindings(XSSchema schema)

Reports an error if there are more than one jaxb:schemaBindings customization.

public String
deriveName(String
The base name. This should be things like element names or type names.
name
,
XSComponent
The component from which the base name was taken. Used to determine how names are modified.
comp
)

Derives a name from a schema component.

private XSAnnotation
enhanceBindInfo(XSAnnotation annon, XSComponent schemaComponent)

public BindInfo

Returns:

always return a valid BindInfo object. If none is specified for the given component, a dummy empty BindInfo will be returned.
getBindInfo
(XSComponent schemaComponent)

Gets the BindInfo object associated to a schema component.

public String

Returns:

return the documentation tag for the given component, null if none found
getDocumentation
(XSComponent schemaComponent)

Gets the documentation object associated to a schema component.

public BIGlobalBinding
getGlobalBinding()

Gets the global bindings.

public Transformer
getIdentityTransformer()

Gets the shared instance of the identity transformer.

protected final BIDom
getLocalDomCustomization(XSParticle p)

Gets the BIDom object that applies to the given particle.

public static QName

Returns:

null if the declaration is anonymous.
getName
(XSDeclaration decl)

Returns the QName of the declaration.

public NameConverter
getNameConverter()

Name converter that implements "XML -> Java name conversion" as specified in the spec.

public BindInfo

Returns:

Always return a non-null valid BindInfo object. Even if no declaration was specified, this method creates a new BindInfo so that new decls can be added.
getOrCreateBindInfo
(XSComponent schemaComponent)

Gets or creates the BindInfo object associated to a schema component.

public ParticleBinder
getParticleBinder()

Gets the particle binder for this binding.

public Set<XSComponent>
getReferer(XSType c)

Find all types that refer to the given complex type.

public boolean
private void
populate(Map<String, ? extends XSComponent> col, XSSchema schema)

Calls ClassSelector for each item in the iterator to populate class items if there is any.

private void
processPackageJavadoc(XSSchema s)

Generates package.html if the customization says so.

private void
promoteGlobalBindings()

List up all the global bindings.

public void
ying(XSComponent sc, XSComponent referer)

If the component maps to a property, forwards to purple, otherwise to green.

Inherited from com.sun.tools.xjc.reader.xmlschema.BindingComponent:
getClassSelectorgetErrorReporter

Field Detail

activePluginsback to summary
private List<Plugin> activePlugins
defaultPackage1back to summary
public final String defaultPackage1

If this is non-null, this package name takes over all the schema customizations.

defaultPackage2back to summary
public final String defaultPackage2

If this is non-null, this package name will be used when no customization is specified.

emptyBindInfoback to summary
private final BindInfo emptyBindInfo

Used as a constant instance to represent the empty BindInfo.

externalBindInfosback to summary
private final Map<XSComponent, BindInfo> externalBindInfos

A map that stores binding declarations augmented by XJC.

fieldRendererFactoryback to summary
public final FieldRendererFactory fieldRendererFactory
globalBindingback to summary
private BIGlobalBinding globalBinding

Global bindings. The empty global binding is set as the default, so that there will be no need to test if the value is null.

greenback to summary
private final BindGreen green
identityTransformerback to summary
private Transformer identityTransformer
inExtensionModeback to summary
public final boolean inExtensionMode

True if the compiler is running in the extension mode (as opposed to the strict conformance mode.)

modelback to summary
public final Model model
particleBinderback to summary
private ParticleBinder particleBinder
purpleback to summary
private final BindPurple purple
refFinderback to summary
private RefererFinder refFinder

Lazily computed RefererFinder.

See Also
getReferer
toPurpleback to summary
private final XSFinder toPurple

Returns true if the component should be processed by purple.

Constructor Detail

BGMBuilderback to summary
protected BGMBuilder(String defaultPackage1, String defaultPackage2, boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory, List<Plugin> activePlugins)

Method Detail

_buildback to summary
private void _build()
_getBindInfoReadOnlyback to summary
private BindInfo _getBindInfoReadOnly(XSComponent schemaComponent, boolean extended)

Gets the BindInfo object associated to a schema component.

Returns:BindInfo

null if no bind info is associated to this schema component.

_getXSAnnotationback to summary
private XSAnnotation _getXSAnnotation(XSComponent schemaComponent, boolean extended)
buildback to summary
public static Model build(XSSchemaSet _schemas, JCodeModel codeModel, ErrorReceiver _errorReceiver, Options opts)

Entry point.

buildContentsback to summary
private void buildContents()

Fill-in the contents of each classes.

checkMultipleSchemaBindingsback to summary
private void checkMultipleSchemaBindings(XSSchema schema)

Reports an error if there are more than one jaxb:schemaBindings customization.

deriveNameback to summary
public String deriveName(String name, XSComponent comp)

Derives a name from a schema component. This method handles prefix/suffix modification and XML-to-Java name conversion.

Parameters
name:String

The base name. This should be things like element names or type names.

comp:XSComponent

The component from which the base name was taken. Used to determine how names are modified.

enhanceBindInfoback to summary
private XSAnnotation enhanceBindInfo(XSAnnotation annon, XSComponent schemaComponent)
getBindInfoback to summary
public BindInfo getBindInfo(XSComponent schemaComponent)

Gets the BindInfo object associated to a schema component.

Returns:BindInfo

always return a valid BindInfo object. If none is specified for the given component, a dummy empty BindInfo will be returned.

getDocumentationback to summary
public String getDocumentation(XSComponent schemaComponent)

Gets the documentation object associated to a schema component.

Returns:String

return the documentation tag for the given component, null if none found

getGlobalBindingback to summary
public BIGlobalBinding getGlobalBinding()

Gets the global bindings.

Annotations
@NotNull
getIdentityTransformerback to summary
public Transformer getIdentityTransformer()

Gets the shared instance of the identity transformer.

getLocalDomCustomizationback to summary
protected final BIDom getLocalDomCustomization(XSParticle p)

Gets the BIDom object that applies to the given particle.

getNameback to summary
public static QName getName(XSDeclaration decl)

Returns the QName of the declaration.

Returns:QName

null if the declaration is anonymous.

getNameConverterback to summary
public NameConverter getNameConverter()

Name converter that implements "XML -> Java name conversion" as specified in the spec. This object abstracts the detail that we use different name conversion depending on the customization.

This object should be used to perform any name conversion needs, instead of the JJavaName class in CodeModel.

getOrCreateBindInfoback to summary
public BindInfo getOrCreateBindInfo(XSComponent schemaComponent)

Gets or creates the BindInfo object associated to a schema component.

Returns:BindInfo

Always return a non-null valid BindInfo object. Even if no declaration was specified, this method creates a new BindInfo so that new decls can be added.

getParticleBinderback to summary
public ParticleBinder getParticleBinder()

Gets the particle binder for this binding.

Annotations
@NotNull
getRefererback to summary
public Set<XSComponent> getReferer(XSType c)

Find all types that refer to the given complex type.

isGenerateMixedExtensionsback to summary
public boolean isGenerateMixedExtensions()
populateback to summary
private void populate(Map<String, ? extends XSComponent> col, XSSchema schema)

Calls ClassSelector for each item in the iterator to populate class items if there is any.

processPackageJavadocback to summary
private void processPackageJavadoc(XSSchema s)

Generates package.html if the customization says so.

promoteGlobalBindingsback to summary
private void promoteGlobalBindings()

List up all the global bindings.

yingback to summary
public void ying(XSComponent sc, XSComponent referer)

If the component maps to a property, forwards to purple, otherwise to green. If the component is mapped to a type, this method needs to return true. See the chart at the class javadoc.