org.jvnet.ws.wadl2java
Interface ResourceClassGenerator

All Known Implementing Classes:
BaseResourceClassGenerator, JAXRS20ResourceClassGenerator, Jersey1xResourceClassGenerator

public interface ResourceClassGenerator

A simplified interface to the resource class generators

Author:
gdavison

Method Summary
 void generateBeanProperty(com.sun.codemodel.JDefinedClass $impl, List<Param> matrixParameters, Param p, boolean isAbstract)
          Generate a bean setter and getter for a parameter.
 com.sun.codemodel.JDefinedClass generateClass(com.sun.codemodel.JDefinedClass parentClass, com.sun.codemodel.JVar $global_base_uri)
          Generate a static member class that represents a WADL resource.
 void generateMethodDecls(MethodNode method, boolean isAbstract)
          Generate a set of method declarations for a WADL method element.
 

Method Detail

generateBeanProperty

void generateBeanProperty(com.sun.codemodel.JDefinedClass $impl,
                          List<Param> matrixParameters,
                          Param p,
                          boolean isAbstract)
Generate a bean setter and getter for a parameter.

Parameters:
$impl - The class or interface to add the bean setter and getter to.
p - the WADL parameter for which to create the setter and getter.
isAbstract - controls whether a method body is created false or not true. Set to true for interface methods, false for class methods.

generateClass

com.sun.codemodel.JDefinedClass generateClass(com.sun.codemodel.JDefinedClass parentClass,
                                              com.sun.codemodel.JVar $global_base_uri)
                                              throws com.sun.codemodel.JClassAlreadyExistsException
Generate a static member class that represents a WADL resource.

Parameters:
parentClass - the parent class for the generated class.
$global_base_uri - a reference to the field that contains the base URI.
Returns:
the generated class.
Throws:
com.sun.codemodel.JClassAlreadyExistsException - if a class with the same name already exists.

generateMethodDecls

void generateMethodDecls(MethodNode method,
                         boolean isAbstract)
Generate a set of method declarations for a WADL method element.

Generates two Java methods per returned representation type for each request type, one with all optional parameters and one without. I.e. if the WADL method specifies two possible request representation formats and three supported response representation formats, this method will generate twelve Java methods, one for each combination.

Parameters:
isAbstract - controls whether the generated methods will have a body false or not true.
method - the WADL method element to process.


Copyright © 2014. All Rights Reserved.