public class XMLSource extends Object
Constructor and Description |
---|
XMLSource(InputStream is) |
Modifier and Type | Method and Description |
---|---|
URI |
getBaseURI()
Returns the value of the xml:base attribute, if any.
|
URI |
getLink(String expression)
Find an attribute or text node representing
an absolute or relative link and convert it to URI
|
URI |
getLink(String expression,
Map<String,String> namespaces)
Find an attribute or text node representing
an absolute or relative link and convert it to URI
|
URI[] |
getLinks(String expression,
Map<String,String> namespaces)
Find attributes or text nodes representing
absolute or relative links and convert them to URIs
|
<T> T |
getNode(String expression,
Class<T> cls)
Find the matching XML node and convert it into an instance of the provided class.
|
<T> T |
getNode(String expression,
Map<String,String> namespaces,
Class<T> cls)
Find the matching XML node and convert it into an instance of the provided class.
|
<T> T[] |
getNodes(String expression,
Class<T> cls)
Find the list of matching XML nodes and convert them into
an array of instances of the provided class.
|
<T> T[] |
getNodes(String expression,
Map<String,String> namespaces,
Class<T> cls)
Find the list of matching XML nodes and convert them into
an array of instances of the provided class.
|
String |
getValue(String expression)
Find the attribute or simple/text node
|
String |
getValue(String expression,
Map<String,String> namespaces)
Find the attribute or simple/text node
|
<T> T |
getValue(String expression,
Map<String,String> namespaces,
Class<T> cls)
Find the attribute or simple/text node and convert the string value to the
instance of the provided class, example, Integer.class.
|
String[] |
getValues(String expression)
Find the attributes or simple/text nodes
|
String[] |
getValues(String expression,
Map<String,String> namespaces)
Find the attributes or simple/text nodes
|
void |
setBuffering()
Allows for multiple queries against the same stream by buffering to DOM
|
public XMLSource(InputStream is)
public void setBuffering()
public <T> T getNode(String expression, Class<T> cls)
expression
- XPath expressioncls
- class of the nodepublic <T> T getNode(String expression, Map<String,String> namespaces, Class<T> cls)
expression
- XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.cls
- class of the nodepublic <T> T[] getNodes(String expression, Class<T> cls)
expression
- XPath expressioncls
- class of the nodepublic <T> T[] getNodes(String expression, Map<String,String> namespaces, Class<T> cls)
expression
- XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.cls
- class of the nodepublic URI getLink(String expression)
expression
- the XPath expressionpublic URI getLink(String expression, Map<String,String> namespaces)
expression
- the XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.public URI[] getLinks(String expression, Map<String,String> namespaces)
expression
- the XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.public URI getBaseURI()
public String getValue(String expression)
expression
- the XPath expressionpublic String getValue(String expression, Map<String,String> namespaces)
expression
- the XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.public String[] getValues(String expression)
expression
- the XPath expressionpublic String[] getValues(String expression, Map<String,String> namespaces)
expression
- the XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.public <T> T getValue(String expression, Map<String,String> namespaces, Class<T> cls)
expression
- the XPath expressionnamespaces
- the namespaces map, prefixes which are used in the XPath expression
are the keys, namespace URIs are the values; note, the prefixes do not have to match
the actual ones used in the XML instance.cls
- the class of the responseApache CXF