public final class BIProperty extends Object
All the getter methods (such as getBaseType
or
getBindStyle
) honors the delegation chain of
property customization specified in the spec. Namely,
if two property customizations are attached to an attribute
use and an attribute decl, then anything unspecified in the
attribute use defaults to attribute decl.
Property customizations are acknowledged (1) when they are actually used, and (2) when they are given at the component, which is mapped to a class. (so-called "point of declaration" customization)
Modifier and Type | Field and Description |
---|---|
static QName |
NAME
Name of this declaration.
|
protected BindInfo |
parent |
Modifier | Constructor and Description |
---|---|
protected |
BIProperty() |
|
BIProperty(Locator loc,
String _propName,
String _javadoc,
com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty.BaseTypeBean _baseType,
com.sun.tools.xjc.reader.xmlschema.bindinfo.CollectionTypeAttribute collectionType,
Boolean isConst,
OptionalPropertyMode optionalProperty,
Boolean genElemProp) |
Modifier and Type | Method and Description |
---|---|
CAttributePropertyInfo |
createAttributeProperty(com.sun.xml.xsom.XSAttributeUse use,
TypeUse tu) |
CReferencePropertyInfo |
createContentExtendedMixedReferenceProperty(String defaultName,
com.sun.xml.xsom.XSComponent source,
RawTypeSet types) |
CReferencePropertyInfo |
createDummyExtendedMixedReferenceProperty(String defaultName,
com.sun.xml.xsom.XSComponent source,
RawTypeSet types) |
CPropertyInfo |
createElementOrReferenceProperty(String defaultName,
boolean forConstant,
com.sun.xml.xsom.XSParticle source,
RawTypeSet types) |
CElementPropertyInfo |
createElementProperty(String defaultName,
boolean forConstant,
com.sun.xml.xsom.XSParticle source,
RawTypeSet types) |
CReferencePropertyInfo |
createReferenceProperty(String defaultName,
boolean forConstant,
com.sun.xml.xsom.XSComponent source,
RawTypeSet types,
boolean isMixed,
boolean dummy,
boolean content,
boolean isMixedExtended) |
CValuePropertyInfo |
createValueProperty(String defaultName,
boolean forConstant,
com.sun.xml.xsom.XSComponent source,
TypeUse tu,
QName typeName) |
JType |
getBaseType() |
protected BGMBuilder |
getBuilder() |
Collection<BIDeclaration> |
getChildren()
Gets child
BIDeclaration s if any. |
protected JCodeModel |
getCodeModel() |
BIConversion |
getConv() |
static BIProperty |
getCustomization(com.sun.xml.xsom.XSComponent c)
Finds a property customization that describes how the given
component should be mapped to a property (if it's mapped to
a property at all.)
|
protected BIProperty |
getDefault()
Finds a BIProperty which this object should delegate to.
|
String |
getJavadoc()
Gets the associated javadoc.
|
Locator |
getLocation()
Gets the source location where this declaration was written.
|
QName |
getName()
Gets the name of this binding declaration,
which is the same as the tag name of the binding element.
|
OptionalPropertyMode |
getOptionalPropertyMode() |
protected com.sun.xml.xsom.XSComponent |
getOwner() |
String |
getPropertyName(boolean forConstant)
Returns the customized property name.
|
boolean |
isAcknowledged()
Checks if this declaration was acknowledged.
|
boolean |
isConstantProperty()
Gets the inherited value of the "fixedAttrToConstantProperty" customization.
|
void |
markAsAcknowledged()
Marks this declaration to be acknowledged -- either actually
used or the existence is admitted (for example when
a property customization is given at the point of definition.)
|
void |
onSetOwner()
Called when the parent
BindInfo got its owner set. |
void |
setParent(BindInfo parent)
Sets the parent BindInfo object of this declaration.
|
public static final QName NAME
protected BindInfo parent
public BIProperty(Locator loc, String _propName, String _javadoc, com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty.BaseTypeBean _baseType, com.sun.tools.xjc.reader.xmlschema.bindinfo.CollectionTypeAttribute collectionType, Boolean isConst, OptionalPropertyMode optionalProperty, Boolean genElemProp)
protected BIProperty()
public Collection<BIDeclaration> getChildren()
BIDeclaration
BIDeclaration
s if any.getChildren
in interface BIDeclaration
public void setParent(BindInfo parent)
BIDeclaration
This method can be only called from BindInfo
,
and only once. This is a good opportunity to do some
follow-up initialization after JAXB unmarshalling
populated BIDeclaration
.
setParent
in interface BIDeclaration
public String getPropertyName(boolean forConstant)
forConstant
- If the property name is intended for a constant property name,
set to true. This will change the resultpublic String getJavadoc()
public JType getBaseType()
public OptionalPropertyMode getOptionalPropertyMode()
public boolean isConstantProperty()
Note that returning true from this method doesn't necessarily mean that a property needs to be mapped to a constant property. It just means that it's mapped to a constant property if an attribute use carries a fixed value.
I don't like this semantics but that's what the spec implies.
public CValuePropertyInfo createValueProperty(String defaultName, boolean forConstant, com.sun.xml.xsom.XSComponent source, TypeUse tu, QName typeName)
public CAttributePropertyInfo createAttributeProperty(com.sun.xml.xsom.XSAttributeUse use, TypeUse tu)
public CElementPropertyInfo createElementProperty(String defaultName, boolean forConstant, com.sun.xml.xsom.XSParticle source, RawTypeSet types)
defaultName
- If the name is not customized, this name will be used
as the default. Note that the name conversion MUST
be applied before this method is called if necessary.source
- Source schema component from which a field is built.public CReferencePropertyInfo createDummyExtendedMixedReferenceProperty(String defaultName, com.sun.xml.xsom.XSComponent source, RawTypeSet types)
public CReferencePropertyInfo createContentExtendedMixedReferenceProperty(String defaultName, com.sun.xml.xsom.XSComponent source, RawTypeSet types)
public CReferencePropertyInfo createReferenceProperty(String defaultName, boolean forConstant, com.sun.xml.xsom.XSComponent source, RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended)
public CPropertyInfo createElementOrReferenceProperty(String defaultName, boolean forConstant, com.sun.xml.xsom.XSParticle source, RawTypeSet types)
public void markAsAcknowledged()
BIDeclaration
Declarations that are not acknowledged will be considered as an error.
markAsAcknowledged
in interface BIDeclaration
protected BIProperty getDefault()
public static BIProperty getCustomization(com.sun.xml.xsom.XSComponent c)
Consider an attribute use that does NOT carry a property customization. This schema component is nonetheless considered to carry a (sort of) implicit property customization, whose values are defaulted.
This method can be think of the method that returns this implied property customization.
Note that this doesn't mean the given component needs to be mapped to a property. But if it does map to a property, it needs to follow this customization. I think this semantics is next to non-sense but I couldn't think of any other way to follow the spec.
c
- A customization effective on this component will be returned.
Can be null just to get the global customization.public QName getName()
BIDeclaration
public BIConversion getConv()
public Locator getLocation()
BIDeclaration
getLocation
in interface BIDeclaration
protected final com.sun.xml.xsom.XSComponent getOwner()
protected final BGMBuilder getBuilder()
protected final JCodeModel getCodeModel()
public final boolean isAcknowledged()
BIDeclaration
isAcknowledged
in interface BIDeclaration
public void onSetOwner()
BIDeclaration
BindInfo
got its owner set.
This is when declarations are connected to BGMBuilder
and
its sibling components.onSetOwner
in interface BIDeclaration
Copyright © 2017 JBoss by Red Hat. All rights reserved.