Apache CXF API

org.apache.cxf.jaxrs.model.wadl
Class WadlGenerator

java.lang.Object
  extended by org.apache.cxf.jaxrs.model.wadl.WadlGenerator
All Implemented Interfaces:
javax.ws.rs.container.ContainerRequestFilter

public class WadlGenerator
extends Object
implements javax.ws.rs.container.ContainerRequestFilter


Nested Class Summary
protected static interface WadlGenerator.SchemaWriter
           
 
Field Summary
static String WADL_NS
           
static String WADL_QUERY
           
static javax.ws.rs.core.MediaType WADL_TYPE
           
 
Constructor Summary
WadlGenerator()
           
WadlGenerator(Bus bus)
           
 
Method Summary
 boolean addSchemaDocument(SchemaCollection col, List<String> tnsList, Document d, String systemId, boolean hackAroundEmptyNamespaceIssue)
           
protected  boolean compareOperations(OperationResourceInfo ori1, OperationResourceInfo ori2)
           
protected  ElementQNameResolver createElementQNameResolver(JAXBContext context)
           
protected  WadlGenerator.SchemaWriter createSchemaWriter(ResourceTypes resourceTypes, JAXBContext context, javax.ws.rs.core.UriInfo ui)
           
protected  void doFilter(javax.ws.rs.container.ContainerRequestContext context, Message m)
           
protected  void doHandleClassParams(OperationResourceInfo ori, StringBuilder sb, Map<Parameter,Object> params, boolean isJson, ParameterType... pType)
           
protected  void doWriteParam(OperationResourceInfo ori, StringBuilder sb, Parameter pm, Class<?> type, Type genericType, String paramName, Annotation[] anns, boolean isJson)
           
 void filter(javax.ws.rs.container.ContainerRequestContext context)
           
 StringBuilder generateWADL(String baseURI, List<ClassResourceInfo> cris, boolean isJson, Message m, javax.ws.rs.core.UriInfo ui)
           
 javax.ws.rs.core.Response getExistingResource(Message m, javax.ws.rs.core.UriInfo ui, String href)
           
 javax.ws.rs.core.Response getExistingWadl(Message m, javax.ws.rs.core.UriInfo ui, javax.ws.rs.core.MediaType mt)
           
protected  String getPath(String path)
           
 List<String> getPrivateAddresses()
           
 List<ClassResourceInfo> getResourcesList(Message m, javax.ws.rs.core.UriInfo ui)
           
protected  void handleClassJavaDocs(ClassResourceInfo cri, StringBuilder sb)
           
protected  boolean handleDocs(Annotation[] anns, StringBuilder sb, String category, boolean allowDefault, boolean isJson)
           
protected  void handleDynamicSubresource(StringBuilder sb, Set<Class<?>> jaxbTypes, ElementQNameResolver qnameResolver, Map<Class<?>,QName> clsMap, OperationResourceInfo ori, ClassResourceInfo subcri, boolean isJson)
           
protected  void handleGrammars(StringBuilder sbApp, StringBuilder sbGrammars, WadlGenerator.SchemaWriter writer, Map<Class<?>,QName> clsMap)
           
protected  boolean handleOperation(StringBuilder sb, Set<Class<?>> jaxbTypes, ElementQNameResolver qnameResolver, Map<Class<?>,QName> clsMap, OperationResourceInfo ori, Map<Parameter,Object> classParams, OperationResourceInfo nextOp, boolean resourceTagOpened, boolean isJson, int index)
           
protected  void handleOperJavaDocs(OperationResourceInfo ori, StringBuilder sb)
           
protected  void handleOperParamJavaDocs(OperationResourceInfo ori, int paramIndex, StringBuilder sb)
           
protected  void handleOperResponseJavaDocs(OperationResourceInfo ori, StringBuilder sb)
           
protected  void handleParameter(StringBuilder sb, Set<Class<?>> jaxbTypes, ElementQNameResolver qnameResolver, Map<Class<?>,QName> clsMap, OperationResourceInfo ori, Parameter pm, boolean isJson)
           
protected  void handleParams(StringBuilder sb, OperationResourceInfo ori, ParameterType type, boolean isJson)
           
protected  void handlePathAndMatrixClassParams(OperationResourceInfo ori, StringBuilder sb, Map<Parameter,Object> params, boolean isJson)
           
protected  void handlePathAndMatrixParams(StringBuilder sb, OperationResourceInfo ori, boolean isJson)
           
protected  void handleRepresentation(StringBuilder sb, Set<Class<?>> jaxbTypes, ElementQNameResolver qnameResolver, Map<Class<?>,QName> clsMap, OperationResourceInfo ori, Class<?> type, boolean isJson, boolean inbound)
           
