org.jvnet.ws.wadl2java
Class JavaDocUtil

java.lang.Object
  extended by org.jvnet.ws.wadl2java.JavaDocUtil

public class JavaDocUtil
extends Object

Utility class containing methods for generating JavaDoc from XML documentation embedded in WADL files.

Author:
mh124079

Constructor Summary
JavaDocUtil()
          Create a new JavaDocUtil instance
 
Method Summary
protected  void appendTextContent(Doc d, com.sun.codemodel.JCommentPart jdoc)
          Append text extracted from a WADL doc element to the JavaDoc code model.
protected  void copyElementContent(Element source, Element sink)
          Copy attributes and content of one element to another.
protected  String createTaggedJavaDoc(Element e)
          Create tagged Javadoc from an XML element.
 void generateAccessorDoc(ResourceNode r, com.sun.codemodel.JMethod c)
          Extract documentation from a WADL resource and add it to a corresponding accessor method.
 void generateClassDoc(ResourceNode r, com.sun.codemodel.JDefinedClass c)
          Extract documentation from a WADL resource and add it to a corresponding generated class.
 void generateEnumDoc(Param p, com.sun.codemodel.JDefinedClass e)
          Extract documentation from a WADL param with enumerated values and add it to the corresponding Java enum.
 void generateMethodDoc(MethodNode m, com.sun.codemodel.JMethod jm)
          Extract documentation from a WADL method and add it to the corresponding generated Java method.
 void generateParamDoc(Param p, com.sun.codemodel.JMethod jm)
          Extract documentation from a WADL param and add it to the corresponding Java method.
 void generateParamDoc(RepresentationNode r, com.sun.codemodel.JMethod jm)
          Extract documentation from a WADL representation and add it to the corresponding Java method parameter.
 void generateReturnDoc(Param p, com.sun.codemodel.JMethod jm)
          Extract documentation from a WADL param and add it to the corresponding Java method return.
 void generateReturnDoc(RepresentationNode r, com.sun.codemodel.JMethod jm)
          Extract documentation from a WADL representation and add it to the corresponding Java method return.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaDocUtil

public JavaDocUtil()
Create a new JavaDocUtil instance

Method Detail

copyElementContent

protected void copyElementContent(Element source,
                                  Element sink)
Copy attributes and content of one element to another. Namespace decls are stripped rendering all elements and attributes in the default namespace.

Parameters:
source - the element to copy from.
sink - the element to copy to.

createTaggedJavaDoc

protected String createTaggedJavaDoc(Element e)
Create tagged Javadoc from an XML element. XML namespace declarations, comments and processing instructions are stripped.

Parameters:
e - the XML element.
Returns:
the extracted tagged javadoc.

appendTextContent

protected void appendTextContent(Doc d,
                                 com.sun.codemodel.JCommentPart jdoc)
Append text extracted from a WADL doc element to the JavaDoc code model.

Parameters:
d - the WADL doc element.
jdoc - the code model element to which the content shoudl be appended.

generateClassDoc

public void generateClassDoc(ResourceNode r,
                             com.sun.codemodel.JDefinedClass c)
Extract documentation from a WADL resource and add it to a corresponding generated class.

Parameters:
r - the WADL resource.
c - the corresponding class.

generateAccessorDoc

public void generateAccessorDoc(ResourceNode r,
                                com.sun.codemodel.JMethod c)
Extract documentation from a WADL resource and add it to a corresponding accessor method.

Parameters:
r - the WADL resource.
c - the corresponding class.

generateMethodDoc

public void generateMethodDoc(MethodNode m,
                              com.sun.codemodel.JMethod jm)
Extract documentation from a WADL method and add it to the corresponding generated Java method.

Parameters:
m - the WADL method.
jm - the corresponding Java method.

generateEnumDoc

public void generateEnumDoc(Param p,
                            com.sun.codemodel.JDefinedClass e)
Extract documentation from a WADL param with enumerated values and add it to the corresponding Java enum.

Parameters:
p - the WADL param.
e - the corresponding enum.

generateParamDoc

public void generateParamDoc(Param p,
                             com.sun.codemodel.JMethod jm)
Extract documentation from a WADL param and add it to the corresponding Java method.

Parameters:
p - the WADL param.
jm - the corresponding method.

generateParamDoc

public void generateParamDoc(RepresentationNode r,
                             com.sun.codemodel.JMethod jm)
Extract documentation from a WADL representation and add it to the corresponding Java method parameter.

Parameters:
r - the WADL representation.
jm - the corresponding Java method.

generateReturnDoc

public void generateReturnDoc(Param p,
                              com.sun.codemodel.JMethod jm)
Extract documentation from a WADL param and add it to the corresponding Java method return.

Parameters:
p - the parameter to extract documentation from.
jm - the corresponding Java method.

generateReturnDoc

public void generateReturnDoc(RepresentationNode r,
                              com.sun.codemodel.JMethod jm)
Extract documentation from a WADL representation and add it to the corresponding Java method return.

Parameters:
r - the WADL representation
jm - the corresponding Java method


Copyright © 2012. All Rights Reserved.