Class XmlElementContextBase
- java.lang.Object
-
- com.aquima.interactions.communication.impl.evaluator.composer.XmlElementContextBase
-
- All Implemented Interfaces:
IXmlElementContext
- Direct Known Subclasses:
DefaultXmlElementContext
,DocumentContext
public abstract class XmlElementContextBase extends Object implements IXmlElementContext
Base class forIXmlElementContext
implementations- Since:
- 9.5
- Author:
- Radu Batori
-
-
Field Summary
Fields Modifier and Type Field Description protected NamespaceMap
namespaces
protected IXmlElement
xmlElement
-
Constructor Summary
Constructors Constructor Description XmlElementContextBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addElementToMap(QualifiedName elementName, IXmlElementContext elementContext)
Add anIXmlElementContext
to the children mapIXmlElement
asXmlElement()
Gets the underlyingIXmlElement
String
getDocumentString()
Gets the XML document as stringIXmlElementContext
getElement(QualifiedName elementName)
Get a child element by nameCollection<IXmlElementContext>
getElements()
Get all the child elements of the nodevoid
removeElement(IXmlElementContext element)
Remove a child elementvoid
setNamespace(String prefix, String namespace)
Set a namespace for the element-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.aquima.interactions.communication.IXmlElementContext
addElement, setAttribute, setInstanceType, setNil, setValue
-
-
-
-
Field Detail
-
xmlElement
protected IXmlElement xmlElement
-
namespaces
protected NamespaceMap namespaces
-
-
Method Detail
-
addElementToMap
protected void addElementToMap(QualifiedName elementName, IXmlElementContext elementContext)
Add anIXmlElementContext
to the children map- Parameters:
elementName
- The name of the elementelementContext
- The element to be added
-
getElement
public IXmlElementContext getElement(QualifiedName elementName)
Get a child element by name- Specified by:
getElement
in interfaceIXmlElementContext
- Parameters:
elementName
- The qualified name of the element- Returns:
- The element as
IXmlElementContext
or null if not found
-
getElements
public Collection<IXmlElementContext> getElements()
Get all the child elements of the node- Specified by:
getElements
in interfaceIXmlElementContext
- Returns:
- A
Collection
of the child elements
-
removeElement
public void removeElement(IXmlElementContext element)
Remove a child element- Specified by:
removeElement
in interfaceIXmlElementContext
- Parameters:
element
- The element to be removed
-
asXmlElement
public IXmlElement asXmlElement()
Gets the underlyingIXmlElement
- Specified by:
asXmlElement
in interfaceIXmlElementContext
- Returns:
- The element as
IXmlElement
-
getDocumentString
public String getDocumentString()
Gets the XML document as string- Specified by:
getDocumentString
in interfaceIXmlElementContext
- Returns:
- The document string
-
setNamespace
public void setNamespace(String prefix, String namespace)
Set a namespace for the element- Specified by:
setNamespace
in interfaceIXmlElementContext
- Parameters:
prefix
- The namespace prefixnamespace
- The namespace
-
-