org.jvnet.ws.wadl.ast
Class MethodNode

java.lang.Object
  extended by org.jvnet.ws.wadl.ast.AbstractNode
      extended by org.jvnet.ws.wadl.ast.MethodNode

public class MethodNode
extends AbstractNode

Represents a WADL method

Author:
mh124079

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jvnet.ws.wadl.ast.AbstractNode
AbstractNode.NodeVisitor
 
Constructor Summary
MethodNode(Method m, ResourceNode r)
          Creates a new instance of MethodNode and attach it to a resource
MethodNode(Method m, ResourceTypeNode r)
          Creates a new instance of MethodNode and attach it to a resource type
 
Method Summary
 List<Doc> getDoc()
          List of child documentation elements
 javax.ws.rs.core.MultivaluedMap<List<Long>,FaultNode> getFaults()
          Get a list of the faults for this method
 List<Param> getHeaderParameters()
          Get all the header parameters
 String getId()
          Get the method name
 Locator getLocation()
           
 List<Param> getMatrixParameters()
          Get all the matrix parameters for this and enclosing resources
 String getName()
          Get the method name
 List<Param> getOptionalParameters()
          Get the parameters marked as optional
 ResourceNode getOwningResource()
           
 List<Param> getQueryParameters()
          Get all the query parameters
 List<Param> getRequiredParameters()
          Get the parameters marked as required
 List<RepresentationNode> getSupportedInputs()
          Get a list of the supported input types, these correspond to the body of a PUT, or POST request
 javax.ws.rs.core.MultivaluedMap<List<Long>,RepresentationNode> getSupportedOutputs()
          Get a multi valued map of output representations that the method supports, these correspond to the body of a GET, POST or PUT response.
 boolean hasOptionalParameters()
          Checks if there are any optional parameters
 void visit(AbstractNode.NodeVisitor visitor)
          Allow the provided parameter to visit the current node and any child nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodNode

public MethodNode(Method m,
                  ResourceNode r)
Creates a new instance of MethodNode and attach it to a resource

Parameters:
m - the unmarshalled JAXB-generated method object
r - the resource to attach the method to

MethodNode

public MethodNode(Method m,
                  ResourceTypeNode r)
Creates a new instance of MethodNode and attach it to a resource type

Parameters:
m - the unmarshalled JAXB-generated method object
r - the resource to attach the method to
Method Detail

getName

public String getName()
Get the method name

Returns:
the method name

getId

public String getId()
Get the method name

Returns:
the method name

getOwningResource

public ResourceNode getOwningResource()
Returns:
The owning resource if this is avaliable, generally only avaliable for fully resolved types

getQueryParameters

public List<Param> getQueryParameters()
Get all the query parameters

Returns:
list of query parameters

getHeaderParameters

public List<Param> getHeaderParameters()
Get all the header parameters

Returns:
list of header parameters

getMatrixParameters

public List<Param> getMatrixParameters()
Get all the matrix parameters for this and enclosing resources

Returns:
list of header parameters

getRequiredParameters

public List<Param> getRequiredParameters()
Get the parameters marked as required

Returns:
list of required parameters

getOptionalParameters

public List<Param> getOptionalParameters()
Get the parameters marked as optional

Returns:
list of optional parameters

hasOptionalParameters

public boolean hasOptionalParameters()
Checks if there are any optional parameters

Returns:
true if there are optional parameters, false if not

getSupportedInputs

public List<RepresentationNode> getSupportedInputs()
Get a list of the supported input types, these correspond to the body of a PUT, or POST request

Returns:
a list of representations that can be accepted by the method

getSupportedOutputs

public javax.ws.rs.core.MultivaluedMap<List<Long>,RepresentationNode> getSupportedOutputs()
Get a multi valued map of output representations that the method supports, these correspond to the body of a GET, POST or PUT response.

Returns:
multiValuedMap of supported outputs

getFaults

public javax.ws.rs.core.MultivaluedMap<List<Long>,FaultNode> getFaults()
Get a list of the faults for this method

Returns:
list of faults

getDoc

public List<Doc> getDoc()
List of child documentation elements

Returns:
documentation list, one item per language

getLocation

public Locator getLocation()
Specified by:
getLocation in class AbstractNode
Returns:
The location of the node

visit

public void visit(AbstractNode.NodeVisitor visitor)
Allow the provided parameter to visit the current node and any child nodes.

Overrides:
visit in class AbstractNode


Copyright © 2014. All Rights Reserved.