Interface IXmlElementContext

All Known Implementing Classes:
DefaultXmlElementContext, DocumentContext, XmlElementContextBase

public interface IXmlElementContext
This interface exposes method to create xml elements or values.
Since:
9.0
Author:
Arjan Pragt
  • Method Details

    • setAttribute

      void setAttribute(QualifiedName attributeName, String value)
      Set an attribute on the current element
      Parameters:
      attributeName - The attribute name
      value - The value of the attribute
    • addElement

      IXmlElementContext addElement(QualifiedName elementName)
      Add a child element by name
      Parameters:
      elementName - The name of the element
      Returns:
      The added element
    • getElement

      IXmlElementContext getElement(QualifiedName elementName)
      Get a child element by name
      Parameters:
      elementName - The qualified name of the element
      Returns:
      The element as IXmlElementContext or null if not found
    • getElements

      Get all the child elements of the node
      Returns:
      A Collection of the child elements
    • removeElement

      void removeElement(IXmlElementContext element)
      Remove a child element
      Parameters:
      element - The element to be removed
    • setInstanceType

      void setInstanceType(QualifiedName complexType)
      Sets the instance type as an XML attribute
      Parameters:
      complexType - The element type
    • setValue

      void setValue(String value, boolean cdata)
      Sets the element's value
      Parameters:
      value - The value to be set
      cdata - True if a CDATA section should be created
    • setNil

      void setNil()
      Sets the value of the element as nil
    • asXmlElement

      IXmlElement asXmlElement()
      Gets the underlying IXmlElement
      Returns:
      The element as IXmlElement
    • getDocumentString

      String getDocumentString()
      Gets the XML document as string
      Returns:
      The document string
    • setNamespace

      void setNamespace(String prefix, String namespace)
      Set a namespace for the element
      Parameters:
      prefix - The namespace prefix
      namespace - The namespace