|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.ext.wadl.DocumentedInfo
org.restlet.ext.wadl.MethodInfo
public class MethodInfo
Describes the expected requests and responses of a resource method.
Constructor Summary | |
---|---|
MethodInfo()
Constructor. |
|
MethodInfo(DocumentationInfo documentation)
Constructor with a single documentation element. |
|
MethodInfo(List<DocumentationInfo> documentations)
Constructor with a list of documentation elements. |
|
MethodInfo(String documentation)
Constructor with a single documentation element. |
Method Summary | |
---|---|
RepresentationInfo |
addFault(Status status,
MediaType mediaType,
String documentation)
Deprecated. Use the ResponseInfo.getRepresentations() method
instead. |
ParameterInfo |
addRequestParameter(String name,
boolean required,
String type,
ParameterStyle style,
String documentation)
Deprecated. Use RequestInfo.getParameters() instead. |
RepresentationInfo |
addRequestRepresentation(Variant variant)
Deprecated. Use RequestInfo.getRepresentations() instead. |
ParameterInfo |
addResponseParameter(String name,
boolean required,
String type,
ParameterStyle style,
String documentation)
Deprecated. Use the ResponseInfo.getParameters() method instead. |
RepresentationInfo |
addResponseRepresentation(Variant variant)
Deprecated. Use ResponseInfo.getRepresentations() instead. |
static void |
describeAnnotations(MethodInfo info,
ServerResource resource)
Automatically describe a method by discovering the resource's annotations. |
String |
getIdentifier()
Returns the identifier for the method. |
Method |
getName()
Returns the name of the method. |
RequestInfo |
getRequest()
Returns the input to the method. |
ResponseInfo |
getResponse()
Returns the last added response of the method. |
List<ResponseInfo> |
getResponses()
Returns the output of the method. |
Reference |
getTargetRef()
Returns the reference to a method definition element. |
void |
setIdentifier(String identifier)
Sets the identifier for the method. |
void |
setName(Method name)
Sets the name of the method. |
void |
setRequest(RequestInfo request)
Sets the input to the method. |
void |
setResponsee(ResponseInfo response)
Deprecated. Use the getResponses() or
setResponses(List) methods instead. |
void |
setResponses(List<ResponseInfo> responses)
Sets the output of the method. |
void |
setTargetRef(Reference targetRef)
Sets the reference to a method definition element. |
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. |
Methods inherited from class org.restlet.ext.wadl.DocumentedInfo |
---|
getDocumentations, resolveNamespaces, setDocumentation, setDocumentation, setDocumentations |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodInfo()
public MethodInfo(DocumentationInfo documentation)
documentation
- A single documentation element.public MethodInfo(List<DocumentationInfo> documentations)
documentations
- The list of documentation elements.public MethodInfo(String documentation)
documentation
- A single documentation element.Method Detail |
---|
public static void describeAnnotations(MethodInfo info, ServerResource resource)
info
- The method description to update.resource
- The server resource to describe.@Deprecated public RepresentationInfo addFault(Status status, MediaType mediaType, String documentation)
ResponseInfo.getRepresentations()
method
instead.
status
- The associated status code.mediaType
- The fault representation's media type.documentation
- A single documentation element.
@Deprecated public ParameterInfo addRequestParameter(String name, boolean required, String type, ParameterStyle style, String documentation)
RequestInfo.getParameters()
instead.
name
- The name of the parameter.required
- True if thes parameter is required.type
- The type of the parameter.style
- The style of the parameter.documentation
- A single documentation element.
@Deprecated public RepresentationInfo addRequestRepresentation(Variant variant)
RequestInfo.getRepresentations()
instead.
variant
- The variant to describe.
@Deprecated public ParameterInfo addResponseParameter(String name, boolean required, String type, ParameterStyle style, String documentation)
ResponseInfo.getParameters()
method instead.
name
- The name of the parameter.required
- True if the parameter is required.type
- The type of the parameter.style
- The style of the parameter.documentation
- A single documentation element.
@Deprecated public RepresentationInfo addResponseRepresentation(Variant variant)
ResponseInfo.getRepresentations()
instead.
variant
- The variant to describe.
public String getIdentifier()
public Method getName()
public RequestInfo getRequest()
public ResponseInfo getResponse()
public List<ResponseInfo> getResponses()
public Reference getTargetRef()
public void setIdentifier(String identifier)
identifier
- The identifier for the method.public void setName(Method name)
name
- The name of the method.public void setRequest(RequestInfo request)
request
- The input to the method.@Deprecated public void setResponsee(ResponseInfo response)
getResponses()
or
setResponses(List)
methods instead.
response
- The output of the method.public void setResponses(List<ResponseInfo> responses)
responses
- The output of the method.public void setTargetRef(Reference targetRef)
targetRef
- The reference to a method definition element.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |