public class WadlGeneratorGrammarsSupport extends java.lang.Object implements WadlGenerator
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.
WadlGenerator.Environment, WadlGenerator.ExternalGrammarDefinition, WadlGenerator.Resolver| Constructor and Description |
|---|
WadlGeneratorGrammarsSupport() |
WadlGeneratorGrammarsSupport(WadlGenerator delegate,
com.sun.research.ws.wadl.Grammars grammars) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachTypes(ApplicationDescription egd)
Process the elements in the WADL definition to attach schema types
as required.
|
com.sun.research.ws.wadl.Application |
createApplication(UriInfo requestInfo) |
WadlGenerator.ExternalGrammarDefinition |
createExternalGrammar()
Perform any post create functions such as generating grammars.
|
com.sun.research.ws.wadl.Method |
createMethod(AbstractResource ar,
AbstractResourceMethod arm) |
com.sun.research.ws.wadl.Param |
createParam(AbstractResource ar,
AbstractMethod am,
Parameter p) |
com.sun.research.ws.wadl.Request |
createRequest(AbstractResource ar,
AbstractResourceMethod arm) |
com.sun.research.ws.wadl.Representation |
createRequestRepresentation(AbstractResource ar,
AbstractResourceMethod arm,
MediaType mt) |
com.sun.research.ws.wadl.Resource |
createResource(AbstractResource ar,
java.lang.String path) |
com.sun.research.ws.wadl.Resources |
createResources() |
java.util.List<com.sun.research.ws.wadl.Response> |
createResponses(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 |
setEnvironment(WadlGenerator.Environment env)
Delegates the setting of the environment
|
void |
setGrammarsFile(java.io.File grammarsFile) |
void |
setGrammarsStream(java.io.InputStream grammarsStream) |
void |
setOverrideGrammars(java.lang.Boolean overrideGrammars) |
void |
setWadlGeneratorDelegate(WadlGenerator delegate)
Sets the delegate that is decorated by this wadl generator.
|
public WadlGeneratorGrammarsSupport()
public WadlGeneratorGrammarsSupport(WadlGenerator delegate, com.sun.research.ws.wadl.Grammars grammars)
public void setWadlGeneratorDelegate(WadlGenerator delegate)
WadlGeneratorWadlGenerator.init() or any setter method is invoked.setWadlGeneratorDelegate in interface WadlGeneratordelegate - the wadl generator to decoratepublic void setEnvironment(WadlGenerator.Environment env)
setEnvironment in interface WadlGeneratorpublic void setOverrideGrammars(java.lang.Boolean overrideGrammars)
public java.lang.String getRequiredJaxbContextPath()
WadlGeneratorWadlGenerator.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 WadlGeneratorWadlGenerator.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
WadlGeneratorthis.delegate.init().init in interface WadlGeneratorjava.lang.Exceptionpublic com.sun.research.ws.wadl.Application createApplication(UriInfo requestInfo)
createApplication in interface WadlGeneratorcom.sun.jersey.server.wadl.WadlGenerator#createApplication()public com.sun.research.ws.wadl.Method createMethod(AbstractResource ar, AbstractResourceMethod arm)
createMethod in interface WadlGeneratorar - abstract resourcearm - abstract resource methodWadlGenerator.createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)public com.sun.research.ws.wadl.Request createRequest(AbstractResource ar, AbstractResourceMethod arm)
createRequest in interface WadlGeneratorar - abstract resourcearm - abstract resource methodWadlGenerator.createRequest(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)public com.sun.research.ws.wadl.Param createParam(AbstractResource ar, AbstractMethod am, Parameter p)
createParam in interface WadlGeneratorar - abstract resourceam - abstract methodp - parameterWadlGenerator.createParam(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractMethod, com.sun.jersey.api.model.Parameter)public com.sun.research.ws.wadl.Representation createRequestRepresentation(AbstractResource ar, AbstractResourceMethod arm, MediaType mt)
createRequestRepresentation in interface WadlGeneratorar - abstract resourcearm - abstract resource methodmt - media typeWadlGenerator.createRequestRepresentation(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod, javax.ws.rs.core.MediaType)public com.sun.research.ws.wadl.Resource createResource(AbstractResource ar, java.lang.String path)
createResource in interface WadlGeneratorar - abstract resourcepath - WadlGenerator.createResource(com.sun.jersey.api.model.AbstractResource, java.lang.String)public com.sun.research.ws.wadl.Resources createResources()
createResources in interface WadlGeneratorWadlGenerator.createResources()public java.util.List<com.sun.research.ws.wadl.Response> createResponses(AbstractResource ar, AbstractResourceMethod arm)
createResponses in interface WadlGeneratorar - abstract resourcearm - abstract resource methodWadlGenerator.createResponses(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)public WadlGenerator.ExternalGrammarDefinition createExternalGrammar()
WadlGeneratorcreateExternalGrammar in interface WadlGeneratorpublic void attachTypes(ApplicationDescription egd)
WadlGeneratorattachTypes in interface WadlGeneratoregd - The root description used to resolve these entriesCopyright © 2016 Oracle Corporation. All Rights Reserved.