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

public abstract Class ParticleBinder

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder, com.sun.tools.xjc.reader.xmlschema.ExpressionParticleBinder
Imports
java.text.ParseException, java.util.Collection, .Collections, com.sun.codemodel.JJavaName, com.sun.tools.xjc.model.CClassInfo, .CPropertyInfo, com.sun.tools.xjc.reader.Ring, com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration, .BIProperty, com.sun.xml.xsom.XSElementDecl, .XSModelGroup, .XSModelGroupDecl, .XSParticle, .XSTerm, .XSWildcard, com.sun.xml.xsom.visitor.XSTermVisitor

Binds the content models of XSParticle as properties of the class that's being built.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
protected final BGMBuilder

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public final void
build(XSParticle p)

Builds the CPropertyInfos from the given particle (and its descendants), and set them to the class returned by ClassSelector#getCurrentBean().

public abstract void
build(XSParticle p, Collection<XSParticle> forcedProps)

The version of the build method that forces a specified set of particles to become a property.

public abstract boolean

Returns:

false if the fallback will not happen.
checkFallback
(XSParticle p)

Similar to the build method but this method only checks if the BGM that will be built by the build method will do the fallback (map all the properties into one list) or not.

protected final String
computeLabel(XSParticle p)

Computes the label of a given particle.

protected final ClassSelector
protected final CClassInfo
protected final ErrorReporter
protected final <T extends BIDeclaration> T
protected final BIProperty
getLocalPropCustomization(XSParticle p)

Gets the BIProperty object that applies to the given particle.

protected final String
getSpecDefaultName(XSModelGroup mg, final boolean
if the said model group is repeated more than once
repeated
)

Computes a name from unnamed model group by following the spec.

protected final String
makeJavaName(boolean isRepeated, String xmlName)

Converts an XML name to the corresponding Java name.

protected final String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

builderback to summary
protected final BGMBuilder builder

Constructor Detail

ParticleBinderback to summary
protected ParticleBinder()

Method Detail

buildback to summary
public final void build(XSParticle p)

Builds the CPropertyInfos from the given particle (and its descendants), and set them to the class returned by ClassSelector#getCurrentBean().

buildback to summary
public abstract void build(XSParticle p, Collection<XSParticle> forcedProps)

The version of the build method that forces a specified set of particles to become a property.

checkFallbackback to summary
public abstract boolean checkFallback(XSParticle p)

Similar to the build method but this method only checks if the BGM that will be built by the build method will do the fallback (map all the properties into one list) or not.

Returns:boolean

false if the fallback will not happen.

computeLabelback to summary
protected final String computeLabel(XSParticle p)

Computes the label of a given particle. Usually, the getLabel method should be used instead.

getClassSelectorback to summary
protected final ClassSelector getClassSelector()
getCurrentBeanback to summary
protected final CClassInfo getCurrentBean()
getErrorReporterback to summary
protected final ErrorReporter getErrorReporter()
getLocalCustomizationback to summary
protected final <T extends BIDeclaration> T getLocalCustomization(XSParticle p, Class<T> type)
getLocalPropCustomizationback to summary
protected final BIProperty getLocalPropCustomization(XSParticle p)

Gets the BIProperty object that applies to the given particle.

getSpecDefaultNameback to summary
protected final String getSpecDefaultName(XSModelGroup mg, final boolean repeated) throws ParseException

Computes a name from unnamed model group by following the spec. Taking first three elements and combine them.

Parameters
repeated:boolean

if the said model group is repeated more than once

Exceptions
ParseException:
If the method cannot generate a name. For example, when a model group doesn't contain any element reference/declaration at all.
makeJavaNameback to summary
protected final String makeJavaName(boolean isRepeated, String xmlName)

Converts an XML name to the corresponding Java name.

makeJavaNameback to summary
protected final String makeJavaName(XSParticle p, String xmlName)