public abstract class ParticleBinder extends Object
XSParticle
as properties of the class that's being built.Modifier and Type | Field and Description |
---|---|
protected BGMBuilder |
builder |
Modifier | Constructor and Description |
---|---|
protected |
ParticleBinder() |
Modifier and Type | Method and Description |
---|---|
void |
build(XSParticle p)
Builds the
CPropertyInfo s from the given particle
(and its descendants), and set them to the class returned by
ClassSelector.getCurrentBean() . |
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.
|
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.
|
protected String |
computeLabel(XSParticle p)
Computes the label of a given particle.
|
protected ClassSelector |
getClassSelector() |
protected CClassInfo |
getCurrentBean() |
protected ErrorReporter |
getErrorReporter() |
protected <T extends BIDeclaration> |
getLocalCustomization(XSParticle p,
Class<T> type) |
protected BIProperty |
getLocalPropCustomization(XSParticle p)
Gets the BIProperty object that applies to the given particle.
|
protected String |
getSpecDefaultName(XSModelGroup mg,
boolean repeated)
Computes a name from unnamed model group by following the spec.
|
protected String |
makeJavaName(boolean isRepeated,
String xmlName)
Converts an XML name to the corresponding Java name.
|
protected String |
makeJavaName(XSParticle p,
String xmlName) |
protected final BGMBuilder builder
public final void build(XSParticle p)
CPropertyInfo
s 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)
public abstract boolean checkFallback(XSParticle p)
protected final CClassInfo getCurrentBean()
protected final BIProperty getLocalPropCustomization(XSParticle p)
protected final <T extends BIDeclaration> T getLocalCustomization(XSParticle p, Class<T> type)
protected final String computeLabel(XSParticle p)
protected final String makeJavaName(boolean isRepeated, String xmlName)
protected final String makeJavaName(XSParticle p, String xmlName)
protected final String getSpecDefaultName(XSModelGroup mg, boolean repeated) throws ParseException
repeated
- if the said model group is repeated more than onceParseException
- If the method cannot generate a name. For example, when
a model group doesn't contain any element reference/declaration
at all.protected final ErrorReporter getErrorReporter()
protected final ClassSelector getClassSelector()
Copyright © 2021 JBoss by Red Hat. All rights reserved.