de.twenty11.skysail.server.restlet
Class ResourceInfo

java.lang.Object
  extended by de.twenty11.skysail.server.restlet.DocumentedInfo
      extended by de.twenty11.skysail.server.restlet.ResourceInfo

public class ResourceInfo
extends DocumentedInfo


Constructor Summary
ResourceInfo()
          Constructor.
ResourceInfo(DocumentationInfo documentation)
          Constructor with a single documentation element.
ResourceInfo(List<DocumentationInfo> documentations)
          Constructor with a list of documentation elements.
ResourceInfo(String documentation)
          Constructor with a single documentation element.
 
Method Summary
 ApplicationInfo createApplication()
          Creates an application descriptor that wraps this resource descriptor.
static void describe(ApplicationInfo applicationInfo, ResourceInfo info, Object resource, String path)
          Returns a JSON description of the current resource.
 List<ResourceInfo> getChildResources()
          Returns the list of child resources.
 String getIdentifier()
          Returns the identifier for that element.
 List<MethodInfo> getMethods()
          Returns the list of supported methods.
 List<ParameterInfo> getParameters()
          Returns the list of parameters.
 String getPath()
          Returns the URI template for the identifier of the resource.
 org.restlet.data.MediaType getQueryType()
          Returns the media type for the query component of the resource URI.
 List<org.restlet.data.Reference> getType()
          Returns the list of references to resource type elements.
 void setChildResources(List<ResourceInfo> resources)
          Sets the list of child resources.
 void setIdentifier(String identifier)
          Sets the identifier for that element.
 void setMethods(List<MethodInfo> methods)
          Sets the list of supported methods.
 void setParameters(List<ParameterInfo> parameters)
          Sets the list of parameters.
 void setPath(String path)
          Sets the URI template for the identifier of the resource.
 void setQueryType(org.restlet.data.MediaType queryType)
          Sets the media type for the query component of the resource URI.
 void setType(List<org.restlet.data.Reference> type)
          Sets the list of references to resource type elements.
 String toString()
           
 void updateNamespaces(Map<String,String> namespaces)
          Completes the given map of namespaces with the namespaces used in the documentation elements.
 
Methods inherited from class de.twenty11.skysail.server.restlet.DocumentedInfo
getDocumentations, resolveNamespaces, setDocumentation, setDocumentation, setDocumentations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceInfo

public ResourceInfo()
Constructor.


ResourceInfo

public ResourceInfo(DocumentationInfo documentation)
Constructor with a single documentation element.

Parameters:
documentation - A single documentation element.

ResourceInfo

public ResourceInfo(List<DocumentationInfo> documentations)
Constructor with a list of documentation elements.

Parameters:
documentations - The list of documentation elements.

ResourceInfo

public ResourceInfo(String documentation)
Constructor with a single documentation element.

Parameters:
documentation - A single documentation element.
Method Detail

toString

public String toString()
Overrides:
toString in class Object

describe

public static void describe(ApplicationInfo applicationInfo,
                            ResourceInfo info,
                            Object resource,
                            String path)
Returns a JSON description of the current resource.


createApplication

public ApplicationInfo createApplication()
Creates an application descriptor that wraps this resource descriptor. 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.

Returns:
The new application descriptor.

getChildResources

public List<ResourceInfo> getChildResources()
Returns the list of child resources.

Returns:
The list of child resources.

getIdentifier

public String getIdentifier()
Returns the identifier for that element.

Returns:
The identifier for that element.

getMethods

public List<MethodInfo> getMethods()
Returns the list of supported methods.

Returns:
The list of supported methods.

getParameters

public List<ParameterInfo> getParameters()
Returns the list of parameters.

Returns:
The list of parameters.

getPath

public String getPath()
Returns the URI template for the identifier of the resource.

Returns:
The URI template for the identifier of the resource.

getQueryType

public org.restlet.data.MediaType getQueryType()
Returns the media type for the query component of the resource URI.

Returns:
The media type for the query component of the resource URI.

getType

public List<org.restlet.data.Reference> getType()
Returns the list of references to resource type elements.

Returns:
The list of references to resource type elements.

setChildResources

public void setChildResources(List<ResourceInfo> resources)
Sets the list of child resources.

Parameters:
resources - The list of child resources.

setIdentifier

public void setIdentifier(String identifier)
Sets the identifier for that element.

Parameters:
identifier - The identifier for that element.

setMethods

public void setMethods(List<MethodInfo> methods)
Sets the list of supported methods.

Parameters:
methods - The list of supported methods.

setParameters

public void setParameters(List<ParameterInfo> parameters)
Sets the list of parameters.

Parameters:
parameters - The list of parameters.

setPath

public void setPath(String path)
Sets the URI template for the identifier of the resource.

Parameters:
path - The URI template for the identifier of the resource.

setQueryType

public void setQueryType(org.restlet.data.MediaType queryType)
Sets the media type for the query component of the resource URI.

Parameters:
queryType - The media type for the query component of the resource URI.

setType

public void setType(List<org.restlet.data.Reference> type)
Sets the list of references to resource type elements.

Parameters:
type - The list of references to resource type elements.

updateNamespaces

public void updateNamespaces(Map<String,String> namespaces)
Description copied from class: DocumentedInfo
Completes the given map of namespaces with the namespaces used in the documentation elements. The key is the URI of the namespace and the value, the prefix.

Specified by:
updateNamespaces in class DocumentedInfo
Parameters:
namespaces - The given map of namespaces to complete.


Copyright © 2011-2013. All Rights Reserved.