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

public final Class BIProperty

extends AbstractDeclarationImpl
Class Inheritance
Annotations
@XmlRootElement
name:property
Imports
java.util.Collection, .Collections, jakarta.xml.bind.annotation.XmlAttribute, .XmlElement, .XmlElementRef, .XmlRootElement, javax.xml.namespace.QName, com.sun.codemodel.JJavaName, .JType, com.sun.tools.xjc.ErrorReceiver, com.sun.tools.xjc.generator.bean.field.FieldRenderer, .FieldRendererFactory, .IsSetFieldRenderer, com.sun.tools.xjc.model.CAttributePropertyInfo, .CCustomizations, .CElementPropertyInfo, .CPropertyInfo, .CReferencePropertyInfo, .CValuePropertyInfo, .TypeUse, com.sun.tools.xjc.reader.Const, .RawTypeSet, .Ring, .TypeUtil, com.sun.tools.xjc.reader.xmlschema.BGMBuilder, org.glassfish.jaxb.core.api.impl.NameConverter, com.sun.xml.xsom.XSAnnotation, .XSAttGroupDecl, .XSAttributeDecl, .XSAttributeUse, .XSComplexType, .XSComponent, .XSContentType, .XSElementDecl, .XSFacet, .XSIdentityConstraint, .XSModelGroup, .XSModelGroupDecl, .XSNotation, .XSParticle, .XSSchema, .XSSimpleType, .XSWildcard, .XSXPath, com.sun.xml.xsom.util.XSFinder, com.sun.xml.xsom.visitor.XSFunction, org.xml.sax.Locator

Property customization. This customization turns an arbitrary schema component into a Java property (some restrictions apply.)

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)

Author
Kohsuke Kawaguchi ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private BIProperty.BaseTypeBean
private CollectionTypeAttribute
private static final XSFunction<XSComponent>
private Boolean
private boolean
private final XSFinder
hasFixedValue

Function object that returns true if a component has a fixed value constraint.

private Boolean
private String
private String
public static final QName
NAME

Name of this declaration.

private OptionalPropertyMode
Inherited from com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl:
locparent

Constructor Summary

AccessConstructor and Description
public
BIProperty(Locator loc, String _propName, String _javadoc, BIProperty.BaseTypeBean _baseType, CollectionTypeAttribute collectionType, Boolean isConst, OptionalPropertyMode optionalProperty, Boolean genElemProp)

protected

Method Summary

Modifier and TypeMethod and Description
private static String
private void
public CAttributePropertyInfo
public CReferencePropertyInfo
public CReferencePropertyInfo
public CPropertyInfo
createElementOrReferenceProperty(String defaultName, boolean forConstant, XSParticle source, RawTypeSet types)

public CElementPropertyInfo
createElementProperty(String
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.
defaultName
,
boolean forConstant, XSParticle
Source schema component from which a field is built.
source
,
RawTypeSet types)

public CReferencePropertyInfo
createReferenceProperty(String defaultName, boolean forConstant, XSComponent source, RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended)

public CValuePropertyInfo
createValueProperty(String defaultName, boolean forConstant, XSComponent source, TypeUse tu, QName typeName)

private Boolean
generateElementProperty()

If true, the property will automatically be a reference property.

public JType
public Collection<BIDeclaration>
pack-priv CollectionTypeAttribute

Returns:

Always return non-null.
getCollectionType
()

Gets the realization of this field.

public BIConversion
public static BIProperty

Returns:

Always return non-null valid object.
getCustomization
(XSComponent
A customization effective on this component will be returned. Can be null just to get the global customization.
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.)

Consider an attribute use that does NOT carry a property customization.

private CCustomizations
private CCustomizations
private CCustomizations
private CCustomizations
protected BIProperty

Returns:

always return non-null for normal BIProperties. If this object is contained in the BIGlobalBinding, then this method returns null to indicate that there's no more default.
getDefault
()

Finds a BIProperty which this object should delegate to.

private static BIProperty
public String

Returns:

