Package org.jibx.schema.generator
Class MappingDetail
java.lang.Object
org.jibx.schema.generator.MappingDetail
Holder for the details of how a mapping is to be represented in a schema. Each mapping is converted to a complex
type, but the complex type may be either global or local to a containing global element. In the case of a mapping
used as the base for one or more extension types, both a global complex type and a global element that references the
type are required. This also tracks the content form for the complex type definition.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MappingElementSchema type extension base mapping.private final booleanHas attribute(s) flag.private final booleanHas child element(s) flag.private final booleanHas child text(s) flag.private booleanGenerate as element flag.private booleanGenerate as group/attributeGroup flag.private booleanGenerate as complex type flag.private final MappingElementBaseMapping to be generated.private final QNameElement/group/attributeGroup name (ignored if not generated as any of these).private QNameSubstitution group base name.private final QNameType name (ignored if not generated as complex type). -
Constructor Summary
ConstructorsConstructorDescriptionMappingDetail(MappingElementBase map, boolean haschild, boolean hastext, MappingElement base, QName tname, QName oname) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet base mapping for schema type extension.Get mapping.Get element name.Get substitution group base name.Get name for type.booleanCheck if attribute component present.booleanhasChild()Check if child element component present.booleanhasText()Check if text component present.booleanCheck if generating as an element.booleanisGroup()Check if generating as a group.booleanisType()Check if generating as a group.voidsetElement(boolean gen) Set generating as an element.voidsetGroup(boolean gen) Set generating as a group.voidsetSubstitution(QName qname) Set substitution group base name.voidsetType(boolean gen) Set generating as a type.
-
Field Details
-
m_mapping
Mapping to be generated. -
m_extensionBase
Schema type extension base mapping. -
m_hasChild
private final boolean m_hasChildHas child element(s) flag. -
m_hasText
private final boolean m_hasTextHas child text(s) flag. -
m_hasAttribute
private final boolean m_hasAttributeHas attribute(s) flag. -
m_typeName
Type name (ignored if not generated as complex type). -
m_otherName
Element/group/attributeGroup name (ignored if not generated as any of these). -
m_substitutionName
Substitution group base name. -
m_isType
private boolean m_isTypeGenerate as complex type flag. -
m_isElement
private boolean m_isElementGenerate as element flag. -
m_isGroup
private boolean m_isGroupGenerate as group/attributeGroup flag. If set, will be generated as either a group (if elements defined), an attributeGroup (if attributes defined), or both.
-
-
Constructor Details
-
MappingDetail
public MappingDetail(MappingElementBase map, boolean haschild, boolean hastext, MappingElement base, QName tname, QName oname) Constructor.- Parameters:
map- mapping definitionhaschild- has child element(s) flaghastext- has child text(s) flagbase- base mapping for schema type extensiontname- name as typeoname- name as element/group/attributeGroup
-
-
Method Details
-
isElement
public boolean isElement()Check if generating as an element.- Returns:
- flag
-
setElement
public void setElement(boolean gen) Set generating as an element.- Parameters:
gen-
-
isGroup
public boolean isGroup()Check if generating as a group.- Returns:
- flag
-
setGroup
public void setGroup(boolean gen) Set generating as a group.- Parameters:
gen-
-
isType
public boolean isType()Check if generating as a group.- Returns:
- flag
-
setType
public void setType(boolean gen) Set generating as a type.- Parameters:
gen-
-
getExtensionBase
Get base mapping for schema type extension.- Returns:
- extension base
-
hasAttribute
public boolean hasAttribute()Check if attribute component present.- Returns:
- flag
-
hasChild
public boolean hasChild()Check if child element component present.- Returns:
- flag
-
hasText
public boolean hasText()Check if text component present.- Returns:
- flag
-
getMapping
Get mapping.- Returns:
- mapping
-
getTypeName
Get name for type.- Returns:
- name
-
getOtherName
Get element name.- Returns:
- element name for concrete mapping (
nullif abstract)
-
getSubstitution
Get substitution group base name.- Returns:
- substitution group base name
-
setSubstitution
Set substitution group base name.- Parameters:
qname-
-