Package org.apache.tika.util
Class XMLDOMUtil
- java.lang.Object
-
- org.apache.tika.util.XMLDOMUtil
-
public class XMLDOMUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description XMLDOMUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetInt(String attrName, Map<String,String> runtimeAttributes, Node docElement)Get an int value.static longgetLong(String attrName, Map<String,String> runtimeAttributes, Node docElement)Get a long value.static Map<String,String>mapifyAttrs(Node node, Map<String,String> overwrite)This grabs the attributes from a dom node and overwrites those values with those specified by the overwrite map.
-
-
-
Method Detail
-
mapifyAttrs
public static Map<String,String> mapifyAttrs(Node node, Map<String,String> overwrite)
This grabs the attributes from a dom node and overwrites those values with those specified by the overwrite map.- Parameters:
node- node for buildingoverwrite- map of attributes to overwrite- Returns:
- map of attributes
-
getInt
public static int getInt(String attrName, Map<String,String> runtimeAttributes, Node docElement)
Get an int value. Try the runtime attributes first and then back off to the document element. Throw a RuntimeException if the attribute is not found or if the value is not parseable as an int.- Parameters:
attrName- attribute name to findruntimeAttributes- runtime attributesdocElement- correct element that should have specified attribute- Returns:
- specified int value
-
getLong
public static long getLong(String attrName, Map<String,String> runtimeAttributes, Node docElement)
Get a long value. Try the runtime attributes first and then back off to the document element. Throw a RuntimeException if the attribute is not found or if the value is not parseable as a long.- Parameters:
attrName- attribute name to findruntimeAttributes- runtime attributesdocElement- correct element that should have specified attribute- Returns:
- specified long value
-
-