com.sun.tdk.signaturetest.model
Class MemberDescription

java.lang.Object
  extended by com.sun.tdk.signaturetest.model.MemberDescription
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ClassDescription, ConstructorDescr, FieldDescr, InnerDescr, MethodDescr, SuperClass, SuperInterface

public abstract class MemberDescription
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

MemberDescription describes a class member, such as field, or method, or constructor, or nested class or interface. It contains all modifiers, type for field or returned type for method, name, types of method's or constructor's arguments, and declared exceptions. It does not keep any ``extends ...'' nor ``implements ...'' information for nested class.

See Also:
Serialized Form

Field Summary
static java.lang.String ARGS_DELIMITER
           
static char CLASS_DELIMITER
           
protected  char delimiter
           
static java.lang.String EMPTY_THROW_LIST
           
static java.lang.String JAVA_LANG
           
static char MEMBER_DELIMITER
           
static java.lang.String NO_ARGS
           
static java.lang.String NO_DECLARING_CLASS
           
static java.lang.String NO_TYPE
           
static java.lang.String THROWS_DELIMITER
           
 
Constructor Summary
protected MemberDescription(MemberType memberType, char delimiter)
           
 
Method Summary
protected  void addDependency(java.util.Set dependences, java.lang.String newDependency)
           
 void addModifier(Modifier mod)
           
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 AnnotationItem[] getAnnoList()
           
 java.lang.String getArgs()
           
protected static java.lang.String getClassShortName(java.lang.String fqn)
           
 java.lang.String getDeclaringClassName()
          Display qualified name of the class or interface declaring this item.
 MemberType getMemberType()
           
 int getModifiers()
          Return Set of Modifier assigned to this item.
 java.lang.String getName()
           
protected static java.lang.String getPackageName(java.lang.String fqn)
           
 java.lang.String getQualifiedName()
           
 java.lang.String getSimplifiedArgs()
          Converts qualified list of member arguments to simplified 1.
 java.lang.String getSimplifiedType()
          Converts qualified member type to simplified 1.
 java.lang.String getThrowables()
          Returns list of exception names separated by commas declared in the throws clause for that method or constructor described by this item.
static java.lang.String getThrows(java.lang.String[] xthrows)
           
 java.lang.String getType()
          Display return-type if this describes some method, or type of the field if this describes some field.
static java.lang.String getTypeName(java.lang.Class c)
           
static java.lang.String getTypeName(java.lang.String className)
           
 java.lang.String getTypeParameters()
           
 int hashCode()
           
 boolean hasModifier(Modifier mod)
           
 boolean isAbstract()
          Check if modifiers list for this item contains the "abstract" string.
 boolean isClass()
          Check if this is a class item.
abstract  boolean isCompatible(MemberDescription m)
           
 boolean isConstructor()
          Check if this item describes some constructor.
 boolean isField()
          Check if this item describes some field.
 boolean isFinal()
           
 boolean isInner()
           
 boolean isInterface()
          Check if modifiers list for this item contains the "interface" string.
 boolean isMarked()
           
 boolean isMethod()
          Check if this item describes some method.
 boolean isPrivate()
          Check if modifiers list for this item contains the "private" string.
 boolean isProtected()
          Check if modifiers list for this item contains the "protected" string.
 boolean isPublic()
          Check if modifiers list for this item contains the "public" string.
 boolean isStatic()
          Check if modifiers list for this item contains the "static" string.
 boolean isSuperClass()
          Check if this item describes superclass for some class.
 boolean isSuperInterface()
          Check if this item describes interface class for some class.
 void mark()
           
protected  void populateDependences(java.util.Set dependences)
           
 void removeModifier(Modifier mod)
           
 void setAnnoList(AnnotationItem[] annoList)
           
 boolean setArgs(java.lang.String args)
           
 void setDeclaringClass(java.lang.String declaringClass)
           
 void setModifiers(int access)
           
 void setNoDeclaringClass()
           
 boolean setThrowables(java.lang.String throwables)
           
 boolean setType(java.lang.String type)
           
 void setTypeParameters(java.lang.String typeParameters)
           
 void setupClassName(java.lang.String fqn)
           
 void setupClassName(java.lang.String fqn, java.lang.String outerName)
           
 void setupGenericClassName(java.lang.String superClassName)
           
 void setupGenericClassName(java.lang.String superClassName, java.lang.String outer)
           
 void setupInnerClassName(java.lang.String name, java.lang.String declaringClassName)
           
 void setupMemberName(java.lang.String fqn)
           
 void setupMemberName(java.lang.String own, java.lang.String dcl)
           
 void unmark()
           
