Class DocImpl

  • All Implemented Interfaces:
    Doc, java.lang.Comparable<java.lang.Object>
    Direct Known Subclasses:
    PackageDocImpl, ProgramElementDocImpl, RootDocImpl

    @Deprecated
    public abstract class DocImpl
    extends java.lang.Object
    implements Doc, java.lang.Comparable<java.lang.Object>
    Deprecated.
    abstract base class of all Doc classes. Doc item's are representations of java language constructs (class, package, method,...) which have comments and have been processed by this run of javadoc. All Doc items are unique, that is, they are == comparable.

    This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

    Since:
    1.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.text.CollationKey collationkey
      Deprecated.
      The cached sort key, to take care of Natural Language Text sorting.
      private Comment comment
      Deprecated.
      The complex comment object, lazily initialized.
      protected java.lang.String documentation
      Deprecated.
      Raw documentation string.
      protected DocEnv env
      Deprecated.
      Doc environment
      private Tag[] firstSentence
      Deprecated.
      Cached first sentence.
      private Tag[] inlineTags
      Deprecated.
      Cached inline tags.
      protected com.sun.source.util.TreePath treePath
      Deprecated.
      Back pointer to the tree node for this doc item.
    • Constructor Summary

      Constructors 
      Constructor Description
      DocImpl​(DocEnv env, com.sun.source.util.TreePath treePath)
      Deprecated.
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      (package private) Comment comment()
      Deprecated.
      For lazy initialization of comment.
      java.lang.String commentText()
      Deprecated.
      Return the text of the comment for this doc item.
      int compareTo​(java.lang.Object obj)
      Deprecated.
      Compares this Object with the specified Object for order.
      protected java.lang.String documentation()
      Deprecated.
      So subclasses have the option to do lazy initialization of "documentation" string.
      Tag[] firstSentenceTags()
      Deprecated.
      Return the first sentence of the comment as an array of tags.
      (package private) java.text.CollationKey generateKey()
      Deprecated.
      Generate a key for sorting.
      private static java.lang.String getCommentText​(com.sun.source.util.TreePath p)
      Deprecated.
       
      java.lang.String getRawCommentText()
      Deprecated.
      Return the full unprocessed text of the comment.
      Tag[] inlineTags()
      Deprecated.
      Return comment as an array of tags.
      boolean isAnnotationType()
      Deprecated.
      Is this Doc item an annotation type? False until overridden.
      boolean isAnnotationTypeElement()
      Deprecated.
      Is this Doc item an annotation type element? False until overridden.
      boolean isClass()
      Deprecated.
      Is this Doc item a class (and not an interface or annotation type)? This includes ordinary classes, enums, errors and exceptions.
      boolean isConstructor()
      Deprecated.
      Is this Doc item a constructor? False until overridden.
      boolean isEnum()
      Deprecated.
      Is this Doc item an enum type? False until overridden.
      boolean isEnumConstant()
      Deprecated.
      Is this Doc item an enum constant? False until overridden.
      boolean isError()
      Deprecated.
      Is this Doc item a error class? False until overridden.
      boolean isException()
      Deprecated.
      Is this Doc item a exception class? False until overridden.
      boolean isField()
      Deprecated.
      Is this Doc item a field? False until overridden.
      abstract boolean isIncluded()
      Deprecated.
      return true if this Doc is include in the active set.
      boolean isInterface()
      Deprecated.
      Is this Doc item a interface (but not an annotation type)? False until overridden.
      boolean isMethod()
      Deprecated.
      Is this Doc item a method (but not a constructor or annotation type element)? False until overridden.
      boolean isOrdinaryClass()
      Deprecated.
      Is this Doc item an ordinary class (i.e.
      (package private) java.text.CollationKey key()
      Deprecated.
      return a key for sorting.
      abstract java.lang.String name()
      Deprecated.
      Returns the name of this Doc item.
      SourcePosition position()
      Deprecated.
      Return the source position of the entity, or null if no position is available.
      abstract java.lang.String qualifiedName()
      Deprecated.
      Returns the qualified name of this Doc item.
      (package private) java.lang.String readHTMLDocumentation​(java.io.InputStream input, javax.tools.FileObject filename)
      Deprecated.
      Utility for subclasses which read HTML documentation files.
      SeeTag[] seeTags()
      Deprecated.
      Return the see also tags in this Doc item.
      void setRawCommentText​(java.lang.String rawDocumentation)
      Deprecated.
      Set the full unprocessed text of the comment.
      (package private) void setTreePath​(com.sun.source.util.TreePath treePath)
      Deprecated.
      Set the full unprocessed text of the comment and tree path.
      Tag[] tags()
      Deprecated.
      Return all tags in this Doc item.
      Tag[] tags​(java.lang.String tagname)
      Deprecated.
      Return tags of the specified kind in this Doc item.
      java.lang.String toString()
      Deprecated.
      Returns a string representation of this Doc item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • env

        protected final DocEnv env
        Deprecated.
        Doc environment
      • treePath

        protected com.sun.source.util.TreePath treePath
        Deprecated.
        Back pointer to the tree node for this doc item. May be null if there is no associated tree.
      • comment

        private Comment comment
        Deprecated.
        The complex comment object, lazily initialized.
      • collationkey

        private java.text.CollationKey collationkey
        Deprecated.
        The cached sort key, to take care of Natural Language Text sorting.
      • documentation

        protected java.lang.String documentation
        Deprecated.
        Raw documentation string.
      • firstSentence

        private Tag[] firstSentence
        Deprecated.
        Cached first sentence.
      • inlineTags

        private Tag[] inlineTags
        Deprecated.
        Cached inline tags.
    • Constructor Detail

      • DocImpl

        DocImpl​(DocEnv env,
                com.sun.source.util.TreePath treePath)
        Deprecated.
        Constructor.
    • Method Detail

      • getCommentText

        private static java.lang.String getCommentText​(com.sun.source.util.TreePath p)
        Deprecated.
      • documentation

        protected java.lang.String documentation()
        Deprecated.
        So subclasses have the option to do lazy initialization of "documentation" string.
      • comment

        Comment comment()
        Deprecated.
        For lazy initialization of comment.
      • commentText

        public java.lang.String commentText()
        Deprecated.
        Return the text of the comment for this doc item. TagImpls have been removed.
        Specified by:
        commentText in interface Doc
        Returns:
        the text of the comment for this doc item.
      • tags

        public Tag[] tags()
        Deprecated.
        Return all tags in this Doc item.
        Specified by:
        tags in interface Doc
        Returns:
        an array of TagImpl containing all tags on this Doc item.
      • tags

        public Tag[] tags​(java.lang.String tagname)
        Deprecated.
        Return tags of the specified kind in this Doc item.
        Specified by:
        tags in interface Doc
        Parameters:
        tagname - name of the tag kind to search for.
        Returns:
        an array of TagImpl containing all tags whose 'kind()' matches 'tagname'.
      • seeTags

        public SeeTag[] seeTags()
        Deprecated.
        Return the see also tags in this Doc item.
        Specified by:
        seeTags in interface Doc
        Returns:
        an array of SeeTag containing all @see tags.
      • inlineTags

        public Tag[] inlineTags()
        Deprecated.
        Description copied from interface: Doc
        Return comment as an array of tags. Includes inline tags (i.e. {@link reference} tags) but not block tags. Each section of plain text is represented as a Tag of kind "Text". Inline tags are represented as a SeeTag of kind "@see" and name "@link".
        Specified by:
        inlineTags in interface Doc
        Returns:
        an array of Tags representing the comment
      • firstSentenceTags

        public Tag[] firstSentenceTags()
        Deprecated.
        Description copied from interface: Doc
        Return the first sentence of the comment as an array of tags. Includes inline tags (i.e. {@link reference} tags) but not block tags. Each section of plain text is represented as a Tag of kind "Text". Inline tags are represented as a SeeTag of kind "@see" and name "@link".

        If the locale is English language, the first sentence is determined by the rules described in the Java Language Specification (first version): "This sentence ends at the first period that is followed by a blank, tab, or line terminator or at the first tagline.", in addition a line will be terminated by block HTML tags: <p> </p> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <pre> or </pre>. If the locale is not English, the sentence end will be determined by BreakIterator.getSentenceInstance(Locale).

        Specified by:
        firstSentenceTags in interface Doc
        Returns:
        an array of Tags representing the first sentence of the comment
      • readHTMLDocumentation

        java.lang.String readHTMLDocumentation​(java.io.InputStream input,
                                               javax.tools.FileObject filename)
                                        throws java.io.IOException
        Deprecated.
        Utility for subclasses which read HTML documentation files.
        Throws:
        java.io.IOException
      • getRawCommentText

        public java.lang.String getRawCommentText()
        Deprecated.
        Return the full unprocessed text of the comment. Tags are included as text. Used mainly for store and retrieve operations like internalization.
        Specified by:
        getRawCommentText in interface Doc
        Returns:
        the full unprocessed text of the comment.
      • setRawCommentText

        public void setRawCommentText​(java.lang.String rawDocumentation)
        Deprecated.
        Set the full unprocessed text of the comment. Tags are included as text. Used mainly for store and retrieve operations like internalization.
        Specified by:
        setRawCommentText in interface Doc
        Parameters:
        rawDocumentation - A String containing the full unprocessed text of the comment.
      • setTreePath

        void setTreePath​(com.sun.source.util.TreePath treePath)
        Deprecated.
        Set the full unprocessed text of the comment and tree path.
      • key

        java.text.CollationKey key()
        Deprecated.
        return a key for sorting.
      • generateKey

        java.text.CollationKey generateKey()
        Deprecated.
        Generate a key for sorting.

        Default is name().

      • toString

        public java.lang.String toString()
        Deprecated.
        Returns a string representation of this Doc item.
        Overrides:
        toString in class java.lang.Object
      • name

        public abstract java.lang.String name()
        Deprecated.
        Returns the name of this Doc item.
        Specified by:
        name in interface Doc
        Returns:
        the name
      • qualifiedName

        public abstract java.lang.String qualifiedName()
        Deprecated.
        Returns the qualified name of this Doc item.
        Returns:
        the name
      • compareTo

        public int compareTo​(java.lang.Object obj)
        Deprecated.
        Compares this Object with the specified Object for order. Returns a negative integer, zero, or a positive integer as this Object is less than, equal to, or greater than the given Object.

        Included so that Doc item are java.lang.Comparable.

        Specified by:
        compareTo in interface java.lang.Comparable<java.lang.Object>
        Specified by:
        compareTo in interface Doc
        Parameters:
        obj - the Object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this Object is less than, equal to, or greater than the given Object.
        Throws:
        java.lang.ClassCastException - the specified Object's type prevents it from being compared to this Object.
      • isField

        public boolean isField()
        Deprecated.
        Is this Doc item a field? False until overridden.
        Specified by:
        isField in interface Doc
        Returns:
        true if it represents a field
      • isEnumConstant

        public boolean isEnumConstant()
        Deprecated.
        Is this Doc item an enum constant? False until overridden.
        Specified by:
        isEnumConstant in interface Doc
        Returns:
        true if it represents an enum constant
      • isConstructor

        public boolean isConstructor()
        Deprecated.
        Is this Doc item a constructor? False until overridden.
        Specified by:
        isConstructor in interface Doc
        Returns:
        true if it represents a constructor
      • isMethod

        public boolean isMethod()
        Deprecated.
        Is this Doc item a method (but not a constructor or annotation type element)? False until overridden.
        Specified by:
        isMethod in interface Doc
        Returns:
        true if it represents a method
      • isAnnotationTypeElement

        public boolean isAnnotationTypeElement()
        Deprecated.
        Is this Doc item an annotation type element? False until overridden.
        Specified by:
        isAnnotationTypeElement in interface Doc
        Returns:
        true if it represents an annotation type element
      • isInterface

        public boolean isInterface()
        Deprecated.
        Is this Doc item a interface (but not an annotation type)? False until overridden.
        Specified by:
        isInterface in interface Doc
        Returns:
        true if it represents a interface
      • isException

        public boolean isException()
        Deprecated.
        Is this Doc item a exception class? False until overridden.
        Specified by:
        isException in interface Doc
        Returns:
        true if it represents a exception
      • isError

        public boolean isError()
        Deprecated.
        Is this Doc item a error class? False until overridden.
        Specified by:
        isError in interface Doc
        Returns:
        true if it represents a error
      • isEnum

        public boolean isEnum()
        Deprecated.
        Is this Doc item an enum type? False until overridden.
        Specified by:
        isEnum in interface Doc
        Returns:
        true if it represents an enum type
      • isAnnotationType

        public boolean isAnnotationType()
        Deprecated.
        Is this Doc item an annotation type? False until overridden.
        Specified by:
        isAnnotationType in interface Doc
        Returns:
        true if it represents an annotation type
      • isOrdinaryClass

        public boolean isOrdinaryClass()
        Deprecated.
        Is this Doc item an ordinary class (i.e. not an interface, annotation type, enumeration, exception, or error)? False until overridden.
        Specified by:
        isOrdinaryClass in interface Doc
        Returns:
        true if it represents an ordinary class
      • isClass

        public boolean isClass()
        Deprecated.
        Is this Doc item a class (and not an interface or annotation type)? This includes ordinary classes, enums, errors and exceptions. False until overridden.
        Specified by:
        isClass in interface Doc
        Returns:
        true if it represents a class
      • isIncluded

        public abstract boolean isIncluded()
        Deprecated.
        return true if this Doc is include in the active set.
        Specified by:
        isIncluded in interface Doc
        Returns:
        true if this Doc item is included in the result set.
      • position

        public SourcePosition position()
        Deprecated.
        Return the source position of the entity, or null if no position is available.
        Specified by:
        position in interface Doc
        Returns:
        the source positino of the first line of the corresponding declaration, or null if no position is available. A default constructor returns null because it has no location in the source file.