|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.OutputRepresentation
org.restlet.resource.XmlRepresentation
public abstract class XmlRepresentation
Representation based on an XML document. It knows how to evaluate XPath expressions and how to manage a namespace context.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Variant |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
XmlRepresentation(MediaType mediaType)
Constructor. |
|
XmlRepresentation(MediaType mediaType,
long expectedSize)
Constructor. |
Method Summary | |
---|---|
abstract Object |
evaluate(String expression,
QName returnType)
Evaluates an XPath expression and returns the result as in the given return type. |
Boolean |
getBoolean(String expression)
Evaluates an XPath expression as a boolean. |
String |
getNamespaceURI(String prefix)
|
Node |
getNode(String expression)
Evaluates an XPath expression as a DOM Node. |
NodeSet |
getNodes(String expression)
Evaluates an XPath expression as a DOM NodeList. |
Double |
getNumber(String expression)
Evaluates an XPath expression as a number. |
String |
getPrefix(String namespaceURI)
|
Iterator |
getPrefixes(String namespaceURI)
|
String |
getText(String expression)
Evaluates an XPath expression as a string. |
boolean |
isNamespaceAware()
Indicates if processing is namespace aware. |
void |
putNamespace(String prefix,
String namespaceURI)
Puts a new mapping between a prefix and a namespace URI. |
void |
setNamespaceAware(boolean namespaceAware)
Indicates if processing is namespace aware. |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream, write |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, write |
Methods inherited from class org.restlet.resource.Representation |
---|
getText, isAvailable, isTransient, setAvailable, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlRepresentation(MediaType mediaType)
mediaType
- The representation's mediaType.public XmlRepresentation(MediaType mediaType, long expectedSize)
mediaType
- The representation's mediaType.expectedSize
- The expected input stream size.Method Detail |
---|
public abstract Object evaluate(String expression, QName returnType) throws Exception
returnType
- The qualified name of the return type.
Exception
XPathException
,
XPathConstants
public Boolean getBoolean(String expression)
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
public Node getNode(String expression)
public NodeSet getNodes(String expression)
public Double getNumber(String expression)
public String getPrefix(String namespaceURI)
getPrefix
in interface NamespaceContext
public Iterator getPrefixes(String namespaceURI)
getPrefixes
in interface NamespaceContext
public String getText(String expression)
public boolean isNamespaceAware()
public void putNamespace(String prefix, String namespaceURI)
prefix
- The namespace prefix.namespaceURI
- The namespace URI.public void setNamespaceAware(boolean namespaceAware)
namespaceAware
- Indicates if processing is namespace aware.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |