Package org.jibx.schema.codegen.custom
Class ComponentCustom
java.lang.Object
org.jibx.schema.codegen.custom.CustomBase
org.jibx.schema.codegen.custom.NestingCustomBase
org.jibx.schema.codegen.custom.ComponentCustom
- All Implemented Interfaces:
TypeReplacer
Class for all schema component elements, with the exception of the <schema> element itself. Almost all of these
schema elements can contain other elements, so this extends the nesting base to handle inherited values.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intprivate StringBase name for corresponding property in generated code (nullif not specified).private StringCorresponding generated class name (nullif not specified).private StringComponent name, if relevant.private final StringSchema element name.private booleanExclude component flag.private booleanIgnore component flag.private intCode for inlining.private StringPath to component (nullif not specified).private StringComponent position in siblings of same type (nullif not specified).private QNameActual type to be used.static final EnumSetFields inherited from class org.jibx.schema.codegen.custom.NestingCustomBase
ANY_DISCARD, ANY_DOM, ANY_MAPPED, s_allowedAttributes, s_anyValues, s_selectionValues, SELECTION_CHECKEDBOTH, SELECTION_CHECKEDSET, SELECTION_OVERRIDEBOTH, SELECTION_OVERRIDESET, SELECTION_UNCHECKED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidapply(ComponentExtension exten, ValidationContext vctx) Apply customizations to a schema extension.final SchemaPathbuildPath(ValidationContext vctx) Build the schema path for this customization.Get base name for corresponding property.Get name to be used for generated class.final StringGet the schema element name for the component.booleanCheck if schema component is to be excluded.booleanCheck if schema component is to be ignored (allowed, but not processed, in unmarshalling).booleanCheck if schema component is to be generated inline.booleanCheck if schema component is to be generated as a separate class.private voidsetInline(String text, IUnmarshallingContext ictx) Set the inline text value.Methods inherited from class org.jibx.schema.codegen.custom.NestingCustomBase
getActiveFacetsMask, getAnyHandling, getAnyType, getChildren, getChoiceHandling, getChoiceType, getReplacement, getSubstitutions, getUnionHandling, getUnionType, isAttributeInlined, isChoiceExposed, isUnionExposed, setAnyType, setChoiceType, setEnforcedFacets, setIgnoredFacets, setReplacement, setSubstitutions, setUnionType, validateMethods inherited from class org.jibx.schema.codegen.custom.CustomBase
getContainingObject, getParent, getSchemaRoot, setParent, validateAttributes
-
Field Details
-
INLINE_DEFAULT
public static final int INLINE_DEFAULT- See Also:
-
INLINE_BLOCK
public static final int INLINE_BLOCK- See Also:
-
INLINE_PREFER
public static final int INLINE_PREFER- See Also:
-
s_inlineValues
-
m_elementName
Schema element name. -
m_path
Path to component (nullif not specified). -
m_position
Component position in siblings of same type (nullif not specified). -
m_componentName
Component name, if relevant. -
m_ignore
private boolean m_ignoreIgnore component flag. -
m_exclude
private boolean m_excludeExclude component flag. -
m_inline
private int m_inlineCode for inlining. -
m_className
Corresponding generated class name (nullif not specified). -
m_baseName
Base name for corresponding property in generated code (nullif not specified). -
m_type
Actual type to be used.
-
-
Constructor Details
-
ComponentCustom
Constructor.- Parameters:
name- schema element nameparent-
-
-
Method Details
-
getElementName
Get the schema element name for the component.- Returns:
- name
-
buildPath
Build the schema path for this customization.- Parameters:
vctx- validation context- Returns:
- path constructed path, or
nullif error
-
isIgnored
public boolean isIgnored()Check if schema component is to be ignored (allowed, but not processed, in unmarshalling). This is only applicable to element definitions.- Returns:
trueif ignored,falseif not
-
isExcluded
public boolean isExcluded()Check if schema component is to be excluded.- Returns:
trueif ignored,falseif not
-
isInlined
public boolean isInlined()Check if schema component is to be generated inline.- Returns:
trueif inlined,falseif not
-
isSeparateClass
public boolean isSeparateClass()Check if schema component is to be generated as a separate class.- Returns:
trueif separate class,falseif not
-
getClassName
Get name to be used for generated class.- Returns:
- class name (
nullif not set)
-
getBaseName
Get base name for corresponding property.- Returns:
- property name (
nullif not set)
-
setInline
Set the inline text value. This method is provided only for use when unmarshalling.- Parameters:
text- (nullif not set)ictx-
-
apply
Apply customizations to a schema extension. This also finds matches for any child customizations, and applies the child customizations recursively. The method may be called multiple times for different component extensions, so it must not modify the customization information itself.- Parameters:
exten- target schema extensionvctx- validation context
-