public class XmlFieldExtractor extends Object
| Constructor and Description |
|---|
XmlFieldExtractor()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
extract(InputStream xml,
String[] fields)
Locates the target fields in the specified XML and uses a wildcard XPath to
identify the first matching node and return it in a map.
|
public Map<String,String> extract(InputStream xml, String[] fields)
For example, for the xml: <xml><bar>BAR</bar></xml></code> and
field "bar", this class return a map with key "bar" and value "BAR".
xml - Stream of XML to process.fields - List of fields to look for.Copyright © 2016. All Rights Reserved.