Package org.opencms.xml.content
Class CmsXmlContentValueSequence
java.lang.Object
org.opencms.xml.content.CmsXmlContentValueSequence
Describes the sequence of XML content values of a specific type in an XML content instance.
- Since:
- 6.0.0
-
Constructor Summary
ConstructorDescriptionCmsXmlContentValueSequence
(String path, Locale locale, CmsXmlContent content) Generates a new content sequence element from the given type, content and content definition. -
Method Summary
Modifier and TypeMethodDescriptionAdds a value element of the type the original xpath indicates at the selected index to the XML content document.Adds a value element of the type indicated by the given xpath at the selected index to the XML content document.addValue
(CmsObject cms, I_CmsXmlSchemaType type, int index) Adds a value element of the given type at the selected index to the XML content document.int
Returns the count of XML content values for the selected schema type and locale in the XML content.Returns the locale this sequence is based on.int
Returns the maximum occurrences of this type in the XML content schema.int
Returns the minimum occurrences of this type in the XML content schema.getPath()
Returns the (simplified) Xpath expression that identifies the root node of this content value sequence.getValue
(int index) Returns the XML content values from the index position of this sequence.Returns the list of XML content values for the selected schema type and locale in the XML content.boolean
Returnstrue
if this sequence represents a choice sequence.void
removeValue
(int index) Removes the value element of the sequence type at the selected index from XML content document.
-
Constructor Details
-
CmsXmlContentValueSequence
Generates a new content sequence element from the given type, content and content definition.- Parameters:
path
- the path in the document to generate the value sequence forlocale
- the locale to get the content values fromcontent
- the XML content to generate the sequence element out of
-
-
Method Details
-
addValue
Adds a value element of the given type at the selected index to the XML content document.- Parameters:
cms
- the current users OpenCms contexttype
- the type to addindex
- the index where to add the new value element- Returns:
- the added XML content value element
- See Also:
-
addValue
Adds a value element of the type the original xpath indicates at the selected index to the XML content document.The "original xpath" is the path used in the constructor when creating this value sequence.
- Parameters:
cms
- the current users OpenCms contextindex
- the index where to add the new value element- Returns:
- the added XML content value element
- See Also:
-
addValue
Adds a value element of the type indicated by the given xpath at the selected index to the XML content document.- Parameters:
cms
- the current users OpenCms contextxpath
- the path that indicates the element type in the content definitionindex
- the index where to add the new value element- Returns:
- the added XML content value element
- See Also:
-
getElementCount
Returns the count of XML content values for the selected schema type and locale in the XML content.- Returns:
- the count of XML content values for the selected schema type and locale in the XML content
-
getLocale
Returns the locale this sequence is based on.- Returns:
- the locale this sequence is based on
-
getMaxOccurs
Returns the maximum occurrences of this type in the XML content schema.- Returns:
- the maximum occurrences of this type in the XML content schema
- See Also:
-
getMinOccurs
Returns the minimum occurrences of this type in the XML content schema.- Returns:
- the minimum occurrences of this type in the XML content schema
- See Also:
-
getPath
Returns the (simplified) Xpath expression that identifies the root node of this content value sequence.- Returns:
- the (simplified) Xpath expression that identifies the root node of this content value sequence
-
getValue
Returns the XML content values from the index position of this sequence.- Parameters:
index
- the index position to get the value from- Returns:
- the XML content values from the index position of this sequence
-
getValues
Returns the list of XML content values for the selected schema type and locale in the XML content.- Returns:
- the list of XML content values for the selected schema type and locale in the XML content
- See Also:
-
isChoiceSequence
Returnstrue
if this sequence represents a choice sequence.- Returns:
true
if this sequence represents a choice sequence
-
removeValue
Removes the value element of the sequence type at the selected index from XML content document.- Parameters:
index
- the index where to remove the value element- See Also:
-