Class XmlHelper
java.lang.Object
org.apache.struts2.config.providers.XmlHelper
XML utilities.
- Author:
- Mike
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getContent
(Element element) This method will return the content of this particularelement
.static Integer
getLoadOrder
(Document doc) This method will find all the parameters under thisparamsElement
and return them as Map<String, String>.
-
Constructor Details
-
XmlHelper
public XmlHelper()
-
-
Method Details
-
getParams
This method will find all the parameters under this
paramsElement
and return them as Map<String, String>. For example,<result ... > <param name="param1">value1</param> <param name="param2">value2</param> <param name="param3">value3</param> </result>
will returns a Map<String, String> with the following key, value pairs:
- param1 - value1
- param2 - value2
- param3 - value3
- Parameters:
paramsElement
- params element- Returns:
- a map of key,value pairs
-
getContent
This method will return the content of this particular
element
. For example,<result>something_1</result>
When the
Element
<result>
is passed in as argument (element
to this method, it returns the content of it, namely,something_1
in the example above.- Parameters:
element
- the DOM element- Returns:
- content as string
-
getLoadOrder
- Parameters:
doc
- document- Returns:
- the value of the "order" attribute from the root element
-