Package org.opencms.xml.xml2json
Class CmsXmlContentTree.Field
- java.lang.Object
-
- org.opencms.xml.xml2json.CmsXmlContentTree.Field
-
- Enclosing class:
- CmsXmlContentTree
public class CmsXmlContentTree.Field extends java.lang.Object
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
Fields Modifier and Type Field Description protected CmsXmlContentTree.Node
m_parentNode
The parent node of the field.
-
Constructor Summary
Constructors Constructor Description Field(I_CmsXmlSchemaType fieldDef, java.util.List<CmsXmlContentTree.Node> nodes)
Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description I_CmsXmlSchemaType
getFieldDefinition()
Gets the field definition.java.lang.String
getName()
Gets the field name.CmsXmlContentTree.Node
getNode()
Gets the node if there is exactly one in the node list, otherwise throws an error.java.util.List<CmsXmlContentTree.Node>
getNodes()
Gets the nodes for the individual elements with that field name.CmsXmlContentTree.Node
getParentNode()
Gets the parent node.boolean
isMultiChoice()
Returns true if the field refers to a choice element with maxOccurs greater than 1.boolean
isMultivalue()
Returns true if this is a multivalue field.boolean
isOptional()
Returns true if this is an optional field.void
setParentNode(CmsXmlContentTree.Node parentNode)
Sets the parent node of the field.java.lang.String
toString()
-
-
-
Field Detail
-
m_parentNode
protected CmsXmlContentTree.Node m_parentNode
The parent node of the field.
-
-
Constructor Detail
-
Field
public Field(I_CmsXmlSchemaType fieldDef, java.util.List<CmsXmlContentTree.Node> nodes)
Create a new instance.- Parameters:
fieldDef
- the field definitionnodes
- the nodes for the individual field elements
-
-
Method Detail
-
getFieldDefinition
public I_CmsXmlSchemaType getFieldDefinition()
Gets the field definition.- Returns:
- the field definition
-
getName
public java.lang.String getName()
Gets the field name.- Returns:
- the field name
-
getNode
public CmsXmlContentTree.Node getNode()
Gets the node if there is exactly one in the node list, otherwise throws an error.- Returns:
- the node
-
getNodes
public java.util.List<CmsXmlContentTree.Node> getNodes()
Gets the nodes for the individual elements with that field name.- Returns:
- the sub-nodes for this field
-
getParentNode
public CmsXmlContentTree.Node getParentNode()
Gets the parent node.- Returns:
- the parent node
-
isMultiChoice
public boolean 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
public boolean isMultivalue()
Returns true if this is a multivalue field.- Returns:
- true if this is a multivalue field
-
isOptional
public boolean isOptional()
Returns true if this is an optional field.- Returns:
- true if this is an optional field
-
setParentNode
public void setParentNode(CmsXmlContentTree.Node parentNode)
Sets the parent node of the field.- Parameters:
parentNode
- the parent node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-