Class WadlGeneratorImpl
java.lang.Object
org.glassfish.jersey.server.wadl.internal.WadlGeneratorImpl
- All Implemented Interfaces:
WadlGenerator
This WadlGenerator creates the basic wadl artifacts.
Created on: Jun 16, 2008
Created on: Jun 16, 2008
- Author:
- Martin Grotzke (martin.grotzke at freiheit.com), Miroslav Fuksa
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.jersey.server.wadl.WadlGenerator
WadlGenerator.ExternalGrammarDefinition, WadlGenerator.Resolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess the elements in the WADL definition to attach schema types as required.Perform any post create functions such as generating grammars.createParam(Resource r, ResourceMethod m, Parameter p) createRequestRepresentation(Resource r, ResourceMethod m, MediaType mediaType) createResource(Resource resource, String path) createResponseRepresentation(Resource r, ResourceMethod m, MediaType mediaType) The jaxb context path that is used when the generated wadl application is marshalled to a file.voidinit()Invoked before all methods related to wadl-building are invoked.voidsetWadlGeneratorDelegate(WadlGenerator delegate) Sets the delegate that is decorated by this wadl generator.
-
Constructor Details
-
WadlGeneratorImpl
public WadlGeneratorImpl()
-
-
Method Details
-
getRequiredJaxbContextPath
Description copied from interface:WadlGeneratorThe 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 byWadlGenerator.setWadlGeneratorDelegate(WadlGenerator).
If you do not use custom jaxb beans, then simply return_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 withXmlRegistry) to this package.- Specified by:
getRequiredJaxbContextPathin interfaceWadlGenerator- Returns:
- simply the
getRequiredJaxbContextPath()of the delegate or thegetRequiredJaxbContextPath() + ":" + ${yourContextPath}.
-
init
public void init()Description copied from interface:WadlGeneratorInvoked before all methods related to wadl-building are invoked. This method is used in a decorator like manner, and therefore has to invokethis.delegate.init().- Specified by:
initin interfaceWadlGenerator
-
setWadlGeneratorDelegate
Description copied from interface:WadlGeneratorSets the delegate that is decorated by this wadl generator. Is invoked directly after this generator is instantiated beforeWadlGenerator.init()or any setter method is invoked.- Specified by:
setWadlGeneratorDelegatein interfaceWadlGenerator- Parameters:
delegate- the wadl generator to decorate
-
createResources
- Specified by:
createResourcesin interfaceWadlGenerator
-
createApplication
- Specified by:
createApplicationin interfaceWadlGenerator
-
createMethod
- Specified by:
createMethodin interfaceWadlGenerator
-
createRequestRepresentation
public Representation createRequestRepresentation(Resource r, ResourceMethod m, MediaType mediaType) - Specified by:
createRequestRepresentationin interfaceWadlGenerator
-
createRequest
- Specified by:
createRequestin interfaceWadlGenerator
-
createParam
- Specified by:
createParamin interfaceWadlGenerator
-
createResource
- Specified by:
createResourcein interfaceWadlGenerator
-
createResponses
- Specified by:
createResponsesin interfaceWadlGenerator
-
createResponseRepresentation
public Representation createResponseRepresentation(Resource r, ResourceMethod m, MediaType mediaType) -
createExternalGrammar
Description copied from interface:WadlGeneratorPerform any post create functions such as generating grammars.- Specified by:
createExternalGrammarin interfaceWadlGenerator- Returns:
- A map of extra files to the content of those file encoded in UTF-8
-
attachTypes
Description copied from interface:WadlGeneratorProcess the elements in the WADL definition to attach schema types as required.- Specified by:
attachTypesin interfaceWadlGenerator- Parameters:
egd- The root description used to resolve these entries
-