Package hec.util

Class BaseXMLUtilities

Direct Known Subclasses:
XMLUtilities

public class BaseXMLUtilities extends RmaBaseXmlUtilities
  • Constructor Details

    • BaseXMLUtilities

      public BaseXMLUtilities()
  • Method Details

    • saveNamedType

      public static void saveNamedType(org.jdom.Element elem, NamedType nt)
      save the NamedType nt's information to the Element elem
      Parameters:
      elem - the Element to save the information to
      nt - the NamedType to save
    • loadNamedType

      public static void loadNamedType(org.jdom.Element elem, NamedType nt)
      load the NamedType nt's information from the Element elem
      Parameters:
      elem - the Element to load the information from
      nt - the NamedType to load
    • saveDescription

      public static void saveDescription(org.jdom.Element parent, NamedType nt)
      save the NamedType's description. This saves the description as an Element with each line of description stored as a child Element. XML doesn't preserve the newlines when just an attribute is used.
      Parameters:
      parent - the parent to add the description Element to.
    • setDescription

      public static void setDescription(org.jdom.Element descElem, NamedType nt)
      set the NamedType's description from the Element descElem.
      Parameters:
      descElem - the Element that holds the NamedType's description as created by saveDescription(Element)
    • saveWorldPt

      public static void saveWorldPt(org.jdom.Element parent, WorldPt wpt)
      save the hec.map.WorldPt wpt to the Element parent as a child node
      Parameters:
      parent - the parent to add the WorldPt element to
      wpt - the WorldPt to save
    • loadWorldPt

      public static WorldPt loadWorldPt(org.jdom.Element elem)
      load and return a hec.map.WorldPt created from the Element elem
      Parameters:
      elem - the WorldPt Element
      Returns:
      the WorldPt or null if the elem isn't a WorldPt node or Element is null
    • saveLocalRect

      public static void saveLocalRect(org.jdom.Element parent, LocalRect rect)
      save the hec.map.LocalRect to the Element parent as a child node
      Parameters:
      parent - the parent to add the LocalRect element to
      rect - the LocalRect to save
    • loadLocalRect

      public static LocalRect loadLocalRect(org.jdom.Element elem)
    • saveWorldRect

      public static void saveWorldRect(org.jdom.Element parent, WorldRect rect)
      save the hec.map.LocalRect to the Element parent as a child node
      Parameters:
      parent - the parent to add the LocalRect element to
      rect - the LocalRect to save
    • loadWorldRect

      public static WorldRect loadWorldRect(org.jdom.Element elem)
    • saveWorldRegion

      public static void saveWorldRegion(org.jdom.Element parent, WorldRegion region)
    • loadWorldRegion

      public static WorldRegion loadWorldRegion(org.jdom.Element element, WorldRegion region)
    • saveWorldLine

      public static void saveWorldLine(org.jdom.Element parent, WorldLine line)
    • loadWorldLine

      public static WorldLine loadWorldLine(org.jdom.Element element, WorldLine line)
    • getChildElement

      public static org.jdom.Element getChildElement(org.jdom.Element parent, String childNamesPath)
      find the child element specified by the childNamesPath. This can be multiple levels deep. Use the slash (/) character as the path separator
      Parameters:
      childNamesPath - the child element path... i.e. a/b/c will find the child element 'c' in the child element 'c' of the child element 'a' of the node passed in
    • addChildContent

      public static org.jdom.Element addChildContent(org.jdom.Element parent, String childElemName, boolean value)
      add a child Element to parent with the name of childElemName and text of value
      Parameters:
      parent - element to add child to
      childElemName - name of child element
      value - text of child element
    • addChildContent

      public static org.jdom.Element addChildContent(org.jdom.Element parent, String childElemName, double value)
      add a child Element to parent with the name of childElemName and text of value
      Parameters:
      parent - element to add child to
      childElemName - name of child element
      value - text of child element
    • addChildContent

      public static org.jdom.Element addChildContent(org.jdom.Element parent, String childElemName, int value)
      add a child Element to parent with the name of childElemName and text of value
      Parameters:
      parent - element to add child to
      childElemName - name of child element
      value - text of child element
    • addChildContent

      public static org.jdom.Element addChildContent(org.jdom.Element parent, String childElemName, long value)
      add a child Element to parent with the name of childElemName and text of value
      Parameters:
      parent - element to add child to
      childElemName - name of child element
      value - text of child element
    • addChildContent

      public static org.jdom.Element addChildContent(org.jdom.Element parent, String childElemName, String value)
      add a child Element to parent with the name of childElemName and text of value
      Parameters:
      parent - element to add child to
      childElemName - name of child element
      value - text of child element