Package org.opencms.xml.xml2json
Class CmsXmlContentTree.Field
java.lang.Object
org.opencms.xml.xml2json.CmsXmlContentTree.Field
- Enclosing class:
- CmsXmlContentTree
Field of a complex type.
This represents one or more elements with the same field name in a sequence in an XML content.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionField
(I_CmsXmlSchemaType fieldDef, List<CmsXmlContentTree.Node> nodes) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the field definition.getName()
Gets the field name.getNode()
Gets the node if there is exactly one in the node list, otherwise throws an error.getNodes()
Gets the nodes for the individual elements with that field name.Gets the parent node.boolean
Returns true if the field refers to a choice element with maxOccurs greater than 1.boolean
Returns true if this is a multivalue field.boolean
Returns true if this is an optional field.void
setParentNode
(CmsXmlContentTree.Node parentNode) Sets the parent node of the field.toString()
-
Field Details
-
m_parentNode
The parent node of the field.
-
-
Constructor Details
-
Field
Create a new instance.- Parameters:
fieldDef
- the field definitionnodes
- the nodes for the individual field elements
-
-
Method Details
-
getFieldDefinition
Gets the field definition.- Returns:
- the field definition
-
getName
Gets the field name.- Returns:
- the field name
-
getNode
Gets the node if there is exactly one in the node list, otherwise throws an error.- Returns:
- the node
-
getNodes
Gets the nodes for the individual elements with that field name.- Returns:
- the sub-nodes for this field
-
getParentNode
Gets the parent node.- Returns:
- the parent node
-
isMultiChoice
Returns true if the field refers to a choice element with maxOccurs greater than 1.- Returns:
- true if this is a multichoice attribute
-
isMultivalue
Returns true if this is a multivalue field.- Returns:
- true if this is a multivalue field
-
isOptional
Returns true if this is an optional field.- Returns:
- true if this is an optional field
-
setParentNode
Sets the parent node of the field.- Parameters:
parentNode
- the parent node
-
toString
-