public class WadlGeneratorApplicationDoc extends java.lang.Object implements WadlGenerator
WadlGenerator
adds all doc elements provided by ApplicationDocs.getDocs()
to the generated wadl-file.
The ApplicationDocs
content can either be provided via a File
reference
(setApplicationDocsFile(File)
) or
via an InputStream
(setApplicationDocsStream(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.ExternalGrammarDefinition, WadlGenerator.Resolver
Modifier and Type | Field and Description |
---|---|
private ApplicationDocs |
_applicationDocs |
private java.io.File |
_applicationDocsFile |
private java.io.InputStream |
_applicationDocsStream |
private WadlGenerator |
_delegate |
private javax.inject.Provider<javax.xml.parsers.SAXParserFactory> |
saxFactoryProvider |
Constructor and Description |
---|
WadlGeneratorApplicationDoc() |
Modifier and Type | Method and Description |
---|---|
void |
attachTypes(ApplicationDescription egd)
Process the elements in the WADL definition to attach schema types
as required.
|
Application |
createApplication() |
WadlGenerator.ExternalGrammarDefinition |
createExternalGrammar()
Perform any post create functions such as generating grammars.
|
Method |
createMethod(Resource r,
ResourceMethod m) |
Param |
createParam(Resource r,
ResourceMethod m,
Parameter p) |
Request |
createRequest(Resource r,
ResourceMethod m) |
Representation |
createRequestRepresentation(Resource r,
ResourceMethod m,
javax.ws.rs.core.MediaType mediaType) |
Resource |
createResource(Resource r,
java.lang.String path) |
Resources |
createResources() |
java.util.List<Response> |
createResponses(Resource r,
ResourceMethod m) |
java.lang.String |
getRequiredJaxbContextPath()
The jaxb context path that is used when the generated wadl application is marshalled
to a file.
|
void |
init()
Invoked before all methods related to wadl-building are invoked.
|
void |
setApplicationDocsFile(java.io.File applicationDocsFile) |
void |
setApplicationDocsStream(java.io.InputStream applicationDocsStream) |
void |
setWadlGeneratorDelegate(WadlGenerator delegate)
Sets the delegate that is decorated by this wadl generator.
|
private WadlGenerator _delegate
private java.io.File _applicationDocsFile
private java.io.InputStream _applicationDocsStream
private ApplicationDocs _applicationDocs
@Context private javax.inject.Provider<javax.xml.parsers.SAXParserFactory> saxFactoryProvider
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 #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
getRequiredJaxbContextPath()
of the delegate or the
getRequiredJaxbContextPath() + ":" + ${yourContextPath}
.public void setApplicationDocsFile(java.io.File applicationDocsFile)
public void setApplicationDocsStream(java.io.InputStream applicationDocsStream)
public void init() throws java.lang.Exception
WadlGenerator
this.delegate.init()
.init
in interface WadlGenerator
java.lang.IllegalStateException
javax.xml.bind.JAXBException
java.lang.Exception
public Application createApplication()
createApplication
in interface WadlGenerator
WadlGenerator.createApplication()
public Method createMethod(Resource r, ResourceMethod m)
createMethod
in interface WadlGenerator
r
- m
- WadlGenerator.createMethod(org.glassfish.jersey.server.model.Resource,
org.glassfish.jersey.server.model.ResourceMethod)
public Representation createRequestRepresentation(Resource r, ResourceMethod m, javax.ws.rs.core.MediaType mediaType)
createRequestRepresentation
in interface WadlGenerator
r
- m
- mediaType
- WadlGenerator.createRequestRepresentation(org.glassfish.jersey.server.model.Resource,
org.glassfish.jersey.server.model.ResourceMethod, javax.ws.rs.core.MediaType)
public Request createRequest(Resource r, ResourceMethod m)
createRequest
in interface WadlGenerator
r
- m
- WadlGenerator.createRequest(org.glassfish.jersey.server.model.Resource,
org.glassfish.jersey.server.model.ResourceMethod)
public Param createParam(Resource r, ResourceMethod m, Parameter p)
createParam
in interface WadlGenerator
r
- m
- p
- WadlGenerator.createParam(org.glassfish.jersey.server.model.Resource,
org.glassfish.jersey.server.model.ResourceMethod, org.glassfish.jersey.server.model.Parameter)
public Resource createResource(Resource r, java.lang.String path)
createResource
in interface WadlGenerator
r
- path
- WadlGenerator.createResource(org.glassfish.jersey.server.model.Resource, String)
public java.util.List<Response> createResponses(Resource r, ResourceMethod m)
createResponses
in interface WadlGenerator
r
- m
- WadlGenerator.createResponses(org.glassfish.jersey.server.model.Resource,
org.glassfish.jersey.server.model.ResourceMethod)
public Resources createResources()
createResources
in interface WadlGenerator
WadlGenerator.createResources()
public WadlGenerator.ExternalGrammarDefinition createExternalGrammar()
WadlGenerator
createExternalGrammar
in interface WadlGenerator
public void attachTypes(ApplicationDescription egd)
WadlGenerator
attachTypes
in interface WadlGenerator
egd
- The root description used to resolve these entries