public abstract class AbstractWadlGeneratorGrammarGenerator<T> extends java.lang.Object implements WadlGenerator
WadlGenerator
generates a grammar based on the referenced
elements. This is a template class designed to be overridden by specific
implementations, for example XML Schema and JSON Schema
Created on: Sept 17, 2012Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractWadlGeneratorGrammarGenerator.HasType |
protected class |
AbstractWadlGeneratorGrammarGenerator.Pair |
protected static interface |
AbstractWadlGeneratorGrammarGenerator.WantsName<T> |
WadlGenerator.Environment, WadlGenerator.ExternalGrammarDefinition, WadlGenerator.Resolver
Modifier and Type | Field and Description |
---|---|
protected FeaturesAndProperties |
_fap |
protected java.util.List<AbstractWadlGeneratorGrammarGenerator.Pair> |
_hasTypeWantsName |
protected Providers |
_providers |
protected java.lang.Class<T> |
_resolvedType |
protected java.net.URI |
_root |
protected java.util.Set<java.lang.Class> |
_seeAlso |
protected java.net.URI |
_wadl |
static java.util.Set<java.lang.Class> |
SPECIAL_GENERIC_TYPES |
Modifier | Constructor and Description |
---|---|
protected |
AbstractWadlGeneratorGrammarGenerator(WadlGenerator delegate,
java.lang.Class<T> resolvedType) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
acceptMediaType(MediaType type) |
void |
attachTypes(ApplicationDescription introspector)
Process the elements in the WADL definition to attach schema types
as required.
|
protected abstract WadlGenerator.Resolver |
buildModelAndSchemas(java.util.Map<java.lang.String,ApplicationDescription.ExternalGrammar> extraFiles)
Build the the external schema files and generate a suitable resolver
|
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) |
protected abstract AbstractWadlGeneratorGrammarGenerator.WantsName<T> |
createParmWantsName(com.sun.research.ws.wadl.Param param) |
protected abstract AbstractWadlGeneratorGrammarGenerator.WantsName<T> |
createRepresentationWantsName(com.sun.research.ws.wadl.Representation rt) |
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.
|
protected static AbstractWadlGeneratorGrammarGenerator.HasType |
parameter(Parameter param,
MediaType mt) |
void |
setEnvironment(WadlGenerator.Environment env)
Provides the WadlGenerator with the current generating environment.
|
void |
setWadlGeneratorDelegate(WadlGenerator delegate)
Sets the delegate that is decorated by this wadl generator.
|
public static final java.util.Set<java.lang.Class> SPECIAL_GENERIC_TYPES
protected java.util.Set<java.lang.Class> _seeAlso
protected java.util.List<AbstractWadlGeneratorGrammarGenerator.Pair> _hasTypeWantsName
protected java.net.URI _root
protected java.net.URI _wadl
protected Providers _providers
protected FeaturesAndProperties _fap
protected java.lang.Class<T> _resolvedType
protected AbstractWadlGeneratorGrammarGenerator(WadlGenerator delegate, java.lang.Class<T> resolvedType)
protected static AbstractWadlGeneratorGrammarGenerator.HasType parameter(Parameter param, MediaType mt)
param
- parameter.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 init() throws java.lang.Exception
WadlGenerator
this.delegate.init()
.init
in interface WadlGenerator
java.lang.Exception
public void setEnvironment(WadlGenerator.Environment env)
this.delegate.setEnvironment(env)
.setEnvironment
in interface WadlGenerator
public abstract boolean acceptMediaType(MediaType type)
type
- public com.sun.research.ws.wadl.Application createApplication(UriInfo requestInfo)
createApplication
in interface WadlGenerator
com.sun.jersey.server.wadl.WadlGenerator#createApplication()
public com.sun.research.ws.wadl.Method createMethod(AbstractResource ar, AbstractResourceMethod arm)
createMethod
in interface WadlGenerator
ar
- 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 WadlGenerator
ar
- 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 WadlGenerator
ar
- 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 WadlGenerator
ar
- 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 WadlGenerator
ar
- abstract resourcepath
- resources pathWadlGenerator.createResource(com.sun.jersey.api.model.AbstractResource, java.lang.String)
public com.sun.research.ws.wadl.Resources createResources()
createResources
in interface WadlGenerator
WadlGenerator.createResources()
public java.util.List<com.sun.research.ws.wadl.Response> createResponses(AbstractResource ar, AbstractResourceMethod arm)
createResponses
in interface WadlGenerator
ar
- abstract resourcearm
- abstract resource methodWadlGenerator.createResponses(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
public WadlGenerator.ExternalGrammarDefinition createExternalGrammar()
WadlGenerator
createExternalGrammar
in interface WadlGenerator
protected abstract WadlGenerator.Resolver buildModelAndSchemas(java.util.Map<java.lang.String,ApplicationDescription.ExternalGrammar> extraFiles)
extraFiles
- public void attachTypes(ApplicationDescription introspector)
WadlGenerator
attachTypes
in interface WadlGenerator
introspector
- The root description used to resolve these entriesprotected abstract AbstractWadlGeneratorGrammarGenerator.WantsName<T> createParmWantsName(com.sun.research.ws.wadl.Param param)
protected abstract AbstractWadlGeneratorGrammarGenerator.WantsName<T> createRepresentationWantsName(com.sun.research.ws.wadl.Representation rt)
Copyright © 2016 Oracle Corporation. All Rights Reserved.