com.sun.tools.xjc.reader.xmlschema

Class ParticleBinder

public abstract class ParticleBinder extends Object

Binds the content models of XSParticle as properties of the class that's being built.
Field Summary
protected BGMBuilderbuilder
Constructor Summary
protected ParticleBinder()
Method Summary
voidbuild(XSParticle p)
Builds the CPropertyInfos from the given particle (and its descendants), and set them to the class returned by getCurrentBean.
abstract voidbuild(XSParticle p, Collection<XSParticle> forcedProps)
The version of the build method that forces a specified set of particles to become a property.
abstract booleancheckFallback(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 StringcomputeLabel(XSParticle p)
Computes the label of a given particle.
protected ClassSelectorgetClassSelector()
protected CClassInfogetCurrentBean()
protected ErrorReportergetErrorReporter()
protected <T extends BIDeclaration> TgetLocalCustomization(XSParticle p, Class<T> type)
protected BIPropertygetLocalPropCustomization(XSParticle p)
Gets the BIProperty object that applies to the given particle.
protected StringgetSpecDefaultName(XSModelGroup mg, boolean repeated)
Computes a name from unnamed model group by following the spec.
protected StringmakeJavaName(boolean isRepeated, String xmlName)
Converts an XML name to the corresponding Java name.
protected StringmakeJavaName(XSParticle p, String xmlName)

Field Detail

builder

protected final BGMBuilder builder

Constructor Detail

ParticleBinder

protected ParticleBinder()

Method Detail

build

public final void build(XSParticle p)
Builds the CPropertyInfos from the given particle (and its descendants), and set them to the class returned by getCurrentBean.

build

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.

checkFallback

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: false if the fallback will not happen.

computeLabel

protected final String computeLabel(XSParticle p)
Computes the label of a given particle. Usually, the getLabel method should be used instead.

getClassSelector

protected final ClassSelector getClassSelector()

getCurrentBean

protected final CClassInfo getCurrentBean()

getErrorReporter

protected final ErrorReporter getErrorReporter()

getLocalCustomization

protected final <T extends BIDeclaration> T getLocalCustomization(XSParticle p, Class<T> type)

getLocalPropCustomization

protected final BIProperty getLocalPropCustomization(XSParticle p)
Gets the BIProperty object that applies to the given particle.

getSpecDefaultName

protected final String getSpecDefaultName(XSModelGroup mg, boolean repeated)
Computes a name from unnamed model group by following the spec. Taking first three elements and combine them.

Parameters: repeated if the said model group is repeated more than once

Throws: ParseException If the method cannot generate a name. For example, when a model group doesn't contain any element reference/declaration at all.

makeJavaName

protected final String makeJavaName(boolean isRepeated, String xmlName)
Converts an XML name to the corresponding Java name.

makeJavaName

protected final String makeJavaName(XSParticle p, String xmlName)