com.sun.jersey.server.wadl
Class WadlGeneratorImpl

java.lang.Object
  extended by com.sun.jersey.server.wadl.WadlGeneratorImpl
All Implemented Interfaces:
WadlGenerator

public class WadlGeneratorImpl
extends java.lang.Object
implements WadlGenerator

This WadlGenerator creates the basic wadl artifacts.
Created on: Jun 16, 2008

Version:
$Id$
Author:
Martin Grotzke

Constructor Summary
WadlGeneratorImpl()
           
 
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)
           
 com.sun.research.ws.wadl.RepresentationType createResponseRepresentation(AbstractResource r, AbstractResourceMethod m, MediaType mediaType)
           
 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.
 void setWadlGeneratorDelegate(WadlGenerator delegate)
          Sets the delegate that is decorated by this wadl generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WadlGeneratorImpl

public WadlGeneratorImpl()
Method Detail

getRequiredJaxbContextPath

public java.lang.String 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 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):
_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.

Specified by:
getRequiredJaxbContextPath in interface WadlGenerator
Returns:
simply the WadlGenerator.getRequiredJaxbContextPath() of the delegate or the WadlGenerator.getRequiredJaxbContextPath() + ":" + ${yourContextPath}.

init

public void init()
          throws java.lang.Exception
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 invoke this.delegate.init().

Specified by:
init in interface WadlGenerator
Throws:
java.lang.Exception

setWadlGeneratorDelegate

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

Specified by:
setWadlGeneratorDelegate in interface WadlGenerator
Parameters:
delegate - the wadl generator to decorate

createResources

public com.sun.research.ws.wadl.Resources createResources()
Specified by:
createResources in interface WadlGenerator

createApplication

public com.sun.research.ws.wadl.Application createApplication()
Specified by:
createApplication in interface WadlGenerator

createMethod

public com.sun.research.ws.wadl.Method createMethod(AbstractResource r,
                                                    AbstractResourceMethod m)
Specified by:
createMethod in interface WadlGenerator

createRequestRepresentation

public com.sun.research.ws.wadl.RepresentationType createRequestRepresentation(AbstractResource r,
                                                                               AbstractResourceMethod m,
                                                                               MediaType mediaType)
Specified by:
createRequestRepresentation in interface WadlGenerator

createRequest

public com.sun.research.ws.wadl.Request createRequest(AbstractResource r,
                                                      AbstractResourceMethod m)
Specified by:
createRequest in interface WadlGenerator

createParam

public com.sun.research.ws.wadl.Param createParam(AbstractResource r,
                                                  AbstractMethod m,
                                                  Parameter p)
Specified by:
createParam in interface WadlGenerator

createResource

public com.sun.research.ws.wadl.Resource createResource(AbstractResource r,
                                                        java.lang.String path)
Specified by:
createResource in interface WadlGenerator

createResponse

public com.sun.research.ws.wadl.Response createResponse(AbstractResource r,
                                                        AbstractResourceMethod m)
Specified by:
createResponse in interface WadlGenerator

createResponseRepresentation

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


Copyright © 2011 Oracle Corporation. All Rights Reserved.