public class ResourceInfo extends DocumentedInfo
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
ApplicationInfo |
createApplication()
Creates an application descriptor that wraps this resource descriptor.
|
static void |
describe(ApplicationInfo applicationInfo,
ResourceInfo info,
Object resource,
String path)
Returns a WADL 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.
|
MediaType |
getQueryType()
Returns the media type for the query component of the resource URI.
|
List<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(MediaType queryType)
Sets the media type for the query component of the resource URI.
|
void |
setType(List<Reference> type)
Sets the list of references to resource type elements.
|
void |
updateNamespaces(Map<String,String> namespaces)
Completes the given map of namespaces with the namespaces used in the
documentation elements.
|
void |
writeElement(XmlWriter writer)
Writes the current object as an XML element using the given SAX writer.
|
getDocumentations, resolveNamespaces, setDocumentation, setDocumentation, setDocumentations
public ResourceInfo()
public ResourceInfo(DocumentationInfo documentation)
documentation
- A single documentation element.public ResourceInfo(List<DocumentationInfo> documentations)
documentations
- The list of documentation elements.public ResourceInfo(String documentation)
documentation
- A single documentation element.public static void describe(ApplicationInfo applicationInfo, ResourceInfo info, Object resource, String path)
applicationInfo
- The parent application.resource
- The resource to describe.path
- Path of the current resource.info
- WADL description of the current resource to update.public ApplicationInfo createApplication()
public List<ResourceInfo> getChildResources()
public String getIdentifier()
public List<MethodInfo> getMethods()
public List<ParameterInfo> getParameters()
public String getPath()
public MediaType getQueryType()
public List<Reference> getType()
public void setChildResources(List<ResourceInfo> resources)
resources
- The list of child resources.public void setIdentifier(String identifier)
identifier
- The identifier for that element.public void setMethods(List<MethodInfo> methods)
methods
- The list of supported methods.public void setParameters(List<ParameterInfo> parameters)
parameters
- The list of parameters.public void setPath(String path)
path
- The URI template for the identifier of the resource.public void setQueryType(MediaType queryType)
queryType
- The media type for the query component of the resource URI.public void setType(List<Reference> type)
type
- The list of references to resource type elements.public void updateNamespaces(Map<String,String> namespaces)
DocumentedInfo
updateNamespaces
in class DocumentedInfo
namespaces
- The given map of namespaces to complete.public void writeElement(XmlWriter writer) throws SAXException
writer
- The SAX writer.SAXException
Copyright © 2005–2016. All rights reserved.