|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.jaxrs.ext.xml.XMLSource
public class XMLSource
Utility class for manipulating XML response using XPath and XSLT
Constructor Summary | |
---|---|
XMLSource(InputStream is)
|
Method Summary | ||
---|---|---|
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 |
|
|
getNode(String expression,
Class<T> cls)
Find the matching XML node and convert it into an instance of the provided class. |
|
|
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. |
|
|
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. |
|
|
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 |
|
|
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(boolean enable)
Allows for multiple queries against the same stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLSource(InputStream is)
Method Detail |
---|
public void setBuffering(boolean enable)
enable
- if set to true then multiple queries will be supported.public <T> T getNode(String expression, Class<T> cls)
expression
- XPath expressioncls
- class of the node
public <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 node
public <T> T[] getNodes(String expression, Class<T> cls)
expression
- XPath expressioncls
- class of the node
public <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 node
public URI getLink(String expression)
expression
- the XPath expression
public 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 expression
public 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 expression
public 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 response
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |