feat(jdk8): move files to new folder to avoid resources compiled.

This commit is contained in:
2025-09-07 15:25:52 +08:00
parent 3f0047bf6f
commit 8c35cfb1c0
17415 changed files with 217 additions and 213 deletions

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents an annotated type.
* For example:
* <pre>
* {@code @NonNull String}
* {@code @Positive int}
* </pre>
*
* @author Mahmood Ali
* @since 1.8
*/
public interface AnnotatedType extends Type {
AnnotationDesc[] annotations();
Type underlyingType();
}

View File

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents an annotation.
* An annotation associates a value with each element of an annotation type.
*
* @author Scott Seligman
* @since 1.5
*/
public interface AnnotationDesc {
/**
* Returns the annotation type of this annotation.
*
* @return the annotation type of this annotation.
*/
AnnotationTypeDoc annotationType();
/**
* Returns this annotation's elements and their values.
* Only those explicitly present in the annotation are
* included, not those assuming their default values.
* Returns an empty array if there are none.
*
* @return this annotation's elements and their values.
*/
ElementValuePair[] elementValues();
/**
* Check for the synthesized bit on the annotation.
*
* @return true if the annotation is synthesized.
*/
boolean isSynthesized();
/**
* Represents an association between an annotation type element
* and one of its values.
*
* @author Scott Seligman
* @since 1.5
*/
public interface ElementValuePair {
/**
* Returns the annotation type element.
*
* @return the annotation type element.
*/
AnnotationTypeElementDoc element();
/**
* Returns the value associated with the annotation type element.
*
* @return the value associated with the annotation type element.
*/
AnnotationValue value();
}
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents an annotation type.
*
* @author Scott Seligman
* @since 1.5
*/
public interface AnnotationTypeDoc extends ClassDoc {
/**
* Returns the elements of this annotation type.
* Returns an empty array if there are none.
*
* @return the elements of this annotation type.
*/
AnnotationTypeElementDoc[] elements();
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents an element of an annotation type.
*
* @author Scott Seligman
* @since 1.5
*/
public interface AnnotationTypeElementDoc extends MethodDoc {
/**
* Returns the default value of this element.
* Returns null if this element has no default.
*
* @return the default value of this element.
*/
AnnotationValue defaultValue();
}

View File

@@ -0,0 +1,59 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a value of an annotation type element.
*
* @author Scott Seligman
* @since 1.5
*/
public interface AnnotationValue {
/**
* Returns the value.
* The type of the returned object is one of the following:
* <ul><li> a wrapper class for a primitive type
* <li> <code>String</code>
* <li> <code>Type</code> (representing a class literal)
* <li> <code>FieldDoc</code> (representing an enum constant)
* <li> <code>AnnotationDesc</code>
* <li> <code>AnnotationValue[]</code>
* </ul>
*
* @return the value.
*/
Object value();
/**
* Returns a string representation of the value.
*
* @return the text of a Java language annotation value expression
* whose value is the value of this element.
*/
String toString();
}

View File

@@ -0,0 +1,340 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a java class or interface and provides access to
* information about the class, the class's comment and tags, and the
* members of the class. A ClassDoc only exists if it was
* processed in this run of javadoc. References to classes
* which may or may not have been processed in this run are
* referred to using Type (which can be converted to ClassDoc,
* if possible).
*
* @see Type
*
* @since 1.2
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
*/
public interface ClassDoc extends ProgramElementDoc, Type {
/**
* Return true if this class is abstract. Return true
* for all interfaces.
*/
boolean isAbstract();
/**
* Return true if this class implements or interface extends
* <code>java.io.Serializable</code>.
*
* Since <code>java.io.Externalizable</code> extends
* <code>java.io.Serializable</code>,
* Externalizable objects are also Serializable.
*/
boolean isSerializable();
/**
* Return true if this class implements or interface extends
* <code>java.io.Externalizable</code>.
*/
boolean isExternalizable();
/**
* Return the serialization methods for this class or
* interface.
*
* @return an array of MethodDoc objects that represents
* the serialization methods for this class or interface.
*/
MethodDoc[] serializationMethods();
/**
* Return the Serializable fields of this class or interface.
* <p>
* Return either a list of default fields documented by
* <code>serial</code> tag<br>
* or return a single <code>FieldDoc</code> for
* <code>serialPersistentField</code> member.
* There should be a <code>serialField</code> tag for
* each Serializable field defined by an <code>ObjectStreamField</code>
* array component of <code>serialPersistentField</code>.
*
* @return an array of <code>FieldDoc</code> objects for the Serializable
* fields of this class or interface.
*
* @see #definesSerializableFields()
* @see SerialFieldTag
*/
FieldDoc[] serializableFields();
/**
* Return true if Serializable fields are explicitly defined with
* the special class member <code>serialPersistentFields</code>.
*
* @see #serializableFields()
* @see SerialFieldTag
*/
boolean definesSerializableFields();
/**
* Return the superclass of this class. Return null if this is an
* interface.
*
* <p> <i>This method cannot accommodate certain generic type constructs.
* The <code>superclassType</code> method should be used instead.</i>
*
* @return the ClassDoc for the superclass of this class, null if
* there is no superclass.
* @see #superclassType
*/
ClassDoc superclass();
/**
* Return the superclass of this class. Return null if this is an
* interface. A superclass is represented by either a
* <code>ClassDoc</code> or a <code>ParametrizedType</code>.
*
* @return the superclass of this class, or null if there is no superclass.
* @since 1.5
*/
Type superclassType();
/**
* Test whether this class is a subclass of the specified class.
* If this is an interface, return false for all classes except
* <code>java.lang.Object</code> (we must keep this unexpected
* behavior for compatibility reasons).
*
* @param cd the candidate superclass.
* @return true if cd is a superclass of this class.
*/
boolean subclassOf(ClassDoc cd);
/**
* Return interfaces implemented by this class or interfaces extended
* by this interface. Includes only directly-declared interfaces, not
* inherited interfaces.
* Return an empty array if there are no interfaces.
*
* <p> <i>This method cannot accommodate certain generic type constructs.
* The <code>interfaceTypes</code> method should be used instead.</i>
*
* @return an array of ClassDoc objects representing the interfaces.
* @see #interfaceTypes
*/
ClassDoc[] interfaces();
/**
* Return interfaces implemented by this class or interfaces extended
* by this interface. Includes only directly-declared interfaces, not
* inherited interfaces.
* Return an empty array if there are no interfaces.
*
* @return an array of interfaces, each represented by a
* <code>ClassDoc</code> or a <code>ParametrizedType</code>.
* @since 1.5
*/
Type[] interfaceTypes();
/**
* Return the formal type parameters of this class or interface.
* Return an empty array if there are none.
*
* @return the formal type parameters of this class or interface.
* @since 1.5
*/
TypeVariable[] typeParameters();
/**
* Return the type parameter tags of this class or interface.
* Return an empty array if there are none.
*
* @return the type parameter tags of this class or interface.
* @since 1.5
*/
ParamTag[] typeParamTags();
/**
* Return
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* fields in this class or interface.
* Excludes enum constants if this is an enum type.
*
* @return an array of FieldDoc objects representing the included
* fields in this class or interface.
*/
FieldDoc[] fields();
/**
* Return fields in this class or interface, filtered to the specified
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
* modifier option</a>.
* Excludes enum constants if this is an enum type.
*
* @param filter Specify true to filter according to the specified access
* modifier option.
* Specify false to include all fields regardless of
* access modifier option.
* @return an array of FieldDoc objects representing the included
* fields in this class or interface.
*/
FieldDoc[] fields(boolean filter);
/**
* Return the enum constants if this is an enum type.
* Return an empty array if there are no enum constants, or if
* this is not an enum type.
*
* @return the enum constants if this is an enum type.
*/
FieldDoc[] enumConstants();
/**
* Return
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* methods in this class or interface.
* Same as <code>methods(true)</code>.
*
* @return an array of MethodDoc objects representing the included
* methods in this class or interface. Does not include
* constructors or annotation type elements.
*/
MethodDoc[] methods();
/**
* Return methods in this class or interface, filtered to the specified
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
* modifier option</a>. Does not include constructors or annotation
* type elements.
*
* @param filter Specify true to filter according to the specified access
* modifier option.
* Specify false to include all methods regardless of
* access modifier option.
* @return an array of MethodDoc objects representing the included
* methods in this class or interface.
*/
MethodDoc[] methods(boolean filter);
/**
* Return
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* constructors in this class. An array containing the default
* no-arg constructor is returned if no other constructors exist.
* Return empty array if this is an interface.
*
* @return an array of ConstructorDoc objects representing the included
* constructors in this class.
*/
ConstructorDoc[] constructors();
/**
* Return constructors in this class, filtered to the specified
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
* modifier option</a>. Return an array containing the default
* no-arg constructor if no other constructors exist.
*
* @param filter Specify true to filter according to the specified access
* modifier option.
* Specify false to include all constructors regardless of
* access modifier option.
* @return an array of ConstructorDoc objects representing the included
* constructors in this class.
*/
ConstructorDoc[] constructors(boolean filter);
/**
* Return
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* nested classes and interfaces within this class or interface.
* This includes both static and non-static nested classes.
* (This method should have been named <code>nestedClasses()</code>,
* as inner classes are technically non-static.) Anonymous and local classes
* or interfaces are not included.
*
* @return an array of ClassDoc objects representing the included classes
* and interfaces defined in this class or interface.
*/
ClassDoc[] innerClasses();
/**
* Return nested classes and interfaces within this class or interface
* filtered to the specified
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
* modifier option</a>.
* This includes both static and non-static nested classes.
* Anonymous and local classes are not included.
*
* @param filter Specify true to filter according to the specified access
* modifier option.
* Specify false to include all nested classes regardless of
* access modifier option.
* @return a filtered array of ClassDoc objects representing the included
* classes and interfaces defined in this class or interface.
*/
ClassDoc[] innerClasses(boolean filter);
/**
* Find the specified class or interface within the context of this class doc.
* Search order: 1) qualified name, 2) nested in this class or interface,
* 3) in this package, 4) in the class imports, 5) in the package imports.
* Return the ClassDoc if found, null if not found.
*/
ClassDoc findClass(String className);
/**
* Get the list of classes and interfaces declared as imported.
* These are called "single-type-import declarations" in
* <cite>The Java&trade; Language Specification</cite>.
*
* @return an array of ClassDoc representing the imported classes.
*
* @deprecated Import declarations are implementation details that
* should not be exposed here. In addition, not all imported
* classes are imported through single-type-import declarations.
*/
@Deprecated
ClassDoc[] importedClasses();
/**
* Get the list of packages declared as imported.
* These are called "type-import-on-demand declarations" in
* <cite>The Java&trade; Language Specification</cite>.
*
* @return an array of PackageDoc representing the imported packages.
*
* @deprecated Import declarations are implementation details that
* should not be exposed here. In addition, this method's
* return type does not allow for all type-import-on-demand
* declarations to be returned.
*/
@Deprecated
PackageDoc[] importedPackages();
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a constructor of a java class.
*
* @since 1.2
* @author Robert Field
*/
public interface ConstructorDoc extends ExecutableMemberDoc {
}

View File

@@ -0,0 +1,265 @@
/*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
import java.text.BreakIterator;
import java.util.Locale;
/**
* Represents Java language constructs (package, class, constructor,
* method, field) which have comments and have been processed by this
* run of javadoc. All Doc objects are unique, that is, they
* are == comparable.
*
* @since 1.2
* @author Robert Field
* @author Scott Seligman (generics, enums, annotations)
*/
public interface Doc extends Comparable<Object> {
/**
* Return the text of the comment for this doc item.
* Tags have been removed.
*/
String commentText();
/**
* Return all tags in this Doc item.
*
* @return an array of {@link Tag} objects containing all tags on
* this Doc item.
*/
Tag[] tags();
/**
* Return tags of the specified {@linkplain Tag#kind() kind} in
* this Doc item.
*
* For example, if 'tagname' has value "@serial", all tags in
* this Doc item of kind "@serial" will be returned.
*
* @param tagname name of the tag kind to search for.
* @return an array of Tag containing all tags whose 'kind()'
* matches 'tagname'.
*/
Tag[] tags(String tagname);
/**
* Return the see also tags in this Doc item.
*
* @return an array of SeeTag containing all @see tags.
*/
SeeTag[] seeTags();
/**
* Return comment as an array of tags. Includes inline tags
* (i.e. {&#64;link <i>reference</i>} tags) but not
* block tags.
* Each section of plain text is represented as a {@link Tag}
* of {@linkplain Tag#kind() kind} "Text".
* Inline tags are represented as a {@link SeeTag} of kind "@see"
* and name "@link".
*
* @return an array of {@link Tag}s representing the comment
*/
Tag[] inlineTags();
/**
* Return the first sentence of the comment as an array of tags.
* Includes inline tags
* (i.e. {&#64;link <i>reference</i>} tags) but not
* block tags.
* Each section of plain text is represented as a {@link Tag}
* of {@linkplain Tag#kind() kind} "Text".
* Inline tags are represented as a {@link SeeTag} of kind "@see"
* and name "@link".
* <p>
* If the locale is English language, the first sentence is
* determined by the rules described in the Java Language
* Specification (first version): &quot;This sentence ends
* at the first period that is followed by a blank, tab, or
* line terminator or at the first tagline.&quot;, in
* addition a line will be terminated by block
* HTML tags: &lt;p&gt; &lt;/p&gt; &lt;h1&gt;
* &lt;h2&gt; &lt;h3&gt; &lt;h4&gt; &lt;h5&gt; &lt;h6&gt;
* &lt;hr&gt; &lt;pre&gt; or &lt;/pre&gt;.
* If the locale is not English, the sentence end will be
* determined by
* {@link BreakIterator#getSentenceInstance(Locale)}.
* @return an array of {@link Tag}s representing the
* first sentence of the comment
*/
Tag[] firstSentenceTags();
/**
* Return the full unprocessed text of the comment. Tags
* are included as text. Used mainly for store and retrieve
* operations like internalization.
*/
String getRawCommentText();
/**
* Set the full unprocessed text of the comment. Tags
* are included as text. Used mainly for store and retrieve
* operations like internalization.
*/
void setRawCommentText(String rawDocumentation);
/**
* Returns the non-qualified name of this Doc item.
*
* @return the name
*/
String name();
/**
* Compares this doc object with the specified object for order. Returns a
* negative integer, zero, or a positive integer as this doc object is less
* than, equal to, or greater than the given object.
* <p>
* This method satisfies the {@link java.lang.Comparable} interface.
*
* @param obj the <code>Object</code> to be compared.
* @return a negative integer, zero, or a positive integer as this Object
* is less than, equal to, or greater than the given Object.
* @exception ClassCastException the specified Object's type prevents it
* from being compared to this Object.
*/
int compareTo(Object obj);
/**
* Is this Doc item a field (but not an enum constant)?
*
* @return true if it represents a field
*/
boolean isField();
/**
* Is this Doc item an enum constant?
*
* @return true if it represents an enum constant
* @since 1.5
*/
boolean isEnumConstant();
/**
* Is this Doc item a constructor?
*
* @return true if it represents a constructor
*/
boolean isConstructor();
/**
* Is this Doc item a method (but not a constructor or annotation
* type element)?
*
* @return true if it represents a method
*/
boolean isMethod();
/**
* Is this Doc item an annotation type element?
*
* @return true if it represents an annotation type element
* @since 1.5
*/
boolean isAnnotationTypeElement();
/**
* Is this Doc item an interface (but not an annotation type)?
*
* @return true if it represents an interface
*/
boolean isInterface();
/**
* Is this Doc item an exception class?
*
* @return true if it represents an exception
*/
boolean isException();
/**
* Is this Doc item an error class?
*
* @return true if it represents a error
*/
boolean isError();
/**
* Is this Doc item an enum type?
*
* @return true if it represents an enum type
* @since 1.5
*/
boolean isEnum();
/**
* Is this Doc item an annotation type?
*
* @return true if it represents an annotation type
* @since 1.5
*/
boolean isAnnotationType();
/**
* Is this Doc item an
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#class">ordinary
* class</a>?
* (i.e. not an interface, annotation type, enum, exception, or error)?
*
* @return true if it represents an ordinary class
*/
boolean isOrdinaryClass();
/**
* Is this Doc item a
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#class">class</a>
* (and not an interface or annotation type)?
* This includes ordinary classes, enums, errors and exceptions.
*
* @return true if it represents a class
*/
boolean isClass();
/**
* Return true if this Doc item is
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* in the result set.
*/
boolean isIncluded();
/**
* Return the source position 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.
*
* @since 1.4
*/
SourcePosition position();
}

View File

@@ -0,0 +1,83 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* This interface provides error, warning and notice printing.
*
* @since 1.2
* @author Robert Field
*/
public interface DocErrorReporter {
/**
* Print error message and increment error count.
*
* @param msg message to print
*/
void printError(String msg);
/**
* Print an error message and increment error count.
*
* @param pos the position item where the error occurs
* @param msg message to print
* @since 1.4
*/
void printError(SourcePosition pos, String msg);
/**
* Print warning message and increment warning count.
*
* @param msg message to print
*/
void printWarning(String msg);
/**
* Print warning message and increment warning count.
*
* @param pos the position item where the warning occurs
* @param msg message to print
* @since 1.4
*/
void printWarning(SourcePosition pos, String msg);
/**
* Print a message.
*
* @param msg message to print
*/
void printNotice(String msg);
/**
* Print a message.
*
* @param pos the position item where the message occurs
* @param msg message to print
* @since 1.4
*/
void printNotice(SourcePosition pos, String msg);
}

View File

@@ -0,0 +1,111 @@
/*
* Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* This is an example of a starting class for a doclet,
* showing the entry-point methods. A starting class must
* import com.sun.javadoc.* and implement the
* <code>start(RootDoc)</code> method, as described in the
* <a href="package-summary.html#package_description">package
* description</a>. If the doclet takes command line options,
* it must also implement <code>optionLength</code> and
* <code>validOptions</code>.
*
* <p> A doclet supporting the language features added since 1.1
* (such as generics and annotations) should indicate this
* by implementing <code>languageVersion</code>. In the absence of
* this the doclet should not invoke any of the Doclet API methods
* added since 1.5, and
* the results of several other methods are modified so as
* to conceal the new constructs (such as type parameters) from
* the doclet.
*
* <p> To start the doclet, pass
* <code>-doclet</code> followed by the fully-qualified
* name of the starting class on the javadoc tool command line.
*/
public abstract class Doclet {
/**
* Generate documentation here.
* This method is required for all doclets.
*
* @return true on success.
*/
public static boolean start(RootDoc root) {
return true;
}
/**
* Check for doclet-added options. Returns the number of
* arguments you must specify on the command line for the
* given option. For example, "-d docs" would return 2.
* <P>
* This method is required if the doclet contains any options.
* If this method is missing, Javadoc will print an invalid flag
* error for every option.
*
* @return number of arguments on the command line for an option
* including the option name itself. Zero return means
* option not known. Negative value means error occurred.
*/
public static int optionLength(String option) {
return 0; // default is option unknown
}
/**
* Check that options have the correct arguments.
* <P>
* This method is not required, but is recommended,
* as every option will be considered valid if this method
* is not present. It will default gracefully (to true)
* if absent.
* <P>
* Printing option related error messages (using the provided
* DocErrorReporter) is the responsibility of this method.
*
* @return true if the options are valid.
*/
public static boolean validOptions(String options[][],
DocErrorReporter reporter) {
return true; // default is options are valid
}
/**
* Return the version of the Java Programming Language supported
* by this doclet.
* <p>
* This method is required by any doclet supporting a language version
* newer than 1.1.
*
* @return the language version supported by this doclet.
* @since 1.5
*/
public static LanguageVersion languageVersion() {
return LanguageVersion.JAVA_1_1;
}
}

View File

@@ -0,0 +1,148 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a method or constructor of a java class.
*
* @since 1.2
* @author Robert Field
*/
public interface ExecutableMemberDoc extends MemberDoc {
/**
* Return exceptions this method or constructor throws.
* If the type of the exception is a type variable, return the
* <code>ClassDoc</code> of its erasure.
*
* <p> <i>The <code>thrownExceptions</code> method cannot
* accommodate certain generic type constructs. The
* <code>thrownExceptionTypes</code> method should be used
* instead.</i>
*
* @return an array of ClassDoc[] representing the exceptions
* thrown by this method.
* @see #thrownExceptionTypes
*/
ClassDoc[] thrownExceptions();
/**
* Return exceptions this method or constructor throws.
*
* @return an array representing the exceptions thrown by this method.
* Each array element is either a <code>ClassDoc</code> or a
* <code>TypeVariable</code>.
* @since 1.5
*/
Type[] thrownExceptionTypes();
/**
* Return true if this method is native
*/
boolean isNative();
/**
* Return true if this method is synchronized
*/
boolean isSynchronized();
/**
* Return true if this method was declared to take a variable number
* of arguments.
*
* @since 1.5
*/
public boolean isVarArgs();
/**
* Get argument information.
*
* @see Parameter
*
* @return an array of Parameter, one element per argument
* in the order the arguments are present.
*/
Parameter[] parameters();
/**
* Get the receiver type of this executable element.
*
* @return the receiver type of this executable element.
* @since 1.8
*/
Type receiverType();
/**
* Return the throws tags in this method.
*
* @return an array of ThrowTag containing all <code>&#64;exception</code>
* and <code>&#64;throws</code> tags.
*/
ThrowsTag[] throwsTags();
/**
* Return the param tags in this method, excluding the type
* parameter tags.
*
* @return an array of ParamTag containing all <code>&#64;param</code> tags
* corresponding to the parameters of this method.
*/
ParamTag[] paramTags();
/**
* Return the type parameter tags in this method.
*
* @return an array of ParamTag containing all <code>&#64;param</code> tags
* corresponding to the type parameters of this method.
* @since 1.5
*/
ParamTag[] typeParamTags();
/**
* Get the signature. It is the parameter list, type is qualified.
* For instance, for a method <code>mymethod(String x, int y)</code>,
* it will return <code>(java.lang.String,int)</code>.
*/
String signature();
/**
* get flat signature. all types are not qualified.
* return a String, which is the flat signiture of this member.
* It is the parameter list, type is not qualified.
* For instance, for a method <code>mymethod(String x, int y)</code>,
* it will return <code>(String, int)</code>.
*/
String flatSignature();
/**
* Return the formal type parameters of this method or constructor.
* Return an empty array if this method or constructor is not generic.
*
* @return the formal type parameters of this method or constructor.
* @since 1.5
*/
TypeVariable[] typeParameters();
}

View File

@@ -0,0 +1,79 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a field in a java class.
*
* @see MemberDoc
*
* @since 1.2
* @author Robert Field
*/
public interface FieldDoc extends MemberDoc {
/**
* Get type of this field.
*/
Type type();
/**
* Return true if this field is transient
*/
boolean isTransient();
/**
* Return true if this field is volatile
*/
boolean isVolatile();
/**
* Return the serialField tags in this FieldDoc item.
*
* @return an array of <tt>SerialFieldTag</tt> objects containing
* all <code>@serialField</code> tags.
*/
SerialFieldTag[] serialFieldTags();
/**
* Get the value of a constant field.
*
* @return the value of a constant field. The value is
* automatically wrapped in an object if it has a primitive type.
* If the field is not constant, returns null.
*/
Object constantValue();
/**
* Get the value of a constant field.
*
* @return the text of a Java language expression whose value
* is the value of the constant. The expression uses no identifiers
* other than primitive literals. If the field is
* not constant, returns null.
*/
String constantValueExpression();
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Java Programming Language version. The constants of this enum
* identify the JDK and J2SE releases containing language changes
* relevant to doclets.
* <p>
* All doclets support at least the 1.1 language version.
* The first release subsequent to this with language changes
* affecting doclets is 1.5.
*
* @since 1.5
*/
public enum LanguageVersion {
/** 1.1 added nested classes and interfaces. */
JAVA_1_1,
/** 1.5 added generic types, annotations, enums, and varArgs. */
JAVA_1_5
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a member of a java class: field, constructor, or method.
* This is an abstract class dealing with information common to
* method, constructor and field members. Class members of a class
* (innerclasses) are represented instead by ClassDoc.
*
* @see MethodDoc
* @see FieldDoc
* @see ClassDoc
*
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
*/
public interface MemberDoc extends ProgramElementDoc {
/**
* Returns true if this member was synthesized by the compiler.
*/
boolean isSynthetic();
}

View File

@@ -0,0 +1,99 @@
/*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a method of a java class.
*
* @since 1.2
* @author Robert Field
*/
public interface MethodDoc extends ExecutableMemberDoc {
/**
* Return true if this method is abstract
*/
boolean isAbstract();
/**
* Return true if this method is default
*/
boolean isDefault();
/**
* Get return type.
*
* @return the return type of this method, null if it
* is a constructor.
*/
Type returnType();
/**
* Return the class containing the method that this method overrides.
*
* <p> <i>The <code>overriddenClass</code> method cannot
* accommodate certain generic type constructs. The
* <code>overriddenType</code> method should be used instead.</i>
*
* @return a ClassDoc representing the superclass
* defining a method that this method overrides, or null if
* this method does not override.
*/
ClassDoc overriddenClass();
/**
* Return the type containing the method that this method overrides.
* It may be a <code>ClassDoc</code> or a <code>ParameterizedType</code>.
*
* @return the supertype whose method is overridden, or null if this
* method does not override another in a superclass
* @since 1.5
*/
Type overriddenType();
/**
* Return the method that this method overrides.
*
* @return a MethodDoc representing a method definition
* in a superclass this method overrides, null if
* this method does not override.
*/
MethodDoc overriddenMethod();
/**
* Tests whether this method overrides another.
* The overridden method may be one declared in a superclass or
* a superinterface (unlike {@link #overriddenMethod()}).
*
* <p> When a non-abstract method overrides an abstract one, it is
* also said to <i>implement</i> the other.
*
* @param meth the other method to examine
* @return <tt>true</tt> if this method overrides the other
* @since 1.5
*/
boolean overrides(MethodDoc meth);
}

View File

@@ -0,0 +1,129 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a java package. Provides access to information
* about the package, the package's comment and tags, and the
* classes in the package.
* <p>
* Each method whose return type is an array will return an empty
* array (never null) when there are no objects in the result.
*
* @since 1.2
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
*/
public interface PackageDoc extends Doc {
/**
* Get all classes and interfaces in the package, filtered to the specified
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access
* modifier option</a>.
*
* @return filtered classes and interfaces in this package
* @param filter Specifying true filters according to the specified access
* modifier option.
* Specifying false includes all classes and interfaces
* regardless of access modifier option.
* @since 1.4
*/
ClassDoc[] allClasses(boolean filter);
/**
* Get all
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a>
* classes and interfaces in the package. Same as allClasses(true).
*
* @return all included classes and interfaces in this package.
*/
ClassDoc[] allClasses();
/**
* Get included
* <a href="{@docRoot}/com/sun/javadoc/package-summary.html#class">ordinary</a>
* classes (that is, exclude exceptions, errors, enums, interfaces, and
* annotation types)
* in this package.
*
* @return included ordinary classes in this package.
*/
ClassDoc[] ordinaryClasses();
/**
* Get included Exception classes in this package.
*
* @return included Exceptions in this package.
*/
ClassDoc[] exceptions();
/**
* Get included Error classes in this package.
*
* @return included Errors in this package.
*/
ClassDoc[] errors();
/**
* Get included enum types in this package.
*
* @return included enum types in this package.
* @since 1.5
*/
ClassDoc[] enums();
/**
* Get included interfaces in this package, omitting annotation types.
*
* @return included interfaces in this package.
*/
ClassDoc[] interfaces();
/**
* Get included annotation types in this package.
*
* @return included annotation types in this package.
* @since 1.5
*/
AnnotationTypeDoc[] annotationTypes();
/**
* Get the annotations of this package.
* Return an empty array if there are none.
*
* @return the annotations of this package.
* @since 1.5
*/
AnnotationDesc[] annotations();
/**
* Lookup a class or interface within this package.
*
* @return ClassDoc of found class or interface,
* or null if not found.
*/
ClassDoc findClass(String className);
}

View File

@@ -0,0 +1,67 @@
/*
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents an @param documentation tag.
* Stores the name and comment parts of the parameter tag.
* An @param tag may represent either a method or constructor parameter,
* or a type parameter.
*
* @author Robert Field
*
*/
public interface ParamTag extends Tag {
/**
* Return the name of the parameter or type parameter
* associated with this <code>ParamTag</code>.
* The angle brackets delimiting a type parameter are not part of
* its name.
*
* @return the parameter name.
*/
String parameterName();
/**
* Return the parameter comment
* associated with this <code>ParamTag</code>.
*
* @return the parameter comment.
*/
String parameterComment();
/**
* Return true if this <code>ParamTag</code> corresponds to a type
* parameter. Return false if it corresponds to an ordinary parameter
* of a method or constructor.
*
* @return true if this <code>ParamTag</code> corresponds to a type
* parameter.
* @since 1.5
*/
boolean isTypeParameter();
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Parameter information.
* This includes a parameter type and parameter name.
*
* @author Robert Field
*/
public interface Parameter {
/**
* Get the type of this parameter.
*/
Type type();
/**
* Get local name of this parameter.
* For example if parameter is the short 'index', returns "index".
*/
String name();
/**
* Get type name of this parameter.
* For example if parameter is the short 'index', returns "short".
* <p>
* This method returns a complete string
* representation of the type, including the dimensions of arrays and
* the type arguments of parameterized types. Names are qualified.
*/
String typeName();
/**
* Returns a string representation of the parameter.
* <p>
* For example if parameter is the short 'index', returns "short index".
*
* @return type and parameter name of this parameter.
*/
String toString();
/**
* Get the annotations of this parameter.
* Return an empty array if there are none.
*
* @return the annotations of this parameter.
* @since 1.5
*/
AnnotationDesc[] annotations();
}

View File

@@ -0,0 +1,108 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents an invocation of a generic class or interface. For example,
* given the generic interface {@code List<E>}, possible invocations
* include:
* <pre>
* {@code List<String>}
* {@code List<T extends Number>}
* {@code List<?>}
* </pre>
* A generic inner class {@code Outer<T>.Inner<S>} might be invoked as:
* <pre>
* {@code Outer<Number>.Inner<String>}
* </pre>
*
* @author Scott Seligman
* @since 1.5
*/
public interface ParameterizedType extends Type {
/**
* Return the generic class or interface that declared this type.
*
* @return the generic class or interface that declared this type.
*/
ClassDoc asClassDoc();
/**
* Return the actual type arguments of this type.
* For a generic type that is nested within some other generic type
* (such as {@code Outer<T>.Inner<S>}),
* only the type arguments of the innermost type are included.
*
* @return the actual type arguments of this type.
*/
Type[] typeArguments();
/**
* Return the class type that is a direct supertype of this one.
* This is the superclass of this type's declaring class,
* with type arguments substituted in.
* Return null if this is an interface type.
*
* <p> For example, if this parameterized type is
* {@code java.util.ArrayList<String>}, the result will be
* {@code java.util.AbstractList<String>}.
*
* @return the class type that is a direct supertype of this one.
*/
Type superclassType();
/**
* Return the interface types directly implemented by or extended by this
* parameterized type.
* These are the interfaces directly implemented or extended
* by this type's declaring class or interface,
* with type arguments substituted in.
* Return an empty array if there are no interfaces.
*
* <p> For example, the interface extended by
* {@code java.util.Set<String>} is {@code java.util.Collection<String>}.
*
* @return the interface types directly implemented by or extended by this
* parameterized type.
*/
Type[] interfaceTypes();
/**
* Return the type that contains this type as a member.
* Return null is this is a top-level type.
*
* <p> For example, the containing type of
* {@code AnInterface.Nested<Number>} is the <code>ClassDoc</code>
* representing {@code AnInterface}, and the containing type of
* {@code Outer<String>.Inner<Number>} is the
* <code>ParameterizedType</code> representing {@code Outer<String>}.
*
* @return the type that contains this type as a member.
*/
Type containingType();
}

View File

@@ -0,0 +1,125 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a java program element: class, interface, field,
* constructor, or method.
* This is an abstract class dealing with information common to
* these elements.
*
* @see MemberDoc
* @see ClassDoc
*
* @author Robert Field
*/
public interface ProgramElementDoc extends Doc {
/**
* Get the containing class or interface of this program element.
*
* @return a ClassDoc for this element's containing class or interface.
* If this is a top-level class or interface, return null.
*/
ClassDoc containingClass();
/**
* Get the package that this program element is contained in.
*
* @return a PackageDoc for this element containing package.
* If in the unnamed package, this PackageDoc will have the
* name "".
*/
PackageDoc containingPackage();
/**
* Get the fully qualified name of this program element.
* For example, for the class <code>java.util.Hashtable</code>,
* return "java.util.Hashtable".
* <p>
* For the method <code>bar()</code> in class <code>Foo</code>
* in the unnamed package, return "Foo.bar".
*
* @return the qualified name of the program element as a String.
*/
String qualifiedName();
/**
* Get the modifier specifier integer.
*
* @see java.lang.reflect.Modifier
*/
int modifierSpecifier();
/**
* Get modifiers string.
* For example, for:
* <pre>
* public abstract int foo() { ... }
* </pre>
* return "public abstract".
* Annotations are not included.
*/
String modifiers();
/**
* Get the annotations of this program element.
* Return an empty array if there are none.
*
* @return the annotations of this program element.
* @since 1.5
*/
AnnotationDesc[] annotations();
/**
* Return true if this program element is public.
*/
boolean isPublic();
/**
* Return true if this program element is protected.
*/
boolean isProtected();
/**
* Return true if this program element is private.
*/
boolean isPrivate();
/**
* Return true if this program element is package private.
*/
boolean isPackagePrivate();
/**
* Return true if this program element is static.
*/
boolean isStatic();
/**
* Return true if this program element is final.
*/
boolean isFinal();
}

View File

@@ -0,0 +1,109 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents the root of the program structure information
* for one run of javadoc. From this root all other program
* structure information can be extracted.
* Also represents the command line information -- the
* packages, classes and options specified by the user.
*
* @since 1.2
* @author Robert Field
*/
public interface RootDoc extends Doc, DocErrorReporter {
/**
* Command line options.
* <p>
* For example, given:
* <pre>
* javadoc -foo this that -bar other ...</pre>
*
* this method will return:
* <pre>
* options()[0][0] = "-foo"
* options()[0][1] = "this"
* options()[0][2] = "that"
* options()[1][0] = "-bar"
* options()[1][1] = "other"</pre>
*
* @return an array of arrays of String.
*/
String[][] options();
/**
* Return the packages
* <a href="package-summary.html#included">specified</a>
* on the command line.
* If <code>-subpackages</code> and <code>-exclude</code> options
* are used, return all the non-excluded packages.
*
* @return packages specified on the command line.
*/
PackageDoc[] specifiedPackages();
/**
* Return the classes and interfaces
* <a href="package-summary.html#included">specified</a>
* as source file names on the command line.
*
* @return classes and interfaces specified on the command line.
*/
ClassDoc[] specifiedClasses();
/**
* Return the
* <a href="package-summary.html#included">included</a>
classes and interfaces in all packages.
*
* @return included classes and interfaces in all packages.
*/
ClassDoc[] classes();
/**
* Return a PackageDoc for the specified package name.
*
* @param name package name
*
* @return a PackageDoc holding the specified package, null if
* this package is not referenced.
*/
PackageDoc packageNamed(String name);
/**
* Return a ClassDoc for the specified class or interface name.
*
* @param qualifiedName
* <a href="package-summary.html#qualified">qualified</a>
* class or package name
*
* @return a ClassDoc holding the specified class, null if
* this class is not referenced.
*/
ClassDoc classNamed(String qualifiedName);
}

View File

@@ -0,0 +1,126 @@
/*
* Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a user-defined cross-reference to related documentation.
* The tag can reference a package, class or member, or can hold
* plain text. (The plain text might be a reference
* to something not online, such as a printed book, or be a hard-coded
* HTML link.) The reference can either be inline with the comment,
* using <code>&#123;@link}</code>, or a separate block comment,
* using <code>@see</code>.
* Method <code>name()</code> returns "@link" (no curly braces) or
* "@see", depending on the tag.
* Method <code>kind()</code> returns "@see" for both tags.
*
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
* @author Atul M Dambalkar
*
*/
public interface SeeTag extends Tag {
/**
* Get the label of the <code>@see</code> tag.
* Return null if no label is present.
* For example, for:
* <p>
* &nbsp;&nbsp;<code>@see String#trim() the trim method</code>
* </p>
* return "the trim method".
*/
String label();
/**
* Get the package doc when <code>@see</code> references only a package.
* Return null if the package cannot be found, or if
* <code>@see</code> references any other element (class,
* interface, field, constructor, method) or non-element.
* For example, for:
* <p>
* &nbsp;&nbsp;<code>@see java.lang</code>
* </p>
* return the <code>PackageDoc</code> for <code>java.lang</code>.
*/
public PackageDoc referencedPackage();
/**
* Get the class or interface name of the <code>@see</code> reference.
* The name is fully qualified if the name specified in the
* original <code>@see</code> tag was fully qualified, or if the class
* or interface can be found; otherwise it is unqualified.
* If <code>@see</code> references only a package name, then return
* the package name instead.
* For example, for:
* <p>
* &nbsp;&nbsp;<code>@see String#valueOf(java.lang.Object)</code>
* </p>
* return "java.lang.String".
* For "<code>@see java.lang</code>", return "java.lang".
* Return null if <code>@see</code> references a non-element, such as
* <code>@see &lt;a href="java.sun.com"&gt;</code>.
*/
String referencedClassName();
/**
* Get the class doc referenced by the class name part of @see.
* Return null if the class cannot be found.
* For example, for:
* <p>
* &nbsp;&nbsp;<code>@see String#valueOf(java.lang.Object)</code>
* </p>
* return the <code>ClassDoc</code> for <code>java.lang.String</code>.
*/
ClassDoc referencedClass();
/**
* Get the field, constructor or method substring of the <code>@see</code>
* reference. Return null if the reference is to any other
* element or to any non-element.
* References to member classes (nested classes) return null.
* For example, for:
* <p>
* &nbsp;&nbsp;<code>@see String#startsWith(String)</code>
* </p>
* return "startsWith(String)".
*/
String referencedMemberName();
/**
* Get the member doc for the field, constructor or method
* referenced by <code>@see</code>. Return null if the member cannot
* be found or if the reference is to any other element or to any
* non-element.
* References to member classes (nested classes) return null.
* For example, for:
* <p>
* &nbsp;&nbsp;<code>@see String#startsWith(java.lang.String)</code>
* </p>
* return the <code>MethodDoc</code> for <code>startsWith</code>.
*/
MemberDoc referencedMember();
}

View File

@@ -0,0 +1,87 @@
/*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Documents a Serializable field defined by an ObjectStreamField.
* <pre>
* The class parses and stores the three serialField tag parameters:
*
* - field name
* - field type name
* (fully-qualified or visible from the current import context)
* - description of the valid values for the field
* </pre>
* This tag is only allowed in the javadoc for the special member
* serialPersistentFields.
*
* @author Joe Fialli
*
* @see java.io.ObjectStreamField
*/
public interface SerialFieldTag extends Tag, Comparable<Object> {
/**
* Return the serializable field name.
*/
public String fieldName();
/**
* Return the field type string.
*/
public String fieldType();
/**
* Return the ClassDoc for field type.
*
* @return null if no ClassDoc for field type is visible from
* containingClass context.
*/
public ClassDoc fieldTypeDoc();
/**
* Return the field comment. If there is no serialField comment, return
* javadoc comment of corresponding FieldDoc.
*/
public String description();
/**
* 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.
* <p>
* Included to make SerialFieldTag items java.lang.Comparable.
*
* @param obj the <code>Object</code> to be compared.
* @return a negative integer, zero, or a positive integer as this Object
* is less than, equal to, or greater than the given Object.
* @exception ClassCastException the specified Object's type prevents it
* from being compared to this Object.
* @since 1.2
*/
public int compareTo(Object obj);
}

View File

@@ -0,0 +1,55 @@
/*
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
import java.io.File;
/**
* This interface describes a source position: filename, line number,
* and column number.
*
* @since 1.4
* @author Neal M Gafter
*/
public interface SourcePosition {
/** The source file. Returns null if no file information is
* available. */
File file();
/** The line in the source file. The first line is numbered 1;
* 0 means no line number information is available. */
int line();
/** The column in the source file. The first column is
* numbered 1; 0 means no column information is available.
* Columns count characters in the input stream; a tab
* advances the column number to the next 8-column tab stop.
*/
int column();
/** Convert the source position to the form "Filename:line". */
String toString();
}

View File

@@ -0,0 +1,166 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
import java.text.BreakIterator;
import java.util.Locale;
/**
* Represents a simple documentation tag, such as @since, @author, @version.
* Given a tag (e.g. "@since 1.2"), holds tag name (e.g. "@since")
* and tag text (e.g. "1.2"). Tags with structure or which require
* special processing are handled by subclasses such as ParamTag
* (for @param), SeeTag (for @see and {&#064;link}), and ThrowsTag
* (for @throws).
*
* @author Robert Field
* @author Atul M Dambalkar
* @see SeeTag
* @see ParamTag
* @see ThrowsTag
* @see SerialFieldTag
* @see Doc#tags()
*
*/
public interface Tag {
/**
* Return the name of this tag. The name is the string
* starting with "@" that is used in a doc comment, such as
* <code>@return</code>. For inline tags, such as
* <code>{&#064;link}</code>, the curly brackets
* are not part of the name, so in this example the name
* would be simply <code>@link</code>.
*
* @return the name of this tag
*/
String name();
/**
* Return the containing {@link Doc} of this Tag element.
*
* @return the containing {@link Doc} of this Tag element
*/
Doc holder();
/**
* Return the kind of this tag.
* For most tags,
* <code>kind()&nbsp;==&nbsp;name()</code>;
* the following table lists those cases where there is more
* than one tag of a given kind:
*
* <table border="1" cellpadding="4" cellspacing="0" summary="related tags">
* <tr><th>{@code kind() }</th> <th>{@code name() }</th></tr>
* <tr><td>{@code @throws }</td> <td>{@code @throws }</td></tr>
* <tr><td>{@code @throws }</td> <td>{@code @exception }</td></tr>
* <tr><td>{@code @see }</td> <td>{@code @see }</td></tr>
* <tr><td>{@code @see }</td> <td>{@code @link }</td></tr>
* <tr><td>{@code @see }</td> <td>{@code @linkplain }</td></tr>
* <tr><td>{@code @serial }</td> <td>{@code @serial }</td></tr>
* <tr><td>{@code @serial }</td> <td>{@code @serialData }</td></tr>
* </table>
*
* @return the kind of this tag.
*/
String kind();
/**
* Return the text of this tag, that is, the portion beyond tag name.
*
* @return the text of this tag
*/
String text();
/**
* Convert this object to a string.
*/
String toString();
/**
* For a documentation comment with embedded <code>{&#064;link}</code>
* tags, return an array of <code>Tag</code> objects. The entire
* doc comment is broken down into strings separated by
* <code>{&#064;link}</code> tags, where each successive element
* of the array represents either a string or
* <code>{&#064;link}</code> tag, in order, from start to end.
* Each string is represented by a <code>Tag</code> object of
* name "Text", where {@link #text()} returns the string. Each
* <code>{&#064;link}</code> tag is represented by a
* {@link SeeTag} of name "@link" and kind "@see".
* For example, given the following comment
* tag:
* <p>
* <code>This is a {&#064;link Doc commentlabel} example.</code>
* <p>
* return an array of Tag objects:
* <ul>
* <li> tags[0] is a {@link Tag} with name "Text" and text consisting
* of "This is a "
* <li> tags[1] is a {@link SeeTag} with name "@link", referenced
* class <code>Doc</code> and label "commentlabel"
* <li> tags[2] is a {@link Tag} with name "Text" and text consisting
* of " example."
* </ul>
*
* @return Tag[] array of tags
* @see ParamTag
* @see ThrowsTag
*/
Tag[] inlineTags();
/**
* Return the first sentence of the comment as an array of tags.
* Includes inline tags
* (i.e. {&#64;link <i>reference</i>} tags) but not
* block tags.
* Each section of plain text is represented as a {@link Tag}
* of kind "Text".
* Inline tags are represented as a {@link SeeTag} of kind "@link".
* If the locale is English language, the first sentence is
* determined by the rules described in the Java Language
* Specification (first version): &quot;This sentence ends
* at the first period that is followed by a blank, tab, or
* line terminator or at the first tagline.&quot;, in
* addition a line will be terminated by paragraph and
* section terminating HTML tags: &lt;p&gt; &lt;/p&gt; &lt;h1&gt;
* &lt;h2&gt; &lt;h3&gt; &lt;h4&gt; &lt;h5&gt; &lt;h6&gt;
* &lt;hr&gt; &lt;pre&gt; or &lt;/pre&gt;.
* If the locale is not English, the sentence end will be
* determined by
* {@link BreakIterator#getSentenceInstance(Locale)}.
*
* @return an array of {@link Tag} objects representing the
* first sentence of the comment
*/
Tag[] firstSentenceTags();
/**
* Return the source position of this tag.
* @return the source position of this tag.
*/
public SourcePosition position();
}

View File

@@ -0,0 +1,79 @@
/*
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a @throws or @exception documentation tag.
* Parses and holds the exception name and exception comment.
* Note: @exception is a backwards compatible synonymy for @throws.
*
* @author Robert Field
* @author Atul M Dambalkar
* @see ExecutableMemberDoc#throwsTags()
*
*/
public interface ThrowsTag extends Tag {
/**
* Return the name of the exception
* associated with this <code>ThrowsTag</code>.
*
* @return name of the exception.
*/
String exceptionName();
/**
* Return the exception comment
* associated with this <code>ThrowsTag</code>.
*
* @return exception comment.
*/
String exceptionComment();
/**
* Return a <code>ClassDoc</code> that represents the exception.
* If the type of the exception is a type variable, return the
* <code>ClassDoc</code> of its erasure.
*
* <p> <i>This method cannot accommodate certain generic type
* constructs. The <code>exceptionType</code> method
* should be used instead.</i>
*
* @return <code>ClassDoc</code> that represents the exception.
* @see #exceptionType
*/
ClassDoc exception();
/**
* Return the type of the exception
* associated with this <code>ThrowsTag</code>.
* This may be a <code>ClassDoc</code> or a <code>TypeVariable</code>.
*
* @return the type of the exception.
* @since 1.5
*/
Type exceptionType();
}

View File

@@ -0,0 +1,172 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a type. A type can be a class or interface, an
* invocation (like {@code List<String>}) of a generic class or interface,
* a type variable, a wildcard type ("<code>?</code>"),
* or a primitive data type (like <code>char</code>).
*
* @since 1.2
* @author Kaiyang Liu (original)
* @author Robert Field (rewrite)
* @author Scott Seligman (generics)
*/
public interface Type {
/**
* Return unqualified name of type excluding any dimension information.
* <p>
* For example, a two dimensional array of String returns
* "<code>String</code>".
*/
String typeName();
/**
* Return qualified name of type excluding any dimension information.
*<p>
* For example, a two dimensional array of String
* returns "<code>java.lang.String</code>".
*/
String qualifiedTypeName();
/**
* Return the simple name of this type excluding any dimension information.
* This is the unqualified name of the type, except that for nested types
* only the identifier of the innermost type is included.
* <p>
* For example, the class {@code Outer.Inner} returns
* "<code>Inner</code>".
*
* @since 1.5
*/
String simpleTypeName();
/**
* Return the type's dimension information, as a string.
* <p>
* For example, a two dimensional array of String returns
* "<code>[][]</code>".
*/
String dimension();
/**
* Return a string representation of the type.
* This includes any dimension information and type arguments.
* <p>
* For example, a two dimensional array of String may return
* "<code>java.lang.String[][]</code>",
* and the parameterized type {@code List<Integer>} may return
* "{@code java.util.List<java.lang.Integer>}".
*
* @return a string representation of the type.
*/
String toString();
/**
* Return true if this type represents a primitive type.
*
* @return true if this type represents a primitive type.
* @since 1.5
*/
boolean isPrimitive();
/**
* Return this type as a <code>ClassDoc</code> if it represents a class
* or interface. Array dimensions are ignored.
* If this type is a <code>ParameterizedType</code>,
* <code>TypeVariable</code>, or <code>WildcardType</code>, return
* the <code>ClassDoc</code> of the type's erasure. If this is an
* <code>AnnotationTypeDoc</code>, return this as a <code>ClassDoc</code>
* (but see {@link #asAnnotationTypeDoc()}).
* If this is a primitive type, return null.
*
* @return the <code>ClassDoc</code> of this type,
* or null if it is a primitive type.
*/
ClassDoc asClassDoc();
/**
* Return this type as a <code>ParameterizedType</code> if it represents
* an invocation of a generic class or interface. Array dimensions
* are ignored.
*
* @return a <code>ParameterizedType</code> if the type is an
* invocation of a generic type, or null if it is not.
* @since 1.5
*/
ParameterizedType asParameterizedType();
/**
* Return this type as a <code>TypeVariable</code> if it represents
* a type variable. Array dimensions are ignored.
*
* @return a <code>TypeVariable</code> if the type is a type variable,
* or null if it is not.
* @since 1.5
*/
TypeVariable asTypeVariable();
/**
* Return this type as a <code>WildcardType</code> if it represents
* a wildcard type.
*
* @return a <code>WildcardType</code> if the type is a wildcard type,
* or null if it is not.
* @since 1.5
*/
WildcardType asWildcardType();
/**
* Returns this type as a <code>AnnotatedType</code> if it represents
* an annotated type.
*
* @return a <code>AnnotatedType</code> if the type if an annotated type,
* or null if it is not
* @since 1.8
*/
AnnotatedType asAnnotatedType();
/**
* Return this type as an <code>AnnotationTypeDoc</code> if it represents
* an annotation type. Array dimensions are ignored.
*
* @return an <code>AnnotationTypeDoc</code> if the type is an annotation
* type, or null if it is not.
* @since 1.5
*/
AnnotationTypeDoc asAnnotationTypeDoc();
/**
* If this type is an array type, return the element type of the
* array. Otherwise, return null.
*
* @return a <code>Type</code> representing the element type or null.
* @since 1.8
*/
Type getElementType();
}

View File

@@ -0,0 +1,65 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a type variable.
* For example, the generic interface {@code List<E>} has a single
* type variable {@code E}.
* A type variable may have explicit bounds, as in
* {@code C<R extends Remote>}.
*
* @author Scott Seligman
* @since 1.5
*/
public interface TypeVariable extends Type {
/**
* Return the bounds of this type variable.
* These are the types given by the <i>extends</i> clause.
* Return an empty array if there are no explicit bounds.
*
* @return the bounds of this type variable.
*/
Type[] bounds();
/**
* Return the class, interface, method, or constructor within
* which this type variable is declared.
*
* @return the class, interface, method, or constructor within
* which this type variable is declared.
*/
ProgramElementDoc owner();
/**
* Get the annotations of this program element.
* Return an empty array if there are none.
*/
public AnnotationDesc[] annotations();
}

View File

@@ -0,0 +1,61 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.javadoc;
/**
* Represents a wildcard type argument.
* Examples include: <pre>
* {@code <?>}
* {@code <? extends E>}
* {@code <? super T>}
* </pre>
* A wildcard type can have explicit <i>extends</i> bounds
* or explicit <i>super</i> bounds or neither, but not both.
*
* @author Scott Seligman
* @since 1.5
*/
public interface WildcardType extends Type {
/**
* Return the upper bounds of this wildcard type argument
* as given by the <i>extends</i> clause.
* Return an empty array if no such bounds are explicitly given.
*
* @return the extends bounds of this wildcard type argument
*/
Type[] extendsBounds();
/**
* Return the lower bounds of this wildcard type argument
* as given by the <i>super</i> clause.
* Return an empty array if no such bounds are explicitly given.
*
* @return the super bounds of this wildcard type argument
*/
Type[] superBounds();
}

View File

@@ -0,0 +1,148 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
The Doclet API (also called the Javadoc API) provides a mechanism
for clients to inspect the source-level structure of programs and
libraries, including javadoc comments embedded in the source.
This is useful for documentation, program checking, automatic
code generation and many other tools.
<p>
Doclets are invoked by javadoc and use this API to write out
program information to files. For example, the standard doclet is called
by default and writes out documentation to HTML files.
<p>
The invocation is defined by the abstract {@link com.sun.javadoc.Doclet} class
-- the entry point is the {@link com.sun.javadoc.Doclet#start(RootDoc) start} method:
<pre>
public static boolean <b>start</b>(RootDoc root)
</pre>
The {@link com.sun.javadoc.RootDoc} instance holds the root of the program structure
information. From this root all other program structure
information can be extracted.
<p>
<a name="terminology"></a>
<h3>Terminology</h3>
<a name="included"></a>
When calling javadoc, you pass in package names and source file names --
these are called the <em>specified</em> packages and classes.
You also pass in Javadoc options; the <em>access control</em> Javadoc options
(<code>-public</code>, <code>-protected</code>, <code>-package</code>,
and <code>-private</code>) filter program elements, producing a
result set, called the <em>included</em> set, or "documented" set.
(The unfiltered set is also available through
{@link com.sun.javadoc.PackageDoc#allClasses(boolean) allClasses(false)}.)
<p>
<a name="class"></a>
Throughout this API, the term <em>class</em> is normally a
shorthand for "class or interface", as in: {@link com.sun.javadoc.ClassDoc},
{@link com.sun.javadoc.PackageDoc#allClasses() allClasses()}, and
{@link com.sun.javadoc.PackageDoc#findClass(String) findClass(String)}.
In only a couple of other places, it means "class, as opposed to interface",
as in: {@link com.sun.javadoc.Doc#isClass()}.
In the second sense, this API calls out four kinds of classes:
{@linkplain com.sun.javadoc.Doc#isOrdinaryClass() ordinary classes},
{@linkplain com.sun.javadoc.Doc#isEnum() enums},
{@linkplain com.sun.javadoc.Doc#isError() errors} and
{@linkplain com.sun.javadoc.Doc#isException() exceptions}.
Throughout the API, the detailed description of each program element
describes explicitly which meaning is being used.
<p>
<a name="qualified"></a>
A <em>qualified</em> class or interface name is one that has its package
name prepended to it, such as <code>java.lang.String</code>. A non-qualified
name has no package name, such as <code>String</code>.
<p>
<a name="example"></a>
<h3>Example</h3>
The following is an example doclet that
displays information in the <code>@param</code> tags of the processed
classes:
<pre>
import com.sun.javadoc.*;
public class ListParams extends <font color=red title="Doclet API">Doclet</font> {
public static boolean start(<font color=red title="Doclet API">RootDoc</font> root) {
<font color=red title="Doclet API">ClassDoc</font>[] classes = root.<font color=red title="Doclet API">classes</font>();
for (int i = 0; i < classes.length; ++i) {
<font color=red title="Doclet API">ClassDoc</font> cd = classes[i];
printMembers(cd.<font color=red title="Doclet API">constructors</font>());
printMembers(cd.<font color=red title="Doclet API">methods</font>());
}
return true;
}
static void printMembers(<font color=red title="Doclet API">ExecutableMemberDoc</font>[] mems) {
for (int i = 0; i < mems.length; ++i) {
<font color=red title="Doclet API">ParamTag</font>[] params = mems[i].<font color=red title="Doclet API">paramTags</font>();
System.out.println(mems[i].<font color=red title="Doclet API">qualifiedName</font>());
for (int j = 0; j < params.length; ++j) {
System.out.println(" " + params[j].<font color=red title="Doclet API">parameterName</font>()
+ " - " + params[j].<font color=red title="Doclet API">parameterComment</font>());
}
}
}
}
</pre>
Interfaces and methods from the Javadoc API are marked in
<font color=red title="Doclet API">red</font>.
{@link com.sun.javadoc.Doclet Doclet} is an abstract class that specifies
the invocation interface for doclets,
{@link com.sun.javadoc.Doclet Doclet} holds class or interface information,
{@link com.sun.javadoc.ExecutableMemberDoc} is a
superinterface of {@link com.sun.javadoc.MethodDoc} and
{@link com.sun.javadoc.ConstructorDoc},
and {@link com.sun.javadoc.ParamTag} holds information
from "<code>@param</code>" tags.
<p>
This doclet when invoked with a command line like:
<pre>
javadoc -doclet ListParams -sourcepath &lt;source-location&gt; java.util
</pre>
producing output like:
<pre>
...
java.util.ArrayList.add
index - index at which the specified element is to be inserted.
element - element to be inserted.
java.util.ArrayList.remove
index - the index of the element to removed.
...
</pre>
@see com.sun.javadoc.Doclet
@see com.sun.javadoc.RootDoc
*/
@jdk.Exported
package com.sun.javadoc;