org.jmythapi.javadoc.utils
Class JavadocUtils

java.lang.Object
  extended by org.jmythapi.javadoc.utils.JavadocUtils

public class JavadocUtils
extends Object

Javadoc related utils.


Field Summary
static String GIT_COMMIT_URL
          The link prefix to a GIT commit.
static String MYTHTV_WIKI_URL
          The link prefix to the release notes of a MythTV version.
 
Constructor Summary
JavadocUtils()
           
 
Method Summary
static com.sun.javadoc.AnnotationDesc findProtocolVersionAnnotation(com.sun.javadoc.Doc doc)
          Returns the documentation of the MythProtoVersionAnnotation a method or enumeration is annotated with.
static com.sun.javadoc.AnnotationDesc findProtocolVersionAnnotation(com.sun.javadoc.Tag tag)
          Returns the documentation of the MythProtoVersionAnnotation a method or enumeration is annotated with.
static com.sun.javadoc.ClassDoc getEnumDataType(com.sun.javadoc.FieldDoc enumDoc)
           
static String getLinkPrefix(com.sun.javadoc.Tag tag, String className)
          Gets the relative link to the given class.
static com.sun.javadoc.PackageDoc getPackageDoc(com.sun.javadoc.Tag tag)
          Gets the doc object of the containing package of the given tag.
static String getProtocolVersionInfoTitle(int version)
          Gets a nice info-text that can be used as titles in links to a specific protocol version.
static String getProtocolVersionInfoTitle(ProtocolVersion version)
          Gets a nice info-text that can be used as titles in links to a specific protocol version.
static String getProtocolVersionLink(com.sun.javadoc.Tag tag, int protoVersion)
          Gets the relative link to a specific protocol-version.
static String getProtocolVersionLink(com.sun.javadoc.Tag tag, ProtocolVersion version)
          Gets the relative link to a specific ProtocolVersion.
static String getProtocolVersionLinkPrefix(com.sun.javadoc.Tag tag)
          Gets the relative link to the ProtocolVersion enumeration.
static String getProtocolVersionMetadata(ProtocolVersion version, String metaDataKey)
          Gets the metadata info about the given protocol version.
static ProtocolVersionRange getProtocolVersionRange(com.sun.javadoc.AnnotationDesc annotation)
          Gets the protocol range of a javadoc annotation description.
static ProtocolVersionRange getProtocolVersionRange(com.sun.javadoc.Doc doc, boolean returnDefaultIfNull)
          Gets the protocol range of the given javadoc element.
static ProtocolVersionRange getProtocolVersionRange(com.sun.javadoc.Tag tag, boolean returnDefaultIfNull)
          Gets the protocol range a method or enumeration is annotated with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GIT_COMMIT_URL

public static final String GIT_COMMIT_URL
The link prefix to a GIT commit.

See Also:
Constant Field Values

MYTHTV_WIKI_URL

public static final String MYTHTV_WIKI_URL
The link prefix to the release notes of a MythTV version.

See Also:
Constant Field Values
Constructor Detail

JavadocUtils

public JavadocUtils()
Method Detail

getProtocolVersionInfoTitle

public static String getProtocolVersionInfoTitle(int version)
Gets a nice info-text that can be used as titles in links to a specific protocol version.

E.g. Protocol Version 18 (2005-07-19)

Parameters:
version - the protocol version
Returns:
the info text

getProtocolVersionInfoTitle

public static String getProtocolVersionInfoTitle(ProtocolVersion version)
Gets a nice info-text that can be used as titles in links to a specific protocol version.

E.g. Protocol Version 18 (2005-07-19)

Parameters:
version - the protocol version
Returns:
the info text

getProtocolVersionMetadata

public static String getProtocolVersionMetadata(ProtocolVersion version,
                                                String metaDataKey)
Gets the metadata info about the given protocol version.

Parameters:
version - the protocol version
metaDataKey - the name of the requested metadata
Returns:
the value of the metadata or null

getProtocolVersionLink

public static String getProtocolVersionLink(com.sun.javadoc.Tag tag,
                                            int protoVersion)
Gets the relative link to a specific protocol-version.

Parameters:
tag - the current tag. This is required to determine the path to the protocol version.
protoVersion - the given protocol version
Returns:
the relative link to the given protocol version

getProtocolVersionLink

public static String getProtocolVersionLink(com.sun.javadoc.Tag tag,
                                            ProtocolVersion version)
Gets the relative link to a specific ProtocolVersion.

Parameters:
tag - the current tag. This is required to determine the path to the protocol version.
version - the given protocol version
Returns:
the relative link to the given protocol version, e.g. ../../../org/jmythapi/protocol/ProtocolVersion.html#PROTO_VERSION_09

getProtocolVersionLinkPrefix

public static String getProtocolVersionLinkPrefix(com.sun.javadoc.Tag tag)
Gets the relative link to the ProtocolVersion enumeration.

This is used to link to a given protocol version.

Parameters:
tag - the current tag. This is required to determine the path to the protocol version.
Returns:
a relative link to the protocol-version enum.

getLinkPrefix

public static String getLinkPrefix(com.sun.javadoc.Tag tag,
                                   String className)
Gets the relative link to the given class.

This is used to link to a class or constant.

Parameters:
tag - the current tag. This is required to determine the path to the class.
className - the class to link to
Returns:
a relative link to the given class

getPackageDoc

public static com.sun.javadoc.PackageDoc getPackageDoc(com.sun.javadoc.Tag tag)
Gets the doc object of the containing package of the given tag.

Parameters:
tag - the tag
Returns:
the containing package of the tag

getProtocolVersionRange

public static ProtocolVersionRange getProtocolVersionRange(com.sun.javadoc.Tag tag,
                                                           boolean returnDefaultIfNull)
Gets the protocol range a method or enumeration is annotated with.

If no protocol-version-range annotation is found, null is returned.

Parameters:
tag - the current tag
returnDefaultIfNull - TODO
Returns:
the protocol version range or null.

getProtocolVersionRange

public static ProtocolVersionRange getProtocolVersionRange(com.sun.javadoc.Doc doc,
                                                           boolean returnDefaultIfNull)
Gets the protocol range of the given javadoc element.

If no protocol-version-range annotation is found, null is returned.

Parameters:
doc - the javadoc documentation
returnDefaultIfNull - if true and no version-range is found, ProtocolVersionRange.DEFAULT_RANGE is returned.
Returns:
the protocol version range or null.

getProtocolVersionRange

public static ProtocolVersionRange getProtocolVersionRange(com.sun.javadoc.AnnotationDesc annotation)
Gets the protocol range of a javadoc annotation description.

If no protocol-version-range annotation is found, null is returned.

Parameters:
annotation - the javadoc of the annotation
Returns:
the protocol version range or null.

findProtocolVersionAnnotation

public static com.sun.javadoc.AnnotationDesc findProtocolVersionAnnotation(com.sun.javadoc.Tag tag)
Returns the documentation of the MythProtoVersionAnnotation a method or enumeration is annotated with.

Parameters:
tag - the current tag
Returns:
the found documentation or null

findProtocolVersionAnnotation

public static com.sun.javadoc.AnnotationDesc findProtocolVersionAnnotation(com.sun.javadoc.Doc doc)
Returns the documentation of the MythProtoVersionAnnotation a method or enumeration is annotated with.

Parameters:
doc - the javadoc of the element
Returns:
the found documentation or null

getEnumDataType

public static com.sun.javadoc.ClassDoc getEnumDataType(com.sun.javadoc.FieldDoc enumDoc)


Copyright © 2008-2013. All Rights Reserved.