org.infinispan.tools.doclet.config
Class AbstractConfigHtmlGenerator

java.lang.Object
  extended by org.infinispan.tools.doclet.html.HtmlGenerator
      extended by org.infinispan.tools.doclet.config.AbstractConfigHtmlGenerator
Direct Known Subclasses:
ConfigHtmlGenerator

public abstract class AbstractConfigHtmlGenerator
extends HtmlGenerator


Field Summary
protected static String CONFIG_REF
           
protected static String CONFIG_REF_DESC_ATT
           
protected static String CONFIG_REF_NAME_ATT
           
protected static String CONFIG_REF_PARENT_NAME_ATT
           
protected  com.sun.javadoc.RootDoc rootDoc
           
protected  StringBuilder sb
           
 
Constructor Summary
AbstractConfigHtmlGenerator(String encoding, String title, String bottom, String footer, String header, String metaDescription, List<String> metaKeywords)
           
 
Method Summary
protected  String generateContents()
           
protected  InputStream getAsInputStreamFromClassLoader(String filename)
           
protected abstract  List<Class<?>> getConfigBeans()
          Returns a list of classes inspected for configuration reference javadoc tags.
 com.sun.javadoc.RootDoc getRootDoc()
           
protected abstract  String getRootElementName()
          Name of the root element in the schema
protected abstract  String getSchemaFile()
          Returns name of the schema file.
protected  StringBuilder getStringBuilder()
           
protected  String getTitle()
           
 InputStream lookupFile(String filename)
           
 Map<String,String> parseTag(String tag)
           
protected  boolean postVisitNode(TreeNode n)
          Callback invoked after visiting the specified node n.
protected  void postXMLTableOfContentsCreate(XSOMSchemaTreeWalker w, XMLTreeOutputWalker tw)
          Invoked after creation of XML tree table of contents for configuration elements in schema
protected  boolean preVisitNode(TreeNode n)
          Callback invoked prior to visiting the specified node n.
protected  void preXMLTableOfContentsCreate(XSOMSchemaTreeWalker sw, XMLTreeOutputWalker tw)
          Invoked prior to creation of XML tree table of contents for configuration elements in schema
 void setRootDoc(com.sun.javadoc.RootDoc rootDoc)
           
 
Methods inherited from class org.infinispan.tools.doclet.html.HtmlGenerator
generateHtml, generateHtml, isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_REF

protected static final String CONFIG_REF
See Also:
Constant Field Values

CONFIG_REF_NAME_ATT

protected static final String CONFIG_REF_NAME_ATT
See Also:
Constant Field Values

CONFIG_REF_PARENT_NAME_ATT

protected static final String CONFIG_REF_PARENT_NAME_ATT
See Also:
Constant Field Values

CONFIG_REF_DESC_ATT

protected static final String CONFIG_REF_DESC_ATT
See Also:
Constant Field Values

rootDoc

protected com.sun.javadoc.RootDoc rootDoc

sb

protected StringBuilder sb
Constructor Detail

AbstractConfigHtmlGenerator

public AbstractConfigHtmlGenerator(String encoding,
                                   String title,
                                   String bottom,
                                   String footer,
                                   String header,
                                   String metaDescription,
                                   List<String> metaKeywords)
Method Detail

getConfigBeans

protected abstract List<Class<?>> getConfigBeans()
                                          throws Exception
Returns a list of classes inspected for configuration reference javadoc tags. Configuration reference tags are specified at class level and field level using @configRef javadoc tag.

Configuration class hierarchy should match configuration XML schema where each configuration class matches to one Java class and each property of XML element matches to a field of a class. On a class level @configRef javadoc tag should be placed on a class definition that matches the target XML element. On a field level @configRef javadoc tag should be placed on a field (anywhere in class hiearchy) that matches XML property.

@configRef has two key value property pairs: name and desc. Name specifies the name of the matching XML element in cases when @configRef decorates a class. If @configRef decorates a Java field then name attribute should match XML attribute.

Note that name property is optional in cases when @configRef decorates a Java field while it is mandatory in cases when @configRef decorates a configuration class.

Returns:
a list of configuration classes decorated with @configRef Javadoc tags.
Throws:
Exception

getSchemaFile

protected abstract String getSchemaFile()
Returns name of the schema file.

Note that schema file should be placed on a classpath.

Returns:
name of the schema file located on the classpath.

getRootElementName

protected abstract String getRootElementName()
Name of the root element in the schema

Returns:
name of the root element in the schema

preXMLTableOfContentsCreate

protected void preXMLTableOfContentsCreate(XSOMSchemaTreeWalker sw,
                                           XMLTreeOutputWalker tw)
Invoked prior to creation of XML tree table of contents for configuration elements in schema

Parameters:
sw -
tw -

postXMLTableOfContentsCreate

protected void postXMLTableOfContentsCreate(XSOMSchemaTreeWalker w,
                                            XMLTreeOutputWalker tw)
Invoked after creation of XML tree table of contents for configuration elements in schema

Parameters:
sw -
tw -

preVisitNode

protected boolean preVisitNode(TreeNode n)
Callback invoked prior to visiting the specified node n.

Parameters:
n -
Returns:
true if the TreeNode n should be skipped for configuration reference creation, false otherwise

postVisitNode

protected boolean postVisitNode(TreeNode n)
Callback invoked after visiting the specified node n.

Parameters:
n -
Returns:
true if no more elements should be included in configuration reference creation, false otherwise

getTitle

protected String getTitle()

getRootDoc

public com.sun.javadoc.RootDoc getRootDoc()

setRootDoc

public void setRootDoc(com.sun.javadoc.RootDoc rootDoc)

lookupFile

public InputStream lookupFile(String filename)

getAsInputStreamFromClassLoader

protected InputStream getAsInputStreamFromClassLoader(String filename)

getStringBuilder

protected StringBuilder getStringBuilder()

generateContents

protected String generateContents()
Specified by:
generateContents in class HtmlGenerator

parseTag

public Map<String,String> parseTag(String tag)

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.