protected  void handleResource(StringBuilder sb, Set<Class<?>> jaxbTypes, ElementQNameResolver qnameResolver, Map<Class<?>,QName> clsMap, ClassResourceInfo cri, Set<ClassResourceInfo> visitedResources, boolean isJson)
           
 void setAddResourceAndMethodIds(boolean addResourceAndMethodIds)
           
 void setApplicationTitle(String applicationTitle)
           
 void setCheckAbsolutePathSlash(boolean checkAbsolutePathSlash)
           
 void setDefaultMediaType(String mt)
           
 void setDocumentationProvider(DocumentationProvider p)
           
 void setExternalLinks(List<String> externalLinks)
           
 void setIgnoreForwardSlash(boolean ignoreForwardSlash)
           
 void setIgnoreMessageWriters(boolean ignoreMessageWriters)
           
 void setIgnoreRequests(boolean ignoreRequests)
           
 void setJavaDocPath(String path)
           
 void setLinkJsonToXmlSchema(boolean link)
           
 void setNamespacePrefix(String prefix)
           
 void setPrivateAddresses(List<String> privateAddresses)
           
 void setResolver(ElementQNameResolver resolver)
           
 void setSchemaLocations(List<String> locations)
           
 void setSingleResourceMultipleMethods(boolean singleResourceMultipleMethods)
           
 void setSupportCollections(boolean support)
           
 void setSupportJaxbSubstitutions(boolean supportJaxbSubstitutions)
           
 void setSupportJaxbXmlType(boolean supportJaxbXmlType)
           
 void setUseJaxbContextForQnames(boolean checkJaxbOnly)
           
 void setUseSingleSlashResource(boolean useSingleSlashResource)
           
 void setWadlNamespace(String namespace)
           
protected  List<OperationResourceInfo> sortOperationsByPath(Set<OperationResourceInfo> ops)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WADL_QUERY

public static final String WADL_QUERY
See Also:
Constant Field Values

WADL_TYPE

public static final javax.ws.rs.core.MediaType WADL_TYPE

WADL_NS

public static final String WADL_NS
See Also:
Constant Field Values
Constructor Detail

WadlGenerator

public WadlGenerator()

WadlGenerator

public WadlGenerator(Bus bus)
Method Detail

filter

public void filter(javax.ws.rs.container.ContainerRequestContext context)
Specified by:
filter in interface javax.ws.rs.container.ContainerRequestFilter

doFilter

protected void doFilter(javax.ws.rs.container.ContainerRequestContext context,
                        Message m)

generateWADL

public StringBuilder generateWADL(String baseURI,
                                  List<ClassResourceInfo> cris,
                                  boolean isJson,
                                  Message m,
                                  javax.ws.rs.core.UriInfo ui)

handleGrammars

protected void handleGrammars(StringBuilder sbApp,
                              StringBuilder sbGrammars,
                              WadlGenerator.SchemaWriter writer,
                              Map<Class<?>,QName> clsMap)

handleResource

protected void handleResource(StringBuilder sb,
                              Set<Class<?>> jaxbTypes,
                              ElementQNameResolver qnameResolver,
                              Map<Class<?>,QName> clsMap,
                              ClassResourceInfo cri,
                              Set<ClassResourceInfo> visitedResources,
                              boolean isJson)

getPath

protected String getPath(String path)

handleOperation

protected boolean handleOperation(StringBuilder sb,
                                  Set<Class<?>> jaxbTypes,
                                  ElementQNameResolver qnameResolver,
                                  Map<Class<?>,QName> clsMap,
                                  OperationResourceInfo ori,
                                  Map<Parameter,Object> classParams,
                                  OperationResourceInfo nextOp,
                                  boolean resourceTagOpened,
                                  boolean isJson,
                                  int index)

compareOperations

protected boolean compareOperations(OperationResourceInfo ori1,
                                    OperationResourceInfo ori2)

handleDynamicSubresource

protected void handleDynamicSubresource(StringBuilder sb,
                                        Set<Class<?>> jaxbTypes,
                                        ElementQNameResolver qnameResolver,
                                        Map<Class<?>,QName> clsMap,
                                        OperationResourceInfo ori,
                                        ClassResourceInfo subcri,
                                        boolean isJson)

handlePathAndMatrixClassParams

protected void handlePathAndMatrixClassParams(OperationResourceInfo ori,
                                              StringBuilder sb,
                                              Map<Parameter,Object> params,
                                              boolean isJson)

doHandleClassParams

protected void doHandleClassParams(OperationResourceInfo ori,
                                   StringBuilder sb,
                                   Map<Parameter,Object> params,
                                   boolean isJson,
                                   ParameterType... pType)

handlePathAndMatrixParams

protected void handlePathAndMatrixParams(StringBuilder sb,
                                         OperationResourceInfo ori,
                                         boolean isJson)

handleParameter

protected void handleParameter(StringBuilder sb,
                               Set<Class<?>> jaxbTypes,
                               ElementQNameResolver qnameResolver,
                               Map<Class<?>,QName> clsMap,
                               OperationResourceInfo ori,
                               Parameter pm,
                               boolean isJson)

