Package org.jibx.schema.codegen.custom
Class NestingCustomBase
- java.lang.Object
-
- org.jibx.schema.codegen.custom.CustomBase
-
- org.jibx.schema.codegen.custom.NestingCustomBase
-
- All Implemented Interfaces:
TypeReplacer
- Direct Known Subclasses:
ComponentCustom,SchemaRootBase
public abstract class NestingCustomBase extends CustomBase implements TypeReplacer
Base class for all standard schema customizations that can contain other customizations.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description static intANY_DISCARDstatic intANY_DOMstatic intANY_MAPPEDprivate longm_activeFacetsMaskMask for facets active at this level (all facets not in scope of an ignore state).private intm_anyCodeCode for xs:any representation (-1if not set at level).private LazyListm_childrenChild customizations.private intm_choiceCodeCode for xs:choice handling (-1if not set at level).private java.lang.Booleanm_choiceExposedExpose choice selection state directly to user.private longm_enforcedFacetsMaskMask for facets enforced at this level.private longm_ignoredFacetsMaskMask for facets ignored at this level.private QName[]m_substitutionsList of type substitution pairs.private java.util.Mapm_typeSubstitutionMapMap of type substitutions.private intm_unionCodeCode for xs:union handling (-1if not set at level).private java.lang.Booleanm_unionExposedExpose union selection state directly to user.static StringArrays_allowedAttributesEnumeration of allowed attribute namesstatic EnumSets_anyValuesstatic EnumSets_selectionValuesstatic intSELECTION_CHECKEDBOTHstatic intSELECTION_CHECKEDSETstatic intSELECTION_OVERRIDEBOTHstatic intSELECTION_OVERRIDESETstatic intSELECTION_UNCHECKED
-
Constructor Summary
Constructors Constructor Description NestingCustomBase(NestingCustomBase parent)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetActiveFacetsMask()Get the bitmask of facet element flags to be processed.java.lang.StringgetAnyHandling()Get the xs:any handling text value set specifically for this element.intgetAnyType()Get the xs:any handling type code to be applied for this component and all nested components.LazyListgetChildren()Get child customizations.java.lang.StringgetChoiceHandling()Get the xs:choice handling text value set specifically for this element.intgetChoiceType()Get the xs:choice handling type code to be applied for this component and all nested components.QNamegetReplacement(QName qname)Get replacement type.QName[]getSubstitutions()Get type substitution pairs list.java.lang.StringgetUnionHandling()Get the xs:union handling text value set specifically for this element.intgetUnionType()Get the xs:union handling type code to be applied for this component and all nested components.booleanisAttributeInlined()Check whether xs:attribute definitions should always be inlined, even when used in multiple locations.booleanisChoiceExposed()Check whether xs:choice selection states should be exposed to the user.booleanisUnionExposed()Check whether xs:union selection states should be exposed to the user.private voidsetAnyHandling(java.lang.String text, IUnmarshallingContext ictx)Set the xs:any handling text value.voidsetAnyType(int code)Set the xs:any handling type code.private voidsetChoiceHandling(java.lang.String text, IUnmarshallingContext ictx)Set the xs:choice handling text value.voidsetChoiceType(int code)Set the xs:choice handling type code.voidsetEnforcedFacets(java.lang.String[] facets, IUnmarshallingContext ictx)Set the list of facet elements to be enforced.voidsetIgnoredFacets(java.lang.String[] facets, IUnmarshallingContext ictx)Set the list of facet elements to be ignored.protected voidsetReplacement(QName original, QName replace)Set a type replacement.voidsetSubstitutions(QName[] subs)Set type substitution pairs list.private voidsetUnionHandling(java.lang.String text, IUnmarshallingContext ictx)Set the xs:union handling text value.voidsetUnionType(int code)Set the xs:union handling type code.booleanvalidate(ValidationContext vctx)Validate and finalize customization information.-
Methods inherited from class org.jibx.schema.codegen.custom.CustomBase
getContainingObject, getParent, getSchemaRoot, setParent, validateAttributes
-
-
-
-
Field Detail
-
s_allowedAttributes
public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names
-
ANY_DISCARD
public static final int ANY_DISCARD
- See Also:
- Constant Field Values
-
ANY_DOM
public static final int ANY_DOM
- See Also:
- Constant Field Values
-
ANY_MAPPED
public static final int ANY_MAPPED
- See Also:
- Constant Field Values
-
s_anyValues
public static final EnumSet s_anyValues
-
SELECTION_UNCHECKED
public static final int SELECTION_UNCHECKED
- See Also:
- Constant Field Values
-
SELECTION_CHECKEDSET
public static final int SELECTION_CHECKEDSET
- See Also:
- Constant Field Values
-
SELECTION_CHECKEDBOTH
public static final int SELECTION_CHECKEDBOTH
- See Also:
- Constant Field Values
-
SELECTION_OVERRIDESET
public static final int SELECTION_OVERRIDESET
- See Also:
- Constant Field Values
-
SELECTION_OVERRIDEBOTH
public static final int SELECTION_OVERRIDEBOTH
- See Also:
- Constant Field Values
-
s_selectionValues
public static final EnumSet s_selectionValues
-
m_substitutions
private QName[] m_substitutions
List of type substitution pairs.
-
m_enforcedFacetsMask
private long m_enforcedFacetsMask
Mask for facets enforced at this level.
-
m_ignoredFacetsMask
private long m_ignoredFacetsMask
Mask for facets ignored at this level.
-
m_choiceExposed
private java.lang.Boolean m_choiceExposed
Expose choice selection state directly to user.
-
m_choiceCode
private int m_choiceCode
Code for xs:choice handling (-1if not set at level).
-
m_unionExposed
private java.lang.Boolean m_unionExposed
Expose union selection state directly to user.
-
m_unionCode
private int m_unionCode
Code for xs:union handling (-1if not set at level).
-
m_anyCode
private int m_anyCode
Code for xs:any representation (-1if not set at level).
-
m_children
private final LazyList m_children
Child customizations.
-
m_typeSubstitutionMap
private java.util.Map m_typeSubstitutionMap
Map of type substitutions.
-
m_activeFacetsMask
private long m_activeFacetsMask
Mask for facets active at this level (all facets not in scope of an ignore state).
-
-
Constructor Detail
-
NestingCustomBase
public NestingCustomBase(NestingCustomBase parent)
Constructor.- Parameters:
parent-
-
-
Method Detail
-
getSubstitutions
public QName[] getSubstitutions()
Get type substitution pairs list.- Returns:
- substitutions
-
setSubstitutions
public void setSubstitutions(QName[] subs)
Set type substitution pairs list.- Parameters:
subs-
-
setEnforcedFacets
public void setEnforcedFacets(java.lang.String[] facets, IUnmarshallingContext ictx)Set the list of facet elements to be enforced.- Parameters:
facets-ictx-
-
setIgnoredFacets
public void setIgnoredFacets(java.lang.String[] facets, IUnmarshallingContext ictx)Set the list of facet elements to be ignored.- Parameters:
facets-ictx-
-
getActiveFacetsMask
public long getActiveFacetsMask()
Get the bitmask of facet element flags to be processed.- Returns:
- bitmask
-
getChildren
public LazyList getChildren()
Get child customizations.- Returns:
- children
-
setReplacement
protected void setReplacement(QName original, QName replace)
Set a type replacement.- Parameters:
original-replace-
-
getReplacement
public QName getReplacement(QName qname)
Get replacement type.- Specified by:
getReplacementin interfaceTypeReplacer- Parameters:
qname-- Returns:
- replacement type (
nullif deletion; original type, if no replacement defined)
-
getAnyType
public int getAnyType()
Get the xs:any handling type code to be applied for this component and all nested components. The default value isANY_DOMif not overridden at any level.- Returns:
- code
-
setAnyType
public void setAnyType(int code)
Set the xs:any handling type code.- Parameters:
code- handling code,-1if to be unset
-
getAnyHandling
public java.lang.String getAnyHandling()
Get the xs:any handling text value set specifically for this element.- Returns:
- text (
nullif not set)
-
setAnyHandling
private void setAnyHandling(java.lang.String text, IUnmarshallingContext ictx)Set the xs:any handling text value. This method is provided only for use when unmarshalling.- Parameters:
text- (nullif not set)ictx-
-
isChoiceExposed
public boolean isChoiceExposed()
Check whether xs:choice selection states should be exposed to the user. The default isfalseif not overridden at any level.- Returns:
- expose choice state flag
-
getChoiceType
public int getChoiceType()
Get the xs:choice handling type code to be applied for this component and all nested components. The default value isSELECTION_CHECKEDSETif not overridden at any level.- Returns:
- code
-
setChoiceType
public void setChoiceType(int code)
Set the xs:choice handling type code.- Parameters:
code- handling code,-1if to be unset
-
getChoiceHandling
public java.lang.String getChoiceHandling()
Get the xs:choice handling text value set specifically for this element.- Returns:
- text (
nullif not set)
-
setChoiceHandling
private void setChoiceHandling(java.lang.String text, IUnmarshallingContext ictx)Set the xs:choice handling text value. This method is provided only for use when unmarshalling.- Parameters:
text- (nullif not set)ictx-
-
isUnionExposed
public boolean isUnionExposed()
Check whether xs:union selection states should be exposed to the user. The default isfalseif not overridden at any level.- Returns:
- expose union state flag
-
getUnionType
public int getUnionType()
Get the xs:union handling type code to be applied for this component and all nested components. The default value isSELECTION_CHECKEDSETif not overridden at any level.- Returns:
- code
-
setUnionType
public void setUnionType(int code)
Set the xs:union handling type code.- Parameters:
code- handling code,-1if to be unset
-
getUnionHandling
public java.lang.String getUnionHandling()
Get the xs:union handling text value set specifically for this element.- Returns:
- text (
nullif not set)
-
setUnionHandling
private void setUnionHandling(java.lang.String text, IUnmarshallingContext ictx)Set the xs:union handling text value. This method is provided only for use when unmarshalling.- Parameters:
text- (nullif not set)ictx-
-
isAttributeInlined
public boolean isAttributeInlined()
Check whether xs:attribute definitions should always be inlined, even when used in multiple locations. The default isfalseif not overridden at any level. TODO: implement in customizations- Returns:
- inline attribute flag
-
validate
public boolean validate(ValidationContext vctx)
Validate and finalize customization information. This creates a new type substitution map and active facets mask, or inherits unchanged values from the parent customization.- Parameters:
vctx- validation context- Returns:
trueif valid,falseif not
-
-