static java.lang.String valueToString(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_THROW_LIST

public static final java.lang.String EMPTY_THROW_LIST
See Also:
Constant Field Values

NO_ARGS

public static final java.lang.String NO_ARGS
See Also:
Constant Field Values

NO_TYPE

public static final java.lang.String NO_TYPE
See Also:
Constant Field Values

NO_DECLARING_CLASS

public static final java.lang.String NO_DECLARING_CLASS
See Also:
Constant Field Values

THROWS_DELIMITER

public static final java.lang.String THROWS_DELIMITER
See Also:
Constant Field Values

ARGS_DELIMITER

public static final java.lang.String ARGS_DELIMITER
See Also:
Constant Field Values

JAVA_LANG

public static final java.lang.String JAVA_LANG
See Also:
Constant Field Values

CLASS_DELIMITER

public static final char CLASS_DELIMITER
See Also:
Constant Field Values

MEMBER_DELIMITER

public static final char MEMBER_DELIMITER
See Also:
Constant Field Values

delimiter

protected final char delimiter
Constructor Detail

MemberDescription

protected MemberDescription(MemberType memberType,
                            char delimiter)
Method Detail

clone

public final java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getMemberType

public MemberType getMemberType()

getName

public java.lang.String getName()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

isClass

public boolean isClass()
Check if this is a class item.


isSuperClass

public boolean isSuperClass()
Check if this item describes superclass for some class. (I.e., check if this describes ``extends ...'' suffix for some ClassDescription.)


isSuperInterface

public boolean isSuperInterface()
Check if this item describes interface class for some class. (I.e., check if this describes some of interface name(s) in ``implements ...'' suffix for some ClassDescription.)


isField

public boolean isField()
Check if this item describes some field.


isMethod

public boolean isMethod()
Check if this item describes some method.


isConstructor

public boolean isConstructor()
Check if this item describes some constructor.


isInner

public boolean isInner()

getModifiers

public int getModifiers()
Return Set of Modifier assigned to this item.

See Also:
Modifier

getType

public java.lang.String getType()
Display return-type if this describes some method, or type of the field if this describes some field.


getTypeParameters

public java.lang.String getTypeParameters()

setupGenericClassName

public void setupGenericClassName(java.lang.String superClassName,
                                  java.lang.String outer)

setupGenericClassName

public void setupGenericClassName(java.lang.String superClassName)

setupClassName

public void setupClassName(java.lang.String fqn,
                           java.lang.String outerName)

setupClassName

public void setupClassName(java.lang.String fqn)

setupInnerClassName

public void setupInnerClassName(java.lang.String name,
                                java.lang.String declaringClassName)

setupMemberName

public void setupMemberName(java.lang.String own,
                            java.lang.String dcl)

setupMemberName

public void setupMemberName(java.lang.String fqn)

getDeclaringClassName

public java.lang.String getDeclaringClassName()
Display qualified name of the class or interface declaring this item. Empty string is returned if this item describes top-level class or interface, which is not inner class or interface.


getAnnoList

public AnnotationItem[] getAnnoList()

getQualifiedName

public java.lang.String getQualifiedName()

getThrowables

public java.lang.String getThrowables()
Returns list of exception names separated by commas declared in the throws clause for that method or constructor described by this item.


mark

public void mark()

unmark

public void unmark()

isMarked

public boolean isMarked()

isProtected

public boolean isProtected()
Check if modifiers list for this item contains the "protected" string.


isPublic

public boolean isPublic()
Check if modifiers list for this item contains the "public" string.


isPrivate

public boolean isPrivate()
Check if modifiers list for this item contains the "private" string.


isAbstract

public boolean isAbstract()
Check if modifiers list for this item contains the "abstract" string.


isStatic

public boolean isStatic()
Check if modifiers list for this item contains the "static" string.


isFinal

public boolean isFinal()

isInterface

public boolean isInterface()
Check if modifiers list for this item contains the "interface" string.


valueToString

public static java.lang.String valueToString(java.lang.Object value)

setModifiers

public void setModifiers(int access)

addModifier

public void addModifier(Modifier mod)

removeModifier

public void removeModifier(Modifier mod)

getTypeName

public static java.lang.String getTypeName(java.lang.Class c)

getTypeName

public static java.lang.String getTypeName(java.lang.String className)

getArgs

public java.lang.String getArgs()

getSimplifiedType

public java.lang.String getSimplifiedType()
Converts qualified member type to simplified 1. Classes from package java.lang referenced by their simple name 2. Classes from the same package referenced by their simple name 3. The others are qualified.

Returns:

getSimplifiedArgs

public java.lang.String getSimplifiedArgs()
Converts qualified list of member arguments to simplified 1. Classes from package java.lang referenced by their simple name 2. Classes from the same package referenced by their simple name 3. The others are qualified.

Returns:

setType

public boolean setType(java.lang.String type)

setArgs

public boolean setArgs(java.lang.String args)

setThrowables

public boolean setThrowables(java.lang.String throwables)

setAnnoList

public void setAnnoList(AnnotationItem[] annoList)

setTypeParameters

public void setTypeParameters(java.lang.String typeParameters)

setDeclaringClass

public void setDeclaringClass(java.lang.String declaringClass)

setNoDeclaringClass

public void setNoDeclaringClass()

getThrows

public static java.lang.String getThrows(java.lang.String[] xthrows)

hasModifier

public boolean hasModifier(Modifier mod)

isCompatible

public abstract boolean isCompatible(MemberDescription m)

populateDependences

protected void populateDependences(java.util.Set dependences)

addDependency

protected void addDependency(java.util.Set dependences,
                             java.lang.String newDependency)

getClassShortName

protected static java.lang.String getClassShortName(java.lang.String fqn)

getPackageName

protected static java.lang.String getPackageName(java.lang.String fqn)