de.kruis.padoclet
Class PublishedApiDoclet.DocHandler

java.lang.Object
  extended by de.kruis.padoclet.util.HalfDynamicProxy
      extended by de.kruis.padoclet.FilterDocletBase.HandlerBase
          extended by de.kruis.padoclet.FilterDocletBase.ComparableHandler
              extended by de.kruis.padoclet.PublishedApiDoclet.DocHandler
All Implemented Interfaces:
InvocationHandlerWithTarget, java.lang.reflect.InvocationHandler
Direct Known Subclasses:
PublishedApiDoclet.ClassDocHandler, PublishedApiDoclet.MethodDocHandler, PublishedApiDoclet.PackageDocHandler, PublishedApiDoclet.RootDocHandler
Enclosing class:
PublishedApiDoclet

public static class PublishedApiDoclet.DocHandler
extends FilterDocletBase.ComparableHandler

Proxy methods and state common to all Doc instances.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.kruis.padoclet.util.HalfDynamicProxy
HalfDynamicProxy.MessageInterface
 
Field Summary
private  int childInclusionPriority
          Cached inclusion priority for childs of this node.
private static java.util.regex.Pattern digits
          A constant used by tagPriority(Doc, String, Pattern).
private  int inclusionPriority
          Cached inclusion priority for this node.
private  boolean inclusionPriorityValid
          Indicates, if inclusionPriority and childInclusionPriority is valid.
private  boolean isCheckStarted
          Flag, that is used to avoid infinite recursion.
private  boolean isIncluded
          The value of this field is only valid, if isIncludedValid is true.
private  boolean isIncludedValid
          if true, the inclusion state is known and isIncluded is valid
 
Fields inherited from class de.kruis.padoclet.util.HalfDynamicProxy
target
 
Constructor Summary
PublishedApiDoclet.DocHandler()
          Create a new instance.
 
Method Summary
private  int calcInclusionPriority(boolean iscallFromChild)
          Check, if this item shall be included.
protected  void debug(java.lang.String message)
          print a debug message.
protected  com.sun.javadoc.Doc[] filterDocArray(com.sun.javadoc.Doc[] array, java.lang.Class<? extends com.sun.javadoc.Doc[]> expect, boolean doFilter)
          Filter the content of a com.sun.javadoc.Doc-array, in order to remove entries not to be documented.
protected  boolean isFilter(boolean filter)
          Determinate, if a com.sun.javadoc.Doc array shall be filtered.
 boolean isIncluded()
          Get the value of the boolean included property of the Doc object, that is represented by this dynamic proxy instance.
private static int tagPriority(com.sun.javadoc.Doc doc, java.lang.String tag, java.util.regex.Pattern filter)
          Get the priority from a tag.
 
Methods inherited from class de.kruis.padoclet.FilterDocletBase.ComparableHandler
compareTo
 
Methods inherited from class de.kruis.padoclet.util.HalfDynamicProxy
dynamicProxyInstance, equals, getHDPProxy, getHDPProxy, getHDPStateUserObject, getInvocationTarget, getProxyClassTable, hashCode, invoke, setProxyClassTable, setupInvocationHandler, stateFactory, toString, unwrap
 

Field Detail

isIncluded

private boolean isIncluded
The value of this field is only valid, if isIncludedValid is true. Then this field determinates, if the Doc instance is included.


isIncludedValid

private boolean isIncludedValid
if true, the inclusion state is known and isIncluded is valid


isCheckStarted

private boolean isCheckStarted
Flag, that is used to avoid infinite recursion. May be obsolete.


inclusionPriority

private int inclusionPriority
Cached inclusion priority for this node. Only valid, if inclusionPriorityValid is true.


childInclusionPriority

private int childInclusionPriority
Cached inclusion priority for childs of this node. Only valid, if inclusionPriorityValid is true.


inclusionPriorityValid

private boolean inclusionPriorityValid
Indicates, if inclusionPriority and childInclusionPriority is valid.


digits

private static final java.util.regex.Pattern digits
A constant used by tagPriority(Doc, String, Pattern).

Constructor Detail

PublishedApiDoclet.DocHandler

public PublishedApiDoclet.DocHandler()
Create a new instance.

Method Detail

isIncluded

public boolean isIncluded()
Get the value of the boolean included property of the Doc object, that is represented by this dynamic proxy instance. This method is overridden by PublishedApiDoclet. It is the switch used to turn documentation on or off.

Returns:
return true, if this node (package, class, method, field) shall be included in the documentation.
See Also:
Doc.isIncluded()

tagPriority

private static int tagPriority(com.sun.javadoc.Doc doc,
                               java.lang.String tag,
                               java.util.regex.Pattern filter)
Get the priority from a tag. If the doc-node does not contain a matching tag, the result is 0. Otherwise the result is at least 1. If one or more matched portions of the tag end with a decimal number the maximum of these numbers is returned.

Parameters:
doc - the document node (package, class, method, field, ...)
tag - the name of the tag
filter - a filter pattern. Only tags, that match this pattern are looked at.
Returns:
the priority asiciated with the tag: a non negative integer. 0 is the minimum priority.

calcInclusionPriority

private int calcInclusionPriority(boolean iscallFromChild)
Check, if this item shall be included. This method checks this item and its parents, but not the childs.

Parameters:
iscallFromChild - if true return the inclusion priority for a child item, otherwise return the inclusion priority for this item.
Returns:
an include (return value is positive) or exclude (return value is negative) priority.

filterDocArray

protected com.sun.javadoc.Doc[] filterDocArray(com.sun.javadoc.Doc[] array,
                                               java.lang.Class<? extends com.sun.javadoc.Doc[]> expect,
                                               boolean doFilter)
Filter the content of a com.sun.javadoc.Doc-array, in order to remove entries not to be documented. This method removes the entries from an array of Doc-items, that were not to be documented.

Parameters:
array - the array of doc items.
expect - the class of the concrete array type, i.e. com.sun.javadoc.PackageDoc[].class, if array contains PackageDoc items.
doFilter - if false, simply return a HD-proxy for array.
Returns:
a Doc[], containing HD-Proxies for the possibly filtered entries of the given array.

isFilter

protected boolean isFilter(boolean filter)
Determinate, if a com.sun.javadoc.Doc array shall be filtered.

Parameters:
filter - if false, do not filter.
Returns:
returns false, if either the filter parameter is false or if the filter is globally disabled.

debug

protected void debug(java.lang.String message)
Description copied from class: FilterDocletBase.HandlerBase
print a debug message.

Overrides:
debug in class FilterDocletBase.HandlerBase