|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.ws.wadl2java.Wadl2Java
public class Wadl2Java
Processes a WADL file and generates client-side stubs for the resources and methods described.
| Nested Class Summary | |
|---|---|
static class |
Wadl2Java.Parameters
A parameter object to make it easier to extend this class without having to add more constructors or parameters. |
protected class |
Wadl2Java.SchemaCompilerErrorListener
Inner class implementing the JAXB ErrorListener interface to
support error reporting from the JAXB infrastructure. |
| Field Summary | |
|---|---|
static QName |
JSON_SCHEMA_DESCRIBEDBY
|
static String |
STYLE_DEFAULT
|
static String |
STYLE_JAXRS20
|
static String |
STYLE_JERSEY1X
|
static Set<String> |
STYLE_SET
|
| Constructor Summary | |
|---|---|
Wadl2Java(Wadl2Java.Parameters parameters)
Creates a new instance of a Wadl2Java processor. |
|
| Method Summary | |
|---|---|
protected void |
generateEndpointClass(URI rootResource,
ResourceNode root)
Create a class that acts as a container for a hierarchy of static inner classes, one for each resource described by the WADL file. |
protected void |
generateResourceTypeInterfaces()
Generate Java interfaces for WADL resource types |
protected void |
generateSubClass(com.sun.codemodel.JDefinedClass parent,
com.sun.codemodel.JVar $global_base_uri,
ResourceNode resource)
Creates an inner static class that represents a resource and its methods. |
void |
process(URI rootDesc)
Process the root WADL file and generate code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String STYLE_JERSEY1X
public static final String STYLE_JAXRS20
public static final String STYLE_DEFAULT
public static final Set<String> STYLE_SET
public static final QName JSON_SCHEMA_DESCRIBEDBY
| Constructor Detail |
|---|
public Wadl2Java(Wadl2Java.Parameters parameters)
| Method Detail |
|---|
public void process(URI rootDesc)
throws JAXBException,
IOException,
com.sun.codemodel.JClassAlreadyExistsException,
InvalidWADLException
rootDesc - the URI of the WADL file to process
JAXBException - if the WADL file is invalid, a
referenced WADL file is invalid, or if the code generator encounters
a problem.
IOException - if the specified WADL file cannot be read.
com.sun.codemodel.JClassAlreadyExistsException - if, during code
generation, the WADL processor attempts to create a duplicate
class. This indicates a structural problem with the WADL file, e.g. duplicate
peer resource entries.
InvalidWADLException - TODO.
protected void generateResourceTypeInterfaces()
throws com.sun.codemodel.JClassAlreadyExistsException
com.sun.codemodel.JClassAlreadyExistsException - if the interface to be generated already exists
protected void generateEndpointClass(URI rootResource,
ResourceNode root)
throws com.sun.codemodel.JClassAlreadyExistsException
rootResource - the root URI to the WADL so we can generate the required annotationsroot - the resource element that corresponds to the root of the resource tree
com.sun.codemodel.JClassAlreadyExistsException - if, during code
generation, the WADL processor attempts to create a duplicate
class. This indicates a structural problem with the WADL file, e.g. duplicate
peer resource entries.
protected void generateSubClass(com.sun.codemodel.JDefinedClass parent,
com.sun.codemodel.JVar $global_base_uri,
ResourceNode resource)
throws com.sun.codemodel.JClassAlreadyExistsException
parent - the outer class for the static inner class being
generated. This can either be a top level class or a nested static
inner class for a parent resource.resource - the WADL resource element being processed.$base_uri - The root URI for this resource class
com.sun.codemodel.JClassAlreadyExistsException - if, during code
generation, the WADL processor attempts to create a duplicate
class. This indicates a structural problem with the WADL file,
e.g. duplicate peer resource entries.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||