org.codehaus.groovy.tools.groovydoc
Class SimpleGroovyClassDoc

java.lang.Object
  extended by org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc
      extended by org.codehaus.groovy.tools.groovydoc.SimpleGroovyProgramElementDoc
          extended by org.codehaus.groovy.tools.groovydoc.SimpleGroovyClassDoc
All Implemented Interfaces:
java.lang.Comparable, GroovyTokenTypes, GroovyClassDoc, GroovyDoc, GroovyProgramElementDoc, GroovyType

public class SimpleGroovyClassDoc
extends SimpleGroovyProgramElementDoc
implements GroovyClassDoc


Field Summary
private static java.util.regex.Pattern CODE_REGEX
           
private  java.util.List<GroovyConstructorDoc> constructors
           
private  java.util.List<GroovyFieldDoc> enumConstants
           
private  java.util.List<GroovyFieldDoc> fields
           
private  java.lang.String fullPathName
           
private  java.util.List<java.lang.String> importedClassesAndPackages
           
private  java.util.List<GroovyClassDoc> interfaceClasses
           
private  java.util.List<java.lang.String> interfaceNames
           
private static java.util.regex.Pattern LINK_REGEX
           
private  java.util.List<LinkArgument> links
           
private  java.util.List<GroovyMethodDoc> methods
           
private  java.util.List<GroovyClassDoc> nested
           
private  GroovyClassDoc outer
           
private  java.util.List<GroovyFieldDoc> properties
           
private  GroovyClassDoc superClass
           
private  java.lang.String superClassName
           
private static java.util.regex.Pattern TAG_REGEX
           
 
Fields inherited from interface org.codehaus.groovy.antlr.parser.GroovyTokenTypes
ABSTRACT, ANNOTATION, ANNOTATION_ARRAY_INIT, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, ANNOTATION_MEMBER_VALUE_PAIR, ANNOTATIONS, ARRAY_DECLARATOR, ASSIGN, AT, BAND, BAND_ASSIGN, BIG_SUFFIX, BLOCK, BNOT, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, CASE_GROUP, CLASS_DEF, CLOSABLE_BLOCK, CLOSABLE_BLOCK_OP, CLOSURE_LIST, COLON, COMMA, COMPARE_TO, CTOR_CALL, CTOR_IDENT, DEC, DIGIT, DIV, DIV_ASSIGN, DOLLAR, DOT, DYNAMIC_MEMBER, ELIST, ELVIS_OPERATOR, EMPTY_STAT, ENUM_CONSTANT_DEF, ENUM_DEF, EOF, EQUAL, ESC, EXPONENT, EXPR, EXTENDS_CLAUSE, FINAL, FLOAT_SUFFIX, FOR_CONDITION, FOR_EACH_CLAUSE, FOR_IN_ITERABLE, FOR_INIT, FOR_ITERATOR, GE, GT, HEX_DIGIT, IDENT, IMPLEMENTS_CLAUSE, IMPLICIT_PARAMETERS, IMPORT, INC, INDEX_OP, INSTANCE_INIT, INTERFACE_DEF, LABELED_ARG, LABELED_STAT, LAND, LBRACK, LCURLY, LE, LETTER, LIST_CONSTRUCTOR, LITERAL_as, LITERAL_assert, LITERAL_boolean, LITERAL_break, LITERAL_byte, LITERAL_case, LITERAL_catch, LITERAL_char, LITERAL_class, LITERAL_continue, LITERAL_def, LITERAL_default, LITERAL_double, LITERAL_else, LITERAL_enum, LITERAL_extends, LITERAL_false, LITERAL_finally, LITERAL_float, LITERAL_for, LITERAL_if, LITERAL_implements, LITERAL_import, LITERAL_in, LITERAL_instanceof, LITERAL_int, LITERAL_interface, LITERAL_long, LITERAL_native, LITERAL_new, LITERAL_null, LITERAL_package, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_return, LITERAL_short, LITERAL_static, LITERAL_super, LITERAL_switch, LITERAL_synchronized, LITERAL_this, LITERAL_threadsafe, LITERAL_throw, LITERAL_throws, LITERAL_transient, LITERAL_true, LITERAL_try, LITERAL_void, LITERAL_volatile, LITERAL_while, LNOT, LOR, LPAREN, LT, MAP_CONSTRUCTOR, MEMBER_POINTER, METHOD_CALL, METHOD_DEF, MINUS, MINUS_ASSIGN, ML_COMMENT, MOD, MOD_ASSIGN, MODIFIERS, NLS, NOT_EQUAL, NULL_TREE_LOOKAHEAD, NUM_BIG_DECIMAL, NUM_BIG_INT, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJBLOCK, ONE_NL, OPTIONAL_DOT, PACKAGE_DEF, PARAMETER_DEF, PARAMETERS, PLUS, PLUS_ASSIGN, POST_DEC, POST_INC, QUESTION, RANGE_EXCLUSIVE, RANGE_INCLUSIVE, RBRACK, RCURLY, REGEX_FIND, REGEX_MATCH, REGEXP_CTOR_END, REGEXP_LITERAL, REGEXP_SYMBOL, RPAREN, SELECT_SLOT, SEMI, SH_COMMENT, SL, SL_ASSIGN, SL_COMMENT, SLIST, SPREAD_ARG, SPREAD_DOT, SPREAD_MAP_ARG, SR, SR_ASSIGN, STAR, STAR_ASSIGN, STAR_STAR, STAR_STAR_ASSIGN, STATIC_IMPORT, STATIC_INIT, STRICTFP, STRING_CH, STRING_CONSTRUCTOR, STRING_CTOR_END, STRING_CTOR_MIDDLE, STRING_CTOR_START, STRING_LITERAL, STRING_NL, SUPER_CTOR_CALL, TRIPLE_DOT, TYPE, TYPE_ARGUMENT, TYPE_ARGUMENTS, TYPE_LOWER_BOUNDS, TYPE_PARAMETER, TYPE_PARAMETERS, TYPE_UPPER_BOUNDS, TYPECAST, UNARY_MINUS, UNARY_PLUS, UNUSED_CONST, UNUSED_DO, UNUSED_GOTO, VARIABLE_DEF, VARIABLE_PARAMETER_DEF, VOCAB, WILDCARD_TYPE, WS
 
