Package hec.util
Class BaseXMLUtilities
java.lang.Object
rma.util.RmaBaseXmlUtilities
hec.util.BaseXMLUtilities
- Direct Known Subclasses:
XMLUtilities
-
Field Summary
Fields inherited from class rma.util.RmaBaseXmlUtilities
DATA_ATTRIBUTE, DOUBLE_ARRAY_NODE_NAME, FLOAT_ARRAY_NODE_NAME, INDEX_ATTRIBUTE, INT_ARRAY_NODE_NAME, LENGTH_ATTRIBUTE, LOCAL_RECT_NODE, NAME_ATTRIBUTE, NUM_POINTS_ATTR, RANGE_ATTRIBUTE, STEP_ATTRIBUTE, STRING_ARRAY_NODE_NAME, TWO_D_DOUBLE_ARRAY_NODE_NAME, WORLD_LINE_NODE, WORLD_PT_NODE, WORLD_RECT_NODE, WORLD_REGION_CLOCKWISE, WORLD_REGION_NODE, WORLD_REGION_SELF_INTERSECTING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jdom.ElementaddChildContent(org.jdom.Element parent, String childElemName, boolean value) add a child Element to parent with the name of childElemName and text of valuestatic org.jdom.ElementaddChildContent(org.jdom.Element parent, String childElemName, double value) add a child Element to parent with the name of childElemName and text of valuestatic org.jdom.ElementaddChildContent(org.jdom.Element parent, String childElemName, int value) add a child Element to parent with the name of childElemName and text of valuestatic org.jdom.ElementaddChildContent(org.jdom.Element parent, String childElemName, long value) add a child Element to parent with the name of childElemName and text of valuestatic org.jdom.ElementaddChildContent(org.jdom.Element parent, String childElemName, String value) add a child Element to parent with the name of childElemName and text of valuestatic org.jdom.ElementgetChildElement(org.jdom.Element parent, String childNamesPath) find the child element specified by the childNamesPath.static LocalRectloadLocalRect(org.jdom.Element elem) static voidloadNamedType(org.jdom.Element elem, NamedType nt) load the NamedType nt's information from the Element elemstatic WorldLineloadWorldLine(org.jdom.Element element, WorldLine line) static WorldPtloadWorldPt(org.jdom.Element elem) load and return ahec.map.WorldPtcreated from the Element elemstatic WorldRectloadWorldRect(org.jdom.Element elem) static WorldRegionloadWorldRegion(org.jdom.Element element, WorldRegion region) static voidsaveDescription(org.jdom.Element parent, NamedType nt) save the NamedType's description.static voidsaveLocalRect(org.jdom.Element parent, LocalRect rect) save thehec.map.LocalRectto the Element parent as a child nodestatic voidsaveNamedType(org.jdom.Element elem, NamedType nt) save the NamedType nt's information to the Element elemstatic voidsaveWorldLine(org.jdom.Element parent, WorldLine line) static voidsaveWorldPt(org.jdom.Element parent, WorldPt wpt) save thehec.map.WorldPtwpt to the Element parent as a child nodestatic voidsaveWorldRect(org.jdom.Element parent, WorldRect rect) save thehec.map.LocalRectto the Element parent as a child nodestatic voidsaveWorldRegion(org.jdom.Element parent, WorldRegion region) static voidsetDescription(org.jdom.Element descElem, NamedType nt) set the NamedType's description from theElementdescElem.Methods inherited from class rma.util.RmaBaseXmlUtilities
addAttributes, addXMLSchemaNamespaceDeclaration, addXSDLocation, addXSLTLocation, attributeListToMap, buildElement, buildElement, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, createArrayElements, displayArrays, getAttributeValueAsBoolean, getAttributeValueAsDouble, getAttributeValueAsFloat, getAttributeValueAsInt, getAttributeValueAsLong, getAttributeValueAsShort, getChildElementAsBoolean, getChildElementAsColor, getChildElementAsDouble, getChildElementAsInt, getChildElementAsLong, getChildElementAsString, getChildElementAsString, getChildElementAttribute, getContentAsBoolean, getContentAsDouble, getContentAsInt, getContentAsLong, getContentAsString, getContentAsString, getDescription, getDoubleArrayElements, getFloatArrayElements, getIntArrayElements, getOrCreateChild, getStepSize, getStringArrayElements, loadColor, loadDocument, saveChildElement, saveChildElement, saveChildElement, saveChildElement, saveColor, saveDescription, saveWindowSizeAndLocation, setAttributeValueAsDouble, setAttributeValueAsLong, setChildElementAsColor, setChildElementAsDouble, setChildElementAsInt, setChildElementAttribute, setWindowSizeAndLocation, toXmlString, toXmlString
-
Constructor Details
-
BaseXMLUtilities
public BaseXMLUtilities()
-
-
Method Details
-
saveNamedType
save the NamedType nt's information to the Element elem- Parameters:
elem- the Element to save the information tont- the NamedType to save
-
loadNamedType
load the NamedType nt's information from the Element elem- Parameters:
elem- the Element to load the information fromnt- the NamedType to load
-
saveDescription
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
set the NamedType's description from theElementdescElem.- Parameters:
descElem- theElementthat holds the NamedType's description as created bysaveDescription(Element)
-
saveWorldPt
save thehec.map.WorldPtwpt to the Element parent as a child node- Parameters:
parent- the parent to add the WorldPt element towpt- the WorldPt to save
-
loadWorldPt
load and return ahec.map.WorldPtcreated 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
save thehec.map.LocalRectto the Element parent as a child node- Parameters:
parent- the parent to add the LocalRect element torect- the LocalRect to save
-
loadLocalRect
-
saveWorldRect
save thehec.map.LocalRectto the Element parent as a child node- Parameters:
parent- the parent to add the LocalRect element torect- the LocalRect to save
-
loadWorldRect
-
saveWorldRegion
-
loadWorldRegion
-
saveWorldLine
-
loadWorldLine
-
getChildElement
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 tochildElemName- name of child elementvalue- 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 tochildElemName- name of child elementvalue- 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 tochildElemName- name of child elementvalue- 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 tochildElemName- name of child elementvalue- 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 tochildElemName- name of child elementvalue- text of child element
-