handleParams

protected void handleParams(StringBuilder sb,
                            OperationResourceInfo ori,
                            ParameterType type,
                            boolean isJson)

doWriteParam

protected void doWriteParam(OperationResourceInfo ori,
                            StringBuilder sb,
                            Parameter pm,
                            Class<?> type,
                            Type genericType,
                            String paramName,
                            Annotation[] anns,
                            boolean isJson)

handleRepresentation

protected void handleRepresentation(StringBuilder sb,
                                    Set<Class<?>> jaxbTypes,
                                    ElementQNameResolver qnameResolver,
                                    Map<Class<?>,QName> clsMap,
                                    OperationResourceInfo ori,
                                    Class<?> type,
                                    boolean isJson,
                                    boolean inbound)

sortOperationsByPath

protected List<OperationResourceInfo> sortOperationsByPath(Set<OperationResourceInfo> ops)

getResourcesList

public List<ClassResourceInfo> getResourcesList(Message m,
                                                javax.ws.rs.core.UriInfo ui)

getExistingWadl

public javax.ws.rs.core.Response getExistingWadl(Message m,
                                                 javax.ws.rs.core.UriInfo ui,
                                                 javax.ws.rs.core.MediaType mt)

getExistingResource

public javax.ws.rs.core.Response getExistingResource(Message m,
                                                     javax.ws.rs.core.UriInfo ui,
                                                     String href)

addSchemaDocument

public boolean addSchemaDocument(SchemaCollection col,
                                 List<String> tnsList,
                                 Document d,
                                 String systemId,
                                 boolean hackAroundEmptyNamespaceIssue)

setIgnoreMessageWriters

public void setIgnoreMessageWriters(boolean ignoreMessageWriters)

handleClassJavaDocs

protected void handleClassJavaDocs(ClassResourceInfo cri,
                                   StringBuilder sb)

handleOperJavaDocs

protected void handleOperJavaDocs(OperationResourceInfo ori,
                                  StringBuilder sb)

handleOperResponseJavaDocs

protected void handleOperResponseJavaDocs(OperationResourceInfo ori,
                                          StringBuilder sb)

handleOperParamJavaDocs

protected void handleOperParamJavaDocs(OperationResourceInfo ori,
                                       int paramIndex,
                                       StringBuilder sb)

handleDocs

protected boolean handleDocs(Annotation[] anns,
                             StringBuilder sb,
                             String category,
                             boolean allowDefault,
                             boolean isJson)

setWadlNamespace

public void setWadlNamespace(String namespace)

setSingleResourceMultipleMethods

public void setSingleResourceMultipleMethods(boolean singleResourceMultipleMethods)

setUseSingleSlashResource

public void setUseSingleSlashResource(boolean useSingleSlashResource)

setLinkJsonToXmlSchema

public void setLinkJsonToXmlSchema(boolean link)

setSchemaLocations

public void setSchemaLocations(List<String> locations)

setUseJaxbContextForQnames

public void setUseJaxbContextForQnames(boolean checkJaxbOnly)

createElementQNameResolver

protected ElementQNameResolver createElementQNameResolver(JAXBContext context)

createSchemaWriter

protected WadlGenerator.SchemaWriter createSchemaWriter(ResourceTypes resourceTypes,
                                                        JAXBContext context,
                                                        javax.ws.rs.core.UriInfo ui)

setExternalLinks

public void setExternalLinks(List<String> externalLinks)

setResolver

public void setResolver(ElementQNameResolver resolver)

setPrivateAddresses

public void setPrivateAddresses(List<String> privateAddresses)

getPrivateAddresses

public List<String> getPrivateAddresses()

setAddResourceAndMethodIds

public void setAddResourceAndMethodIds(boolean addResourceAndMethodIds)

setApplicationTitle

public void setApplicationTitle(String applicationTitle)

setNamespacePrefix

public void setNamespacePrefix(String prefix)

setIgnoreForwardSlash

public void setIgnoreForwardSlash(boolean ignoreForwardSlash)

setIgnoreRequests

public void setIgnoreRequests(boolean ignoreRequests)

setSupportCollections

public void setSupportCollections(boolean support)

setDefaultMediaType

public void setDefaultMediaType(String mt)

setSupportJaxbXmlType

public void setSupportJaxbXmlType(boolean supportJaxbXmlType)

setSupportJaxbSubstitutions

public void setSupportJaxbSubstitutions(boolean supportJaxbSubstitutions)

setCheckAbsolutePathSlash

public void setCheckAbsolutePathSlash(boolean checkAbsolutePathSlash)

setJavaDocPath

public void setJavaDocPath(String path)
                    throws Exception
Throws:
Exception

setDocumentationProvider

public void setDocumentationProvider(DocumentationProvider p)

Apache CXF API

Apache CXF