Constructor Summary
SimpleGroovyClassDoc(java.util.List<java.lang.String> importedClassesAndPackages, java.lang.String name)
           
SimpleGroovyClassDoc(java.util.List<java.lang.String> importedClassesAndPackages, java.lang.String name, java.util.List<LinkArgument> links)
           
 
Method Summary
 boolean add(GroovyConstructorDoc constructor)
           
 boolean add(GroovyFieldDoc field)
           
 boolean add(GroovyMethodDoc method)
           
 boolean addEnumConstant(GroovyFieldDoc field)
           
 void addInterfaceName(java.lang.String className)
           
 boolean addNested(GroovyClassDoc nestedClass)
           
 boolean addProperty(GroovyFieldDoc property)
           
private  java.lang.String buildUrl(java.lang.String relativeRoot, java.lang.String[] target, java.lang.String shortClassName)
           
 GroovyConstructorDoc[] constructors()
          returns a sorted array of constructors
 GroovyConstructorDoc[] constructors(boolean filter)
           
private  java.lang.String decodeSpecialSymbols(java.lang.String text)
           
 boolean definesSerializableFields()
           
private  java.lang.String encodeSpecialSymbols(java.lang.String text)
           
 GroovyFieldDoc[] enumConstants()
          returns a sorted array of enum constants
 GroovyFieldDoc[] fields()
          returns a sorted array of fields
 GroovyFieldDoc[] fields(boolean filter)
           
 GroovyClassDoc findClass(java.lang.String className)
           
private  java.lang.Class getClassOf(java.lang.String next)
           
 java.lang.String getDocUrl(java.lang.String type)
           
 java.lang.String getDocUrl(java.lang.String type, boolean full)
           
 java.lang.String getFullPathName()
           
private  java.util.Set<GroovyClassDoc> getJavaInterfaces(ExternalGroovyClassDoc d)
           
 GroovyClassDoc getOuter()
           
 java.util.List<GroovyClassDoc> getParentClasses()
           
 java.util.Set<GroovyClassDoc> getParentInterfaces()
           
 java.lang.String getRelativeRootPath()
           
 java.lang.String getSuperClassName()
           
 GroovyClassDoc[] importedClasses()
           
 GroovyPackageDoc[] importedPackages()
           
 GroovyClassDoc[] innerClasses()
          returns a sorted array of nested classes and interfaces
 GroovyClassDoc[] innerClasses(boolean filter)
           
 GroovyClassDoc[] interfaces()
           
 GroovyType[] interfaceTypes()
           
 boolean isAbstract()
           
 boolean isExternalizable()
           
 boolean isPrimitive()
           
 boolean isSerializable()
           
 GroovyMethodDoc[] methods()
          returns a sorted array of methods
 GroovyMethodDoc[] methods(boolean filter)
           
 GroovyFieldDoc[] properties()
          returns a sorted array of properties
 java.lang.String qualifiedTypeName()
          The qualified name of this type excluding any dimension information.
 java.lang.String replaceAllTags(java.lang.String self, java.lang.String s1, java.lang.String s2, java.util.regex.Pattern regex)
           
 java.lang.String replaceTags(java.lang.String comment)
           
(package private)  void resolve(GroovyRootDoc rootDoc)
           
private  GroovyClassDoc resolveClass(GroovyRootDoc rootDoc, java.lang.String name)
           
private  java.lang.Class resolveExternalClass(java.lang.String name)
           
private  java.lang.Class resolveExternalClassFromImport(java.lang.String name)
           
 GroovyFieldDoc[] serializableFields()
           
 GroovyMethodDoc[] serializationMethods()
           
 void setFullPathName(java.lang.String fullPathName)
           
 void setOuter(GroovyClassDoc outer)
           
 void setRawCommentText(java.lang.String rawCommentText)
           
 void setSuperClass(GroovyClassDoc doc)
           
 void setSuperClassName(java.lang.String className)
           
 java.lang.String simpleTypeName()
          The unqualified name of this type excluding any dimension or nesting information.
 boolean subclassOf(GroovyClassDoc gcd)
           
 GroovyClassDoc superclass()
           
 GroovyType superclassType()
           
 java.lang.String typeName()
          The unqualified name of this type excluding any dimension information.
 
Methods inherited from class org.codehaus.groovy.tools.groovydoc.SimpleGroovyProgramElementDoc
addAnnotationRef, annotations, containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier, qualifiedName, setContainingPackage, setFinal, setPrivate, setProtected, setPublic, setStatic
 
Methods inherited from class org.codehaus.groovy.tools.groovydoc.SimpleGroovyDoc
calculateFirstSentence, commentText, compareTo, firstSentenceCommentText, getRawCommentText, getTypeDescription, getTypeSourceDescription, isAnnotationType, isAnnotationTypeElement, isClass, isConstructor, isDeprecated, isEnum, isEnumConstant, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, name, setCommentText, setDeprecated, setFirstSentenceCommentText, setTokenType, tags, tokenType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.codehaus.groovy.groovydoc.GroovyType
toString
 
Methods inherited from interface org.codehaus.groovy.groovydoc.GroovyProgramElementDoc
annotations, containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier, qualifiedName
 
Methods inherited from interface org.codehaus.groovy.groovydoc.GroovyDoc
commentText, firstSentenceCommentText, getRawCommentText, isAnnotationType, isAnnotationTypeElement, isClass, isConstructor, isDeprecated, isEnum, isEnumConstant, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, name
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

TAG_REGEX

private static final java.util.regex.Pattern TAG_REGEX

LINK_REGEX

private static final java.util.regex.Pattern LINK_REGEX

CODE_REGEX

private static final java.util.regex.Pattern CODE_REGEX

