Package org.apache.tika.util
Class XMLDOMUtil
java.lang.Object
org.apache.tika.util.XMLDOMUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Get an int value.static long
Get a long value.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.
-
Constructor Details
-
XMLDOMUtil
public XMLDOMUtil()
-
-
Method Details
-
mapifyAttrs
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
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
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
-