com.sun.jersey.server.wadl
Interface WadlGenerator

All Known Implementing Classes:
WadlGeneratorApplicationDoc, WadlGeneratorGrammarsSupport, WadlGeneratorImpl, WadlGeneratorResourceDocSupport

public interface WadlGenerator

A WadlGenerator creates artifacts related to wadl. This is designed as an interface, so that several implementations can decorate existing ones. One decorator could e.g. add references to definitions within some xsd for existing representations.
Created on: Jun 16, 2008

Version:
$Id$
Author:
Martin Grotzke

Method Summary
 com.sun.research.ws.wadl.Application createApplication()
           
 com.sun.research.ws.wadl.Method createMethod(AbstractResource r, AbstractResourceMethod m)
           
 com.sun.research.ws.wadl.Param createParam(AbstractResource r, AbstractMethod m, Parameter p)
           
 com.sun.research.ws.wadl.Request createRequest(AbstractResource r, AbstractResourceMethod m)
           
 com.sun.research.ws.wadl.RepresentationType createRequestRepresentation(AbstractResource r, AbstractResourceMethod m, MediaType mediaType)
           
 com.sun.research.ws.wadl.Resource createResource(AbstractResource r, java.lang.String path)
           
 com.sun.research.ws.wadl.Resources createResources()
           
 com.sun.research.ws.wadl.Response createResponse(AbstractResource r, AbstractResourceMethod m)
           
 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 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):
 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.
 

Method Detail

setWadlGeneratorDelegate

void setWadlGeneratorDelegate(WadlGenerator delegate)
Sets the delegate that is decorated by this wadl generator. Is invoked directly after this generator is instantiated before init() or any setter method is invoked.

Parameters:
delegate - the wadl generator to decorate

init

void init()
          throws java.lang.Exception
Invoked before all methods related to wadl-building are invoked. This method is used in a decorator like manner, and therefore has to invoke this.delegate.init().

Throws:
java.lang.Exception

getRequiredJaxbContextPath

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 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 with XmlRegistry) to this package.

Returns:
simply the getRequiredJaxbContextPath() of the delegate or the getRequiredJaxbContextPath() + ":" + ${yourContextPath}.

createApplication

com.sun.research.ws.wadl.Application createApplication()

createResources

com.sun.research.ws.wadl.Resources createResources()

createResource

com.sun.research.ws.wadl.Resource createResource(AbstractResource r,
                                                 java.lang.String path)

createMethod

com.sun.research.ws.wadl.Method createMethod(AbstractResource r,
                                             AbstractResourceMethod m)

createRequest

com.sun.research.ws.wadl.Request createRequest(AbstractResource r,
                                               AbstractResourceMethod m)

createRequestRepresentation

com.sun.research.ws.wadl.RepresentationType createRequestRepresentation(AbstractResource r,
                                                                        AbstractResourceMethod m,
                                                                        MediaType mediaType)

createResponse

com.sun.research.ws.wadl.Response createResponse(AbstractResource r,
                                                 AbstractResourceMethod m)

createParam

com.sun.research.ws.wadl.Param createParam(AbstractResource r,
                                           AbstractMethod m,
                                           Parameter p)


Copyright © 2010 Oracle Corporation. All Rights Reserved.