com.google.api.ads.adwords.lib.utils
Class XmlFieldExtractor
java.lang.Object
com.google.api.ads.adwords.lib.utils.XmlFieldExtractor
public class XmlFieldExtractor
- extends Object
Utility class to extract fields from XML.
- Author:
- Kevin Winter
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlFieldExtractor
public XmlFieldExtractor()
- Constructor.
extract
public 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.
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".
- Parameters:
xml - Stream of XML to processfields - List of fields to look for.
Copyright © 2012. All Rights Reserved.