|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport
public class WadlGeneratorGrammarsSupport
This WadlGenerator
adds the provided Grammars
element to the
generated wadl-file.
The Grammars
content can either be provided via a File
(setGrammarsFile(File)
) reference or
via an InputStream
(setGrammarsStream(InputStream)
).
The File
should be used when using the maven-wadl-plugin for generating wadl offline,
the InputStream
should be used when the extended wadl is generated by jersey at runtime, e.g.
using the WadlGeneratorConfig
for configuration.
Constructor Summary | |
---|---|
WadlGeneratorGrammarsSupport()
|
|
WadlGeneratorGrammarsSupport(WadlGenerator delegate,
Grammars grammars)
|
Method Summary | |
---|---|
Application |
createApplication()
|
Method |
createMethod(AbstractResource ar,
AbstractResourceMethod arm)
|
Param |
createParam(AbstractResource ar,
AbstractMethod am,
Parameter p)
|
Request |
createRequest(AbstractResource ar,
AbstractResourceMethod arm)
|
RepresentationType |
createRequestRepresentation(AbstractResource ar,
AbstractResourceMethod arm,
javax.ws.rs.core.MediaType mt)
|
Resource |
createResource(AbstractResource ar,
java.lang.String path)
|
Resources |
createResources()
|
Response |
createResponse(AbstractResource ar,
AbstractResourceMethod arm)
|
java.lang.String |
getRequiredJaxbContextPath()
The jaxb context path that is used when the generated wadl application is marshalled to a file. This method is used in a decorator like manner. The result return the path (or a colon-separated list of package names) containing jaxb-beans that are added to wadl elements by this WadlGenerator, additionally to the context path of the decorated WadlGenerator (set by WadlGenerator.setWadlGeneratorDelegate(WadlGenerator) .If you do not use custom jaxb beans, then simply return _delegate.getRequiredJaxbContextPath() ,
otherwise return the delegate's WadlGenerator.getRequiredJaxbContextPath() together with
your required context path (separated by a colon): |
void |
init()
Invoked before all methods related to wadl-building are invoked. |
void |
setGrammarsFile(java.io.File grammarsFile)
|
void |
setGrammarsStream(java.io.InputStream grammarsStream)
|
void |
setWadlGeneratorDelegate(WadlGenerator delegate)
Sets the delegate that is decorated by this wadl generator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WadlGeneratorGrammarsSupport()
public WadlGeneratorGrammarsSupport(WadlGenerator delegate, Grammars grammars)
Method Detail |
---|
public void setWadlGeneratorDelegate(WadlGenerator delegate)
WadlGenerator
WadlGenerator.init()
or any setter method is invoked.
setWadlGeneratorDelegate
in interface WadlGenerator
delegate
- the wadl generator to decoratepublic java.lang.String getRequiredJaxbContextPath()
WadlGenerator
WadlGenerator.setWadlGeneratorDelegate(WadlGenerator)
._delegate.getRequiredJaxbContextPath()
,
otherwise return the delegate's WadlGenerator.getRequiredJaxbContextPath()
together with
your required context path (separated by a colon):_delegate.getRequiredJaxbContextPath() == null
? ${yourContextPath}
: _delegate.getRequiredJaxbContextPath() + ":" + ${yourContextPath};
If you add the path for your custom jaxb beans, don't forget to add an
ObjectFactory (annotated with XmlRegistry
) to this package.
getRequiredJaxbContextPath
in interface WadlGenerator
WadlGenerator.getRequiredJaxbContextPath()
of the delegate or the
WadlGenerator.getRequiredJaxbContextPath()
+ ":" + ${yourContextPath}.public void setGrammarsFile(java.io.File grammarsFile)
public void setGrammarsStream(java.io.InputStream grammarsStream)
public void init() throws java.lang.Exception
WadlGenerator
this.delegate.init()
.
init
in interface WadlGenerator
java.lang.Exception
public Application createApplication()
createApplication
in interface WadlGenerator
WadlGenerator.createApplication()
public Method createMethod(AbstractResource ar, AbstractResourceMethod arm)
createMethod
in interface WadlGenerator
ar
- abstract resourcearm
- abstract resource method
WadlGenerator.createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
public Request createRequest(AbstractResource ar, AbstractResourceMethod arm)
createRequest
in interface WadlGenerator
ar
- abstract resourcearm
- abstract resource method
WadlGenerator.createRequest(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
public Param createParam(AbstractResource ar, AbstractMethod am, Parameter p)
createParam
in interface WadlGenerator
ar
- abstract resourceam
- abstract methodp
- parameter
WadlGenerator.createParam(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractMethod, com.sun.jersey.api.model.Parameter)
public RepresentationType createRequestRepresentation(AbstractResource ar, AbstractResourceMethod arm, javax.ws.rs.core.MediaType mt)
createRequestRepresentation
in interface WadlGenerator
ar
- abstract resourcearm
- abstract resource methodmt
- media type
WadlGenerator.createRequestRepresentation(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod, javax.ws.rs.core.MediaType)
public Resource createResource(AbstractResource ar, java.lang.String path)
createResource
in interface WadlGenerator
ar
- abstract resourcepath
-
WadlGenerator.createResource(com.sun.jersey.api.model.AbstractResource, java.lang.String)
public Resources createResources()
createResources
in interface WadlGenerator
WadlGenerator.createResources()
public Response createResponse(AbstractResource ar, AbstractResourceMethod arm)
createResponse
in interface WadlGenerator
ar
- abstract resourcearm
- abstract resource method
WadlGenerator.createResponse(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |