recoder.java.declaration
Class TypeParameterDeclaration
java.lang.Object
recoder.java.JavaSourceElement
recoder.java.JavaProgramElement
recoder.java.JavaNonTerminalProgramElement
recoder.java.declaration.JavaDeclaration
recoder.java.declaration.TypeDeclaration
recoder.java.declaration.TypeParameterDeclaration
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, ClassType, ClassTypeContainer, Member, ProgramModelElement, Type, TypeParameter, AccessFlags, Declaration, MemberDeclaration, TypeDeclarationContainer, NamedProgramElement, NonTerminalProgramElement, ProgramElement, TypeReferenceContainer, ScopeDefiningElement, SourceElement, TypeScope, VariableScope, ModelElement, NamedModelElement
public class TypeParameterDeclaration
- extends TypeDeclaration
- implements TypeReferenceContainer, TypeParameter
- Author:
- Tobias Gutzmann
- See Also:
- Serialized Form
| Fields inherited from interface recoder.bytecode.AccessFlags |
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Fields inherited from interface recoder.bytecode.AccessFlags |
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Fields inherited from interface recoder.bytecode.AccessFlags |
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE |
| Methods inherited from class recoder.java.declaration.TypeDeclaration |
createArrayType, getAllFields, getAllMethods, getAllSupertypes, getAllTypes, getArrayType, getASTParent, getBinaryName, getConstructors, getContainer, getContainingClassType, getErasedType, getFields, getFieldsInScope, getFullName, getIdentifier, getMemberParent, getMembers, getMethods, getName, getPackage, getParent, getProgramModelInfo, getSupertypes, getTypeDeclarationAt, getTypeDeclarationCount, getTypes, getTypesInScope, getVariableInScope, getVariablesInScope, isAbstract, isDefinedScope, isFinal, isPrivate, isProtected, isPublic, isStatic, isStrictFp, setDefinedScope, setIdentifier, setMemberParent, setMembers, setParent, setProgramModelInfo, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TypeParameterDeclaration
public TypeParameterDeclaration()
TypeParameterDeclaration
public TypeParameterDeclaration(Identifier name,
ASTList<TypeReference> bound)
TypeParameterDeclaration
protected TypeParameterDeclaration(TypeParameterDeclaration proto)
- Parameters:
proto -
getTypeReferenceCount
public int getTypeReferenceCount()
- Description copied from interface:
TypeReferenceContainer
- Get the number of type references in this container.
- Specified by:
getTypeReferenceCount in interface TypeReferenceContainer
- Returns:
- the number of type references.
getTypeReferenceAt
public TypeReference getTypeReferenceAt(int index)
- Specified by:
getTypeReferenceAt in interface TypeReferenceContainer
getChildCount
public int getChildCount()
- Description copied from interface:
NonTerminalProgramElement
- Returns the number of children of this node.
- Specified by:
getChildCount in interface NonTerminalProgramElement
- Returns:
- an int giving the number of children of this node
getChildAt
public ProgramElement getChildAt(int index)
- Description copied from interface:
NonTerminalProgramElement
- Returns the child at the specified index in this node's "virtual" child
array.
- Specified by:
getChildAt in interface NonTerminalProgramElement
- Parameters:
index - an index into this node's "virtual" child array
- Returns:
- the program element at the given position
getChildPositionCode
public int getChildPositionCode(ProgramElement child)
- Description copied from interface:
NonTerminalProgramElement
- Returns the positional code of the given child, or
-1 if
there is no such child. The result contains an encoding of the relative
position of the child as well as the role it has been playing in this
parent element. This information is required internally for proper undo
of transformations and is to be delivered to the detached method of the
ChangeHistory.
- Specified by:
getChildPositionCode in interface NonTerminalProgramElement
- Parameters:
child - the exact child to look for.
- Returns:
- the positional code of the given child, or
-1. - See Also:
ChangeHistory.detached(recoder.java.ProgramElement, recoder.java.NonTerminalProgramElement, int)
replaceChild
public boolean replaceChild(ProgramElement p,
ProgramElement q)
- Description copied from interface:
NonTerminalProgramElement
- Replace a single non-null child in the current node. The child to replace
is matched by identity and hence must be known exactly. The replacement
element can be null - in that case, the child is effectively removed. The
parent role of the new child is validated, while the parent link of the
replaced child is left untouched.
- Specified by:
replaceChild in interface NonTerminalProgramElement
- Parameters:
p - the old child.
- Returns:
- true if a replacement has occured, false otherwise.
accept
public void accept(SourceVisitor v)
- Description copied from interface:
SourceElement
- Receive a visitor, for instance a pretty printer.
- Specified by:
accept in interface SourceElement
- Parameters:
v - a source visitor.
deepClone
public TypeParameterDeclaration deepClone()
- Description copied from interface:
SourceElement
- Creates a deep clone of the current source element. For
NonTerminalProgramElements, the parent roles are valid, except
that the root element is not included anywhere and hence has no set
parents, of course. This method also clones Comment
s, but does not clone derived information such as scopes.
- Specified by:
deepClone in interface SourceElement- Specified by:
deepClone in class TypeDeclaration
makeParentRoleValid
public void makeParentRoleValid()
- Description copied from class:
TypeDeclaration
- Make parent role valid.
- Specified by:
makeParentRoleValid in interface NonTerminalProgramElement- Overrides:
makeParentRoleValid in class TypeDeclaration
validate
public void validate()
throws ModelException
- Description copied from class:
JavaProgramElement
- Defaults to do nothing.
- Specified by:
validate in interface ModelElement- Overrides:
validate in class JavaProgramElement
- Throws:
ModelException- See Also:
SemanticsChecker
isInterface
public boolean isInterface()
- Description copied from interface:
ClassType
- Checks if this class type denotes an interface (i.e. ordinary interface or annotation type).
- Specified by:
isInterface in interface ClassType- Specified by:
isInterface in class TypeDeclaration
- Returns:
true if this object represents an interface,
false otherwise.
isOrdinaryInterface
public boolean isOrdinaryInterface()
- Description copied from interface:
ClassType
- Checks if this class type denotes an ordinary (i.e. not annotation type) interface.
- Specified by:
isOrdinaryInterface in interface ClassType
- Returns:
true if this object represents an ordinary interface,
false otherwise.
isAnnotationType
public boolean isAnnotationType()
- Description copied from interface:
ClassType
- Checks if this class type denotes an annotation type
- Specified by:
isAnnotationType in interface ClassType
- Returns:
true if this object represents an annotation type,
false otherwise
isEnumType
public boolean isEnumType()
- Description copied from interface:
ClassType
- Checks if this class type denotes an enum type
- Specified by:
isEnumType in interface ClassType
- Returns:
true if this object represents an enum type,
false otherwise
isOrdinaryClass
public boolean isOrdinaryClass()
- Description copied from interface:
ClassType
- Checks if this class type denotes an ordinary (i.e. not an enum) class.
- Specified by:
isOrdinaryClass in interface ClassType
- Returns:
true if this object represents an ordinary class type,
false otherwise
getTypeParameters
public ASTList<TypeParameterDeclaration> getTypeParameters()
- Description copied from interface:
ClassType
- Returns the type parameters of this class type.
- Specified by:
getTypeParameters in interface ClassType- Specified by:
getTypeParameters in class TypeDeclaration
- Returns:
- the list of type parameters of this class type.
getBounds
public ASTList<TypeReference> getBounds()
getParameterName
public java.lang.String getParameterName()
- Specified by:
getParameterName in interface TypeParameter
getBoundCount
public int getBoundCount()
- Specified by:
getBoundCount in interface TypeParameter
getBoundName
public java.lang.String getBoundName(int boundidx)
- Specified by:
getBoundName in interface TypeParameter
getBoundTypeArguments
public ASTList<TypeArgumentDeclaration> getBoundTypeArguments(int boundidx)
- Specified by:
getBoundTypeArguments in interface TypeParameter
inheritanceEqual
public boolean inheritanceEqual(TypeParameter o)
- Description copied from interface:
TypeParameter
- ONLY FOR INTERNAL USE !!!
TODO 0.91 better documentation
- Specified by:
inheritanceEqual in interface TypeParameter
- Returns:
setBound
public void setBound(ASTList<TypeReference> bound)
getFirstElement
public SourceElement getFirstElement()
- Description copied from class:
JavaSourceElement
- Finds the source element that occurs first in the source. The default
implementation returns this element, which is correct for all terminal
program elements, and many non terminals such as statements and prefixed
operators.
- Specified by:
getFirstElement in interface SourceElement- Overrides:
getFirstElement in class TypeDeclaration
- Returns:
- the first source element in the syntactical representation of
this element, may be equals to this element.
- See Also:
JavaSourceElement.toSource(),
JavaSourceElement.getStartPosition()
getLastElement
public SourceElement getLastElement()
- Description copied from class:
JavaSourceElement
- Finds the source element that occurs last in the source. The default
implementation returns this element, which is correct for all terminal
program elements, and many non terminals such as statements and prefixed
operators.
- Specified by:
getLastElement in interface SourceElement- Overrides:
getLastElement in class TypeDeclaration
- Returns:
- the last source element in the syntactical representation of this
element, may be equals to this element.
- See Also:
JavaSourceElement.toSource(),
JavaSourceElement.getEndPosition()
getTypeInScope
public ClassType getTypeInScope(java.lang.String tname)
- Specified by:
getTypeInScope in interface TypeScope- Overrides:
getTypeInScope in class TypeDeclaration
addTypeToScope
public void addTypeToScope(ClassType type,
java.lang.String tname)
- Specified by:
addTypeToScope in interface TypeScope- Overrides:
addTypeToScope in class TypeDeclaration
addVariableToScope
public void addVariableToScope(VariableSpecification var)
- Specified by:
addVariableToScope in interface VariableScope- Overrides:
addVariableToScope in class TypeDeclaration
removeTypeFromScope
public void removeTypeFromScope(java.lang.String tname)
- Specified by:
removeTypeFromScope in interface TypeScope- Overrides:
removeTypeFromScope in class TypeDeclaration
removeVariableFromScope
public void removeVariableFromScope(java.lang.String tname)
- Specified by:
removeVariableFromScope in interface VariableScope- Overrides:
removeVariableFromScope in class TypeDeclaration
getFullSignature
public java.lang.String getFullSignature()
- Description copied from interface:
Type
- Returns a full type signature of this type,
i.e., the full name plus possible type arguments.
Works as
getFullName() on primitive types.
- Specified by:
getFullSignature in interface Type- Overrides:
getFullSignature in class TypeDeclaration
isInner
public boolean isInner()
- Description copied from interface:
ClassType
- Checks if this type is an inner class, as described in JLS, 3rd edition, §8.1.3
- Specified by:
isInner in interface ClassType
- Returns: