org.restlet.ext.wadl
Class WadlRepresentation

java.lang.Object
  extended by org.restlet.resource.Variant
      extended by org.restlet.resource.Representation
          extended by org.restlet.resource.StreamRepresentation
              extended by org.restlet.resource.OutputRepresentation
                  extended by org.restlet.resource.XmlRepresentation
                      extended by org.restlet.resource.SaxRepresentation
                          extended by org.restlet.ext.wadl.WadlRepresentation
All Implemented Interfaces:
javax.xml.namespace.NamespaceContext

public class WadlRepresentation
extends SaxRepresentation

Root of a WADL description document.

Author:
Jerome Louvel

Field Summary
static java.lang.String APP_NAMESPACE
          Web Application Description Language namespace.
 
Fields inherited from class org.restlet.resource.Representation
UNKNOWN_SIZE
 
Constructor Summary
WadlRepresentation()
          Constructor.
WadlRepresentation(ApplicationInfo application)
          Constructor.
WadlRepresentation(Representation xmlRepresentation)
          Constructor.
WadlRepresentation(ResourceInfo resource)
          Constructor.
 
Method Summary
 java.lang.Object evaluate(java.lang.String expression, javax.xml.namespace.QName returnType)
           
 ApplicationInfo getApplication()
          Returns the root element of the WADL document.
 Representation getHtmlRepresentation()
          Returns an HTML representation.
 void setApplication(ApplicationInfo application)
          Sets the root element of the WADL document.
 void write(XmlWriter writer)
           
 
Methods inherited from class org.restlet.resource.SaxRepresentation
getSaxSource, parse, release, setSaxSource, write
 
Methods inherited from class org.restlet.resource.XmlRepresentation
getBoolean, getDocumentBuilder, getDomSource, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getSaxSource, getStreamSource, getText, isNamespaceAware, putNamespace, setNamespaceAware, validate, validate, validate, validate
 
Methods inherited from class org.restlet.resource.OutputRepresentation
getStream
 
Methods inherited from class org.restlet.resource.StreamRepresentation
getChannel, getReader, write, write
 
Methods inherited from class org.restlet.resource.Representation
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, getText, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient
 
Methods inherited from class org.restlet.resource.Variant
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_NAMESPACE

public static final java.lang.String APP_NAMESPACE
Web Application Description Language namespace.

See Also:
Constant Field Values
Constructor Detail

WadlRepresentation

public WadlRepresentation()
Constructor.


WadlRepresentation

public WadlRepresentation(ApplicationInfo application)
Constructor.

Parameters:
application - The root element of the WADL document.

WadlRepresentation

public WadlRepresentation(Representation xmlRepresentation)
                   throws java.io.IOException
Constructor.

Parameters:
xmlRepresentation - The XML WADL document.
Throws:
java.io.IOException

WadlRepresentation

public WadlRepresentation(ResourceInfo resource)
Constructor. The title of the resource, that is to say the title of its first documentation tag is transfered to the title of the first documentation tag of the main application tag.

Parameters:
resource - The root element of the WADL document.
Method Detail

evaluate

public java.lang.Object evaluate(java.lang.String expression,
                                 javax.xml.namespace.QName returnType)
                          throws java.lang.Exception
Overrides:
evaluate in class SaxRepresentation
Throws:
java.lang.Exception

getApplication

public ApplicationInfo getApplication()
Returns the root element of the WADL document.

Returns:
The root element of the WADL document.

getHtmlRepresentation

public Representation getHtmlRepresentation()
Returns an HTML representation. Note that the internal XSLT stylesheet used comes from Mark Nottingham. This stylesheet requires advanced XSLT features, including EXSLT extensions. Usage of a recent version of Xalan-J is suggested. It has been tested successfully with Xalan-J 2.7.1.

Returns:
An HTML representation.

setApplication

public void setApplication(ApplicationInfo application)
Sets the root element of the WADL document.

Parameters:
application - The root element of the WADL document.

write

public void write(XmlWriter writer)
           throws java.io.IOException
Overrides:
write in class SaxRepresentation
Throws:
java.io.IOException


Copyright © 2005-2008 Noelios Technologies.