null if none is specfieid.
getJavadoc
()

Gets the associated javadoc.

public QName
getName()

Implements com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.getName.

Gets the name of this binding declaration, which is the same as the tag name of the binding element.

public OptionalPropertyMode
public String

Returns:

This method can return null if the customization doesn't specify the name.
getPropertyName
(boolean
If the property name is intended for a constant property name, set to true. This will change the result
forConstant
)

Returns the customized property name.

public boolean
isConstantProperty()

Gets the inherited value of the "fixedAttrToConstantProperty" customization.

public void
markAsAcknowledged()

Overrides com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl.markAsAcknowledged.

Implements com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.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.)

Declarations that are not acknowledged will be considered as an error.

pack-priv void
public void
private <T extends CPropertyInfo> T
wrapUp(T prop, XSComponent source)

Common finalization of CPropertyInfo for the create***Property methods.

Inherited from com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl:
getBuildergetCodeModelgetLocationgetOwnerisAcknowledgedonSetOwner

Field Detail

baseTypeback to summary
private BIProperty.BaseTypeBean baseType
Annotations
@XmlElement
collectionTypeback to summary
private CollectionTypeAttribute collectionType
Annotations
@XmlAttribute
defaultCustomizationFinderback to summary
private static final XSFunction<XSComponent> defaultCustomizationFinder
generateElementPropertyback to summary
private Boolean generateElementProperty
Annotations
@XmlAttribute
generateFailFastSetterMethodback to summary
private boolean generateFailFastSetterMethod
Annotations
@XmlAttribute
hasFixedValueback to summary
private final XSFinder hasFixedValue

Function object that returns true if a component has a fixed value constraint.

isConstantPropertyback to summary
private Boolean isConstantProperty
Annotations
@XmlAttribute
name:fixedAttributeAsConstantProperty
javadocback to summary
private String javadoc
Annotations
@XmlElement
nameback to summary
private String name
Annotations
@XmlAttribute
NAMEback to summary
public static final QName NAME

Name of this declaration.

optionalPropertyback to summary
private OptionalPropertyMode optionalProperty
Annotations
@XmlAttribute

Constructor Detail

BIPropertyback to summary
public BIProperty(Locator loc, String _propName, String _javadoc, BIProperty.BaseTypeBean _baseType, CollectionTypeAttribute collectionType, Boolean isConst, OptionalPropertyMode optionalProperty, Boolean genElemProp)
BIPropertyback to summary
protected BIProperty()

Method Detail

concatback to summary
private static String concat(String s1, String s2)
constantPropertyErrorCheckback to summary
private void constantPropertyErrorCheck()
createAttributePropertyback to summary
public CAttributePropertyInfo createAttributeProperty(XSAttributeUse use, TypeUse tu)
createContentExtendedMixedReferencePropertyback to summary
public CReferencePropertyInfo createContentExtendedMixedReferenceProperty(String defaultName, XSComponent source, RawTypeSet types)
createDummyExtendedMixedReferencePropertyback to summary
public CReferencePropertyInfo createDummyExtendedMixedReferenceProperty(String defaultName, XSComponent source, RawTypeSet types)
createElementOrReferencePropertyback to summary
public CPropertyInfo createElementOrReferenceProperty(String defaultName, boolean forConstant, XSParticle source, RawTypeSet types)
createElementPropertyback to summary
public CElementPropertyInfo createElementProperty(String defaultName, boolean forConstant, XSParticle source, RawTypeSet types)
Parameters
defaultName:String

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:XSParticle

Source schema component from which a field is built.

createReferencePropertyback to summary
public CReferencePropertyInfo createReferenceProperty(String defaultName, boolean forConstant, XSComponent source, RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended)
createValuePropertyback to summary
public CValuePropertyInfo createValueProperty(String defaultName, boolean forConstant, XSComponent source, TypeUse tu, QName typeName)
generateElementPropertyback to summary
private Boolean generateElementProperty()

If true, the property will automatically be a reference property. (Talk about confusing names!)

