Class BGMBuilder
- java.lang.Object
-
- com.sun.tools.xjc.reader.xmlschema.BindingComponent
-
- com.sun.tools.xjc.reader.xmlschema.BGMBuilder
-
public class BGMBuilder extends BindingComponent
Root of the XML Schema binder.
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description StringdefaultPackage1If this is non-null, this package name takes over all the schema customizations.StringdefaultPackage2If this is non-null, this package name will be used when no customization is specified.FieldRendererFactoryfieldRendererFactorybooleaninExtensionModeTrue if the compiler is running in the extension mode (as opposed to the strict conformance mode.)Modelmodel
-
Constructor Summary
Constructors Modifier Constructor Description protectedBGMBuilder(String defaultPackage1, String defaultPackage2, boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory, List<Plugin> activePlugins)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Modelbuild(XSSchemaSet _schemas, JCodeModel codeModel, ErrorReceiver _errorReceiver, Options opts)Entry point.StringderiveName(String name, XSComponent comp)Derives a name from a schema component.BindInfogetBindInfo(XSComponent schemaComponent)Gets the BindInfo object associated to a schema component.BIGlobalBindinggetGlobalBinding()Gets the global bindings.TransformergetIdentityTransformer()Gets the shared instance of the identity transformer.protected BIDomgetLocalDomCustomization(XSParticle p)Gets theBIDomobject that applies to the given particle.static QNamegetName(XSDeclaration decl)Returns the QName of the declaration.com.sun.xml.bind.api.impl.NameConvertergetNameConverter()Name converter that implements "XML -> Javaname conversion" as specified in the spec.BindInfogetOrCreateBindInfo(XSComponent schemaComponent)Gets or creates the BindInfo object associated to a schema component.ParticleBindergetParticleBinder()Gets the particle binder for this binding.Set<XSComponent>getReferer(XSType c)Find all types that refer to the given complex type.booleanisGenerateMixedExtensions()voidying(XSComponent sc, XSComponent referer)If the component maps to a property, forwards to purple, otherwise to green.-
Methods inherited from class com.sun.tools.xjc.reader.xmlschema.BindingComponent
getClassSelector, getErrorReporter
-
-
-
-
Field Detail
-
inExtensionMode
public final boolean inExtensionMode
True if the compiler is running in the extension mode (as opposed to the strict conformance mode.)
-
defaultPackage1
public final String defaultPackage1
If this is non-null, this package name takes over all the schema customizations.
-
defaultPackage2
public final String defaultPackage2
If this is non-null, this package name will be used when no customization is specified.
-
model
public final Model model
-
fieldRendererFactory
public final FieldRendererFactory fieldRendererFactory
-
-
Constructor Detail
-
BGMBuilder
protected BGMBuilder(String defaultPackage1, String defaultPackage2, boolean _inExtensionMode, FieldRendererFactory fieldRendererFactory, List<Plugin> activePlugins)
-
-
Method Detail
-
build
public static Model build(XSSchemaSet _schemas, JCodeModel codeModel, ErrorReceiver _errorReceiver, Options opts)
Entry point.
-
getGlobalBinding
@NotNull public BIGlobalBinding getGlobalBinding()
Gets the global bindings.
-
getParticleBinder
@NotNull public ParticleBinder getParticleBinder()
Gets the particle binder for this binding.
-
getNameConverter
public com.sun.xml.bind.api.impl.NameConverter getNameConverter()
Name converter that implements "XML -> Javaname 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.
-
getOrCreateBindInfo
public BindInfo getOrCreateBindInfo(XSComponent schemaComponent)
Gets or creates the BindInfo object associated to a schema component.- 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.
-
getBindInfo
public BindInfo getBindInfo(XSComponent schemaComponent)
Gets the BindInfo object associated to a schema component.- Returns:
- always return a valid
BindInfoobject. If none is specified for the given component, a dummy empty BindInfo will be returned.
-
getLocalDomCustomization
protected final BIDom getLocalDomCustomization(XSParticle p)
Gets theBIDomobject that applies to the given particle.
-
ying
public void ying(XSComponent sc, @Nullable 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.
-
getIdentityTransformer
public Transformer getIdentityTransformer()
Gets the shared instance of the identity transformer.
-
getReferer
public Set<XSComponent> getReferer(XSType c)
Find all types that refer to the given complex type.
-
getName
public static QName getName(XSDeclaration decl)
Returns the QName of the declaration.- Returns:
- null if the declaration is anonymous.
-
deriveName
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- The base name. This should be things like element names or type names.comp- The component from which the base name was taken. Used to determine how names are modified.
-
isGenerateMixedExtensions
public boolean isGenerateMixedExtensions()
-
-