Package daikon.config

Class InvariantDoclet

  • All Implemented Interfaces:
    Doclet

    public class InvariantDoclet
    extends Object
    implements Doclet
    InvariantDoclet is a Javadoc doclet that collects information about the invariants defined within Daikon. Class documentation is collected about each class that is derived (either directly or indirectly) from daikon.inv.Invariant. To specify the output format, use one of the following:
    --texinfo FILENAME
    Texinfo format, for inclusion in the manual.
    --text FILENAME
    Text format, with each name preceded by "+" characters to indicate depth in the tree.
    • Method Detail

      • getBinaryName

        public static String getBinaryName​(TypeElement te)
        This method mimics the JDK 8 com.sun.javadoc.Doc.name() method. It returned a 'non-qualified name' which differs from JDK 11+ javax.lang.model.element.TypeElement.getSimpleName() for a nested class. name() would return 'Outer$Inner' while getSimpleName() returns 'Inner'. Note that this version returns 'Outer.Inner'.
        Parameters:
        te - a class TypeElement
        Returns:
        the class's 'partially' qualified name
      • process_class_tree_txt

        public void process_class_tree_txt​(PrintStream out,
                                           InvariantDoclet.ClassInfo cd,
                                           int indent)
        Prints a class and all of its derived classes as a simple indented tree.
        Parameters:
        out - stream to which to print
        cd - starting class
        indent - starting indent for the derived class (normally 0)
      • process_class_sorted_texinfo

        public void process_class_sorted_texinfo​(PrintStream out,
                                                 @KeyFor("this.cmap") InvariantDoclet.ClassInfo cd)
        Prints a class and all of its derived classes with their documentation in a simple sorted (by name) list in Texinfo format. Suitable for inclusion in the manual.
        Parameters:
        out - stream to which write output
        cd - class to process
      • gather_derived_classes

        public void gather_derived_classes​(@KeyFor("this.cmap") InvariantDoclet.ClassInfo cd,
                                           TreeSet<TypeElement> set)
        Gathers up all of the classes under cd and adds them to the specified TreeSet. They are sorted by their name.
        Parameters:
        cd - the base class from which to start the search
        set - the set to add classes to. Should start out empty.
      • find_enabled

        public @Nullable Boolean find_enabled​(TypeElement cd)
        Looks for a field named dkconfig_enabled in the class and find out what it is initialized to.
        Parameters:
        cd - class in which to look for dkconfig_enabled
        Returns:
        the setting for the dkconfig_enabled variable in the class, or null if no such field
      • find_fields

        public List<Elementfind_fields​(TypeElement cd,
                                         String prefix)
        Look for fields in the specified class that begin with the specified prefix.
        Parameters:
        cd - the class to search
        prefix - string that must be at the beginning of the field name
        Returns:
        vector of FieldDoc entries for each field that matches. If no fields are found, a zero length vector is returned (not null).
      • getDocComment

        public String getDocComment​(DocCommentTree node)
        Fetch the comment string from a DocCommentTree node.
        Parameters:
        node - the DocCommentTree to process
        Returns:
        the entire body of the documentation comment as a string. If no comments are found, an empty string is returned (not null).
      • isTypeElement

        public static boolean isTypeElement​(Element element)
        Returns true if the given element kind is a type, i.e., a class, enum, interface, or annotation type.
        Parameters:
        element - the element to test
        Returns:
        true, iff the given kind is a type kind