Class WadlGeneratorJAXBGrammarGenerator
java.lang.Object
org.glassfish.jersey.server.wadl.internal.generators.WadlGeneratorJAXBGrammarGenerator
- All Implemented Interfaces:
WadlGenerator
This
WadlGenerator
generates a XML Schema content model based on
referenced java beans.
Created on: Jun 22, 2011- Author:
- Gerard Davison, Miroslav Fuksa
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.jersey.server.wadl.WadlGenerator
WadlGenerator.ExternalGrammarDefinition, WadlGenerator.Resolver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachTypes
(ApplicationDescription introspector) Process the elements in the WADL definition to attach schema types as required.Perform any post create functions such as generating grammars.createMethod
(Resource ar, ResourceMethod arm) createParam
(Resource ar, ResourceMethod am, Parameter p) createRequest
(Resource ar, ResourceMethod arm) createRequestRepresentation
(Resource ar, ResourceMethod arm, MediaType mt) createResource
(Resource ar, String path) createResponses
(Resource resource, ResourceMethod resourceMethod) 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
setWadlGeneratorDelegate
(WadlGenerator delegate) Sets the delegate that is decorated by this wadl generator.
-
Constructor Details
-
WadlGeneratorJAXBGrammarGenerator
public WadlGeneratorJAXBGrammarGenerator()
-
-
Method Details
-
setWadlGeneratorDelegate
Description copied from interface:WadlGenerator
Sets 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:
setWadlGeneratorDelegate
in interfaceWadlGenerator
- Parameters:
delegate
- the wadl generator to decorate
-
getRequiredJaxbContextPath
Description copied from interface:WadlGenerator
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 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:
getRequiredJaxbContextPath
in interfaceWadlGenerator
- Returns:
- simply the
getRequiredJaxbContextPath()
of the delegate or thegetRequiredJaxbContextPath() + ":" + ${yourContextPath}
.
-
init
Description copied from interface:WadlGenerator
Invoked 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:
init
in interfaceWadlGenerator
- Throws:
IllegalStateException
jakarta.xml.bind.JAXBException
Exception
-
createApplication
- Specified by:
createApplication
in interfaceWadlGenerator
- Returns:
- application
- See Also:
-
createMethod
- Specified by:
createMethod
in interfaceWadlGenerator
- Parameters:
ar
- abstract resourcearm
- abstract resource method- Returns:
- method
- See Also:
-
createRequest
- Specified by:
createRequest
in interfaceWadlGenerator
- Parameters:
ar
- abstract resourcearm
- abstract resource method- Returns:
- request
- See Also:
-
createParam
- Specified by:
createParam
in interfaceWadlGenerator
- Parameters:
ar
- abstract resourceam
- abstract methodp
- parameter- Returns:
- parameter
- See Also:
-
createRequestRepresentation
- Specified by:
createRequestRepresentation
in interfaceWadlGenerator
- Parameters:
ar
- abstract resourcearm
- abstract resource methodmt
- media type- Returns:
- respresentation type
- See Also:
-
createResource
- Specified by:
createResource
in interfaceWadlGenerator
- Parameters:
ar
- abstract resourcepath
- resources path- Returns:
- resource
- See Also:
-
createResources
- Specified by:
createResources
in interfaceWadlGenerator
- Returns:
- resources
- See Also:
-
createResponses
- Specified by:
createResponses
in interfaceWadlGenerator
- Parameters:
resource
- abstract resourceresourceMethod
- abstract resource method- Returns:
- response
- See Also:
-
createExternalGrammar
Description copied from interface:WadlGenerator
Perform any post create functions such as generating grammars.- Specified by:
createExternalGrammar
in interfaceWadlGenerator
- Returns:
- A map of extra files to the content of those file encoded in UTF-8
-
attachTypes
Description copied from interface:WadlGenerator
Process the elements in the WADL definition to attach schema types as required.- Specified by:
attachTypes
in interfaceWadlGenerator
- Parameters:
introspector
- The root description used to resolve these entries
-