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.Element
addChildContent
(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.Element
addChildContent
(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.Element
addChildContent
(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.Element
addChildContent
(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.Element
addChildContent
(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.Element
getChildElement
(org.jdom.Element parent, String childNamesPath) find the child element specified by the childNamesPath.static LocalRect
loadLocalRect
(org.jdom.Element elem) static void
loadNamedType
(org.jdom.Element elem, NamedType nt) load the NamedType nt's information from the Element elemstatic WorldLine
loadWorldLine
(org.jdom.Element element, WorldLine line) static WorldPt
loadWorldPt
(org.jdom.Element elem) load and return ahec.map.WorldPt
created from the Element elemstatic WorldRect
loadWorldRect
(org.jdom.Element elem) static WorldRegion
loadWorldRegion
(org.jdom.Element element, WorldRegion region) static void
saveDescription
(org.jdom.Element parent, NamedType nt) save the NamedType's description.static void
saveLocalRect
(org.jdom.Element parent, LocalRect rect) save thehec.map.LocalRect
to the Element parent as a child nodestatic void
saveNamedType
(org.jdom.Element elem, NamedType nt) save the NamedType nt's information to the Element elemstatic void
saveWorldLine
(org.jdom.Element parent, WorldLine line) static void
saveWorldPt
(org.jdom.Element parent, WorldPt wpt) save thehec.map.WorldPt
wpt to the Element parent as a child nodestatic void
saveWorldRect
(org.jdom.Element parent, WorldRect rect) save thehec.map.LocalRect
to the Element parent as a child nodestatic void
saveWorldRegion
(org.jdom.Element parent, WorldRegion region) static void
setDescription
(org.jdom.Element descElem, NamedType nt) set the NamedType's description from theElement
descElem.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 theElement
descElem.- Parameters:
descElem
- theElement
that holds the NamedType's description as created bysaveDescription(Element)
-
saveWorldPt
save thehec.map.WorldPt
wpt 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.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
save thehec.map.LocalRect
to 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.LocalRect
to 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
-