org.jvnet.ws.wadl.ast
Class ResourceTypeNode

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

public class ResourceTypeNode
extends AbstractNode

Represents a WADL resource_type.

Author:
mh124079

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jvnet.ws.wadl.ast.AbstractNode
AbstractNode.NodeVisitor
 
Constructor Summary
ResourceTypeNode(ResourceType resourceType, URI file, ElementResolver idMap)
          Create a new instance of ResourceTypeNode.
 
Method Summary
 ResourceNode addChild(Resource r, URI file, ElementResolver idMap)
          Create a new resource and add it as a child.
 String getClassName()
          Convenience function for generating a suitable Java class name for this WADL resource.
 List<Doc> getDoc()
          List of child documentation elements
 com.sun.codemodel.JDefinedClass getGeneratedInterface()
           
 List<Param> getHeaderParams()
          Get the header parameters.
 Locator getLocation()
           
 List<Param> getMatrixParams()
          Get the matrix parameters.
 List<MethodNode> getMethods()
          Get the methods for this resource type.
 List<Param> getQueryParams()
          Get the query parameters.
 List<ResourceNode> getResources()
          Get the resources for this resource type.
 void setGeneratedInterface(com.sun.codemodel.JDefinedClass iface)
           
 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

ResourceTypeNode

public ResourceTypeNode(ResourceType resourceType,
                        URI file,
                        ElementResolver idMap)
                 throws InvalidWADLException
Create a new instance of ResourceTypeNode.

Parameters:
resourceType - the unmarshalled JAXB-generated object.
file - the URI of the WADL file that contains the resource type element.
idMap - a map of URI reference to WADL definition element.
Throws:
InvalidWADLException - when WADL is invalid and cannot be processed.
Method Detail

addChild

public ResourceNode addChild(Resource r,
                             URI file,
                             ElementResolver idMap)
                      throws InvalidWADLException
Create a new resource and add it as a child.

Parameters:
r - the unmarshalled JAXB resource element.
file - the URI of the WADL file that contains the resource type element.
idMap - a map of URI reference to WADL definition element.
Returns:
the new resource element.
Throws:
InvalidWADLException - when WADL is invalid and cannot be processed.

getClassName

public String getClassName()
Convenience function for generating a suitable Java class name for this WADL resource.

Returns:
a suitable name.

getMethods

public List<MethodNode> getMethods()
Get the methods for this resource type.

Returns:
a list of methods.

getResources

public List<ResourceNode> getResources()
Get the resources for this resource type.

Returns:
a list of resources.

getQueryParams

public List<Param> getQueryParams()
Get the query parameters.

Returns:
list of query params.

getHeaderParams

public List<Param> getHeaderParams()
Get the header parameters.

Returns:
list of header parameters.

getMatrixParams

public List<Param> getMatrixParams()
Get the matrix parameters.

Returns:
list of matrix parameters.

getDoc

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

Returns:
documentation list, one item per language

setGeneratedInterface

public void setGeneratedInterface(com.sun.codemodel.JDefinedClass iface)

getGeneratedInterface

public com.sun.codemodel.JDefinedClass getGeneratedInterface()

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 © 2012. All Rights Reserved.