getBaseTypeback to summary
public JType getBaseType()
getChildrenback to summary
public Collection<BIDeclaration> getChildren()

Overrides com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl.getChildren.

Implements com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.getChildren.

Doc from com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.getChildren.

Gets child s if any.

Annotations
@Override
getCollectionTypeback to summary
pack-priv CollectionTypeAttribute getCollectionType()

Gets the realization of this field.

Returns:CollectionTypeAttribute

Always return non-null.

getConvback to summary
public BIConversion getConv()
getCustomizationback to summary
public static BIProperty getCustomization(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.)

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.

Parameters
c:XSComponent

A customization effective on this component will be returned. Can be null just to get the global customization.

Returns:BIProperty

Always return non-null valid object.

getCustomizationsback to summary
private CCustomizations getCustomizations(XSComponent src)
getCustomizationsback to summary
private CCustomizations getCustomizations(XSComponent... src)
getCustomizationsback to summary
private CCustomizations getCustomizations(XSAttributeUse src)
getCustomizationsback to summary
private CCustomizations getCustomizations(XSParticle src)
getDefaultback to summary
protected BIProperty getDefault()

Finds a BIProperty which this object should delegate to.

Returns:BIProperty

always return non-null for normal BIProperties. If this object is contained in the BIGlobalBinding, then this method returns null to indicate that there's no more default.

getDefaultback to summary
private static BIProperty getDefault(BGMBuilder builder, XSComponent c)
getJavadocback to summary
public String getJavadoc()

Gets the associated javadoc.

Returns:String

null if none is specfieid.

getNameback to summary
public QName getName()

Implements com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.getName.

Doc from com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.getName.

Gets the name of this binding declaration, which is the same as the tag name of the binding element.

Annotations
@Override
getOptionalPropertyModeback to summary
public OptionalPropertyMode getOptionalPropertyMode()
getPropertyNameback to summary
public String getPropertyName(boolean forConstant)

Returns the customized property name. This method honors the "enableJavaNamingConvention" customization and formats the property name accordingly if necessary. Thus the caller should NOT apply the XML-to-Java name conversion algorithm to the value returned from this method.

Parameters
forConstant:boolean

If the property name is intended for a constant property name, set to true. This will change the result

Returns:String

This method can return null if the customization doesn't specify the name.

isConstantPropertyback to summary
public boolean isConstantProperty()

Gets the inherited value of the "fixedAttrToConstantProperty" customization.

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.

markAsAcknowledgedback to summary
public void markAsAcknowledged()

Overrides com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl.markAsAcknowledged.

Implements com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.markAsAcknowledged.

Doc from com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.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.)

Declarations that are not acknowledged will be considered as an error.

Annotations
@Override
setGenerateIsSetMethodback to summary
pack-priv void setGenerateIsSetMethod(boolean b)
Annotations
@XmlAttribute
setParentback to summary
public void setParent(BindInfo parent)

Overrides com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl.setParent.

Implements com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.setParent.

Doc from com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration.setParent.

Sets the parent BindInfo object of this declaration. A declaration object can use this pointer to access context information, such as other customizations.

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 .

Annotations
@Override
wrapUpback to summary
private <T extends CPropertyInfo> T wrapUp(T prop, XSComponent source)

Common finalization of CPropertyInfo for the create***Property methods.

com.sun.tools.xjc.reader.xmlschema.bindinfo back to summary

public final Class BIProperty.BaseTypeBean

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty.BaseTypeBean

Field Summary

Modifier and TypeField and Description
pack-priv BIConversion
conv

If there's a nested javaType customization, this field will keep that customization.

pack-priv String
name

Java type name.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

convback to summary
pack-priv BIConversion conv

If there's a nested javaType customization, this field will keep that customization. Otherwise null. This customization, if present, is used to customize the simple type mapping at the point of reference.

Annotations
@XmlElementRef
nameback to summary
pack-priv String name

Java type name.

Annotations
@XmlAttribute

Constructor Detail

BaseTypeBeanback to summary
public BaseTypeBean()