Class XMLWrapper

java.lang.Object
com.peterphi.carbon.type.XMLWrapper
Direct Known Subclasses:
CarbonFTPSettings, CarbonFTPUpload, CarbonJobInfo, CarbonModule, CarbonModuleData, CarbonProject, CarbonReply, MediaInfo, MediaInfoTrack

public class XMLWrapper extends Object
Generic wrapper around some Carbon XML element
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.jdom2.Element
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    XMLWrapper(org.jdom2.Element element)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Helper method to retrieve the value of an attribute on this Element
    org.jdom2.Element
    Return the XML Element this object is wrapping
    protected org.jdom2.Element
    getElement(String name, int index)
    Helper method to retrieve a child element with a particular name and index
    void
    setAttribute(String name, String value)
    Helper method to set the value of an attribute on this Element

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • element

      public org.jdom2.Element element
  • Constructor Details

    • XMLWrapper

      public XMLWrapper(org.jdom2.Element element)
  • Method Details

    • getElement

      public org.jdom2.Element getElement()
      Return the XML Element this object is wrapping
      Returns:
    • setAttribute

      public void setAttribute(String name, String value)
      Helper method to set the value of an attribute on this Element
      Parameters:
      name - the attribute name
      value - the value to set - if null the attribute is removed
    • getAttribute

      public String getAttribute(String name)
      Helper method to retrieve the value of an attribute on this Element
      Parameters:
      name -
      Returns:
    • getElement

      protected org.jdom2.Element getElement(String name, int index)
      Helper method to retrieve a child element with a particular name and index
      Parameters:
      name - the name of the element
      index - the index (where 0 is the first element with that name)
      Returns:
      an Element (or null if none could be found by that name or with that index)