constructors

private final java.util.List<GroovyConstructorDoc> constructors

fields

private final java.util.List<GroovyFieldDoc> fields

properties

private final java.util.List<GroovyFieldDoc> properties

enumConstants

private final java.util.List<GroovyFieldDoc> enumConstants

methods

private final java.util.List<GroovyMethodDoc> methods

importedClassesAndPackages

private final java.util.List<java.lang.String> importedClassesAndPackages

interfaceNames

private final java.util.List<java.lang.String> interfaceNames

interfaceClasses

private final java.util.List<GroovyClassDoc> interfaceClasses

nested

private final java.util.List<GroovyClassDoc> nested

links

private final java.util.List<LinkArgument> links

superClass

private GroovyClassDoc superClass

outer

private GroovyClassDoc outer

superClassName

private java.lang.String superClassName

fullPathName

private java.lang.String fullPathName
Constructor Detail

SimpleGroovyClassDoc

public SimpleGroovyClassDoc(java.util.List<java.lang.String> importedClassesAndPackages,
                            java.lang.String name,
                            java.util.List<LinkArgument> links)

SimpleGroovyClassDoc

public SimpleGroovyClassDoc(java.util.List<java.lang.String> importedClassesAndPackages,
                            java.lang.String name)
Method Detail

constructors

public GroovyConstructorDoc[] constructors()
returns a sorted array of constructors

Specified by:
constructors in interface GroovyClassDoc

add

public boolean add(GroovyConstructorDoc constructor)

getOuter

public GroovyClassDoc getOuter()

setOuter

public void setOuter(GroovyClassDoc outer)

innerClasses

public GroovyClassDoc[] innerClasses()
returns a sorted array of nested classes and interfaces

Specified by:
innerClasses in interface GroovyClassDoc

addNested

public boolean addNested(GroovyClassDoc nestedClass)

fields

public GroovyFieldDoc[] fields()
returns a sorted array of fields

Specified by:
fields in interface GroovyClassDoc

add

public boolean add(GroovyFieldDoc field)

properties

public GroovyFieldDoc[] properties()
returns a sorted array of properties

Specified by:
properties in interface GroovyClassDoc

addProperty

public boolean addProperty(GroovyFieldDoc property)

enumConstants

public GroovyFieldDoc[] enumConstants()
returns a sorted array of enum constants

Specified by:
enumConstants in interface GroovyClassDoc

addEnumConstant

public boolean addEnumConstant(GroovyFieldDoc field)

methods

public GroovyMethodDoc[] methods()
returns a sorted array of methods

Specified by:
methods in interface GroovyClassDoc

add

public boolean add(GroovyMethodDoc method)

getSuperClassName

public java.lang.String getSuperClassName()

setSuperClassName

public void setSuperClassName(java.lang.String className)

superclass

public GroovyClassDoc superclass()
Specified by:
superclass in interface GroovyClassDoc

setSuperClass

public void setSuperClass(GroovyClassDoc doc)

getFullPathName

public java.lang.String getFullPathName()
Specified by:
getFullPathName in interface GroovyClassDoc

setFullPathName

public void setFullPathName(java.lang.String fullPathName)

getRelativeRootPath

public java.lang.String getRelativeRootPath()
Specified by:
getRelativeRootPath in interface GroovyClassDoc

getParentClasses

public java.util.List<GroovyClassDoc> getParentClasses()

getParentInterfaces

public java.util.Set<GroovyClassDoc> getParentInterfaces()

getJavaInterfaces

private java.util.Set<GroovyClassDoc> getJavaInterfaces(ExternalGroovyClassDoc d)

getClassOf

private java.lang.Class getClassOf(java.lang.String next)

resolve

void resolve(GroovyRootDoc rootDoc)

getDocUrl

public java.lang.String getDocUrl(java.lang.String type)

getDocUrl

public java.lang.String getDocUrl(java.lang.String type,
                                  boolean full)

buildUrl

private java.lang.String buildUrl(java.lang.String relativeRoot,
                                  java.lang.String[] target,
                                  java.lang.String shortClassName)

resolveClass

private GroovyClassDoc resolveClass(GroovyRootDoc rootDoc,
                                    java.lang.String name)

resolveExternalClassFromImport

private java.lang.Class resolveExternalClassFromImport(java.lang.String name)

resolveExternalClass

private java.lang.Class resolveExternalClass(java.lang.String name)

constructors

public GroovyConstructorDoc[] constructors(boolean filter)
Specified by:
constructors in interface GroovyClassDoc

definesSerializableFields

public boolean definesSerializableFields()
Specified by:
definesSerializableFields in interface GroovyClassDoc

fields

public GroovyFieldDoc[] fields(boolean filter)
Specified by:
fields in interface GroovyClassDoc

findClass

public GroovyClassDoc findClass(java.lang.String className)
Specified by:
findClass in interface GroovyClassDoc

importedClasses

public GroovyClassDoc[] importedClasses()
Specified by:
importedClasses in interface GroovyClassDoc

importedPackages

public GroovyPackageDoc[] importedPackages()
Specified by:
importedPackages in interface GroovyClassDoc

innerClasses

public GroovyClassDoc[] innerClasses(boolean filter)
Specified by:
innerClasses in interface GroovyClassDoc

interfaces

public GroovyClassDoc[] interfaces()
Specified by:
interfaces in interface GroovyClassDoc

interfaceTypes

public GroovyType[] interfaceTypes()
Specified by:
interfaceTypes in interface GroovyClassDoc

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface GroovyClassDoc

isExternalizable

public boolean isExternalizable()
Specified by:
isExternalizable in interface GroovyClassDoc

isSerializable

public boolean isSerializable()
Specified by:
isSerializable in interface GroovyClassDoc

methods

public GroovyMethodDoc[] methods(boolean filter)
Specified by:
methods in interface GroovyClassDoc

serializableFields

public GroovyFieldDoc[] serializableFields()
Specified by:
serializableFields in interface GroovyClassDoc

serializationMethods

public GroovyMethodDoc[] serializationMethods()
Specified by:
serializationMethods in interface GroovyClassDoc

subclassOf

public boolean subclassOf(GroovyClassDoc gcd)
Specified by:
subclassOf in interface GroovyClassDoc

superclassType

public GroovyType superclassType()
Specified by:
superclassType in interface GroovyClassDoc

isPrimitive

public boolean isPrimitive()
Specified by:
isPrimitive in interface GroovyType

qualifiedTypeName

public java.lang.String qualifiedTypeName()
Description copied from interface: GroovyType
The qualified name of this type excluding any dimension information. For example, a two dimensional array of String returns "java.lang.String".

Specified by:
qualifiedTypeName in interface GroovyType

simpleTypeName

public java.lang.String simpleTypeName()
Description copied from interface: GroovyType
The unqualified name of this type excluding any dimension or nesting information. For example, the class Outer.Inner returns "Inner".

Specified by:
simpleTypeName in interface GroovyType

typeName

public java.lang.String typeName()
Description copied from interface: GroovyType
The unqualified name of this type excluding any dimension information. For example, a two dimensional array of String returns "String".

Specified by:
typeName in interface GroovyType

addInterfaceName

public void addInterfaceName(java.lang.String className)

setRawCommentText

public void setRawCommentText(java.lang.String rawCommentText)
Specified by:
setRawCommentText in interface GroovyDoc
Overrides:
setRawCommentText in class SimpleGroovyDoc

replaceTags

public java.lang.String replaceTags(java.lang.String comment)

replaceAllTags

public java.lang.String replaceAllTags(java.lang.String self,
                                       java.lang.String s1,
                                       java.lang.String s2,
                                       java.util.regex.Pattern regex)

encodeSpecialSymbols

private java.lang.String encodeSpecialSymbols(java.lang.String text)

decodeSpecialSymbols

private java.lang.String decodeSpecialSymbols(java.lang.String text)


Copyright © ${year} The Codehaus. All Rights Reserved.