|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.jdt.core
Interface IType

- All Superinterfaces:
- org.eclipse.core.runtime.IAdaptable, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference
- public interface IType
- extends IMember
Represents either a source type in a compilation unit (either a top-level type, a member type, a local type or an anonymous type) or a binary type in a class file. Enumeration classes and annotation types are subkinds of classes and interfaces, respectively.
Note that the element name of an anonymous source type is always empty.
If a binary type cannot be parsed, its structure remains unknown.
Use IJavaElement.isStructureKnown to determine whether this
is the case.
The children are of type IMember, which includes IField,
IMethod, IInitializer and IType.
The children are listed in the order in which they appear in the source or class file.
This interface is not intended to be implemented by clients.
| Field Summary |
| Fields inherited from interface org.eclipse.jdt.core.IJavaElement |
CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE |
| Method Summary | |
void |
codeComplete(char[] snippet,
int insertion,
int position,
char[][] localVariableTypeNames,
char[][] localVariableNames,
int[] localVariableModifiers,
boolean isStatic,
ICompletionRequestor requestor)
Do code completion inside a code snippet in the context of the current type. |
void |
codeComplete(char[] snippet,
int insertion,
int position,
char[][] localVariableTypeNames,
char[][] localVariableNames,
int[] localVariableModifiers,
boolean isStatic,
ICompletionRequestor requestor,
WorkingCopyOwner owner)
Do code completion inside a code snippet in the context of the current type. |
IField |
createField(java.lang.String contents,
IJavaElement sibling,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a field in this type with the given contents. |
IInitializer |
createInitializer(java.lang.String contents,
IJavaElement sibling,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a static initializer in this type with the given contents. |
IMethod |
createMethod(java.lang.String contents,
IJavaElement sibling,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a method or constructor in this type with the given contents. |
IType |
createType(java.lang.String contents,
IJavaElement sibling,
boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type in this type with the given contents. |
IMethod[] |
findMethods(IMethod method)
Finds the methods in this type that correspond to the given method. |
java.lang.String |
getElementName()
Returns the simple name of this type, unqualified by package or enclosing type. |
IField |
getField(java.lang.String name)
Returns the field with the specified name in this type (for example, "bar"). |
IField[] |
getFields()
Returns the fields declared by this type. |
java.lang.String |
getFullyQualifiedName()
Returns the fully qualified name of this type, including qualification for any containing types and packages. |
java.lang.String |
getFullyQualifiedName(char enclosingTypeSeparator)
Returns the fully qualified name of this type, including qualification for any containing types and packages. |
IInitializer |
getInitializer(int occurrenceCount)
Returns the initializer with the specified position relative to the order they are defined in the source. |
IInitializer[] |
getInitializers()
Returns the initializers declared by this type. |
IMethod |
getMethod(java.lang.String name,
java.lang.String[] parameterTypeSignatures)
Returns the method with the specified name and parameter types in this type (for example, "foo", {"I", "QString;"}). |
IMethod[] |
getMethods()
Returns the methods and constructors declared by this type. |
IPackageFragment |
getPackageFragment()
Returns the package fragment in which this element is defined. |
java.lang.String |
getSuperclassName()
Returns the name of this type's superclass, or null
for source types that do not specify a superclass. |
java.lang.String |
getSuperclassTypeSignature()
Returns the type signature of this type's superclass, or null if none. |
java.lang.String[] |
getSuperInterfaceNames()
Returns the names of interfaces that this type implements or extends, in the order in which they are listed in the source. |
java.lang.String[] |
getSuperInterfaceTypeSignatures()
Returns the type signatures of the interfaces that this type implements or extends, in the order in which they are listed in the source. |
IType |
getType(java.lang.String name)
Returns the member type declared in this type with the given simple name. |
java.lang.String[] |
getTypeParameterSignatures()
Returns the formal type parameter signatures for this type. |
java.lang.String |
getTypeQualifiedName()
Returns the type-qualified name of this type, including qualification for any enclosing types, but not including package qualification. |
java.lang.String |
getTypeQualifiedName(char enclosingTypeSeparator)
Returns the type-qualified name of this type, including qualification for any enclosing types, but not including package qualification. |
IType[] |
getTypes()
Returns the immediate member types declared by this type. |
boolean |
isAnnotation()
Returns whether this type represents an annotation type. |
boolean |
isAnonymous()
Returns whether this type represents an anonymous type. |
boolean |
isClass()
Returns whether this type represents a class. |
boolean |
isEnum()
Returns whether this type represents an enumeration class. |
boolean |
isInterface()
Returns whether this type represents an interface. |
boolean |
isLocal()
Returns whether this type represents a local type. |
boolean |
isMember()
Returns whether this type represents a member type. |
ITypeHierarchy |
loadTypeHierachy(java.io.InputStream input,
org.eclipse.core.runtime.IProgressMonitor monitor)
Loads a previously saved ITypeHierarchy from an input stream. |
ITypeHierarchy |
newSupertypeHierarchy(ICompilationUnit[] workingCopies,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type and all of its supertypes, considering types in the given working copies. |
ITypeHierarchy |
newSupertypeHierarchy(org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type and all of its supertypes. |
ITypeHierarchy |
newSupertypeHierarchy(IWorkingCopy[] workingCopies,
org.eclipse.core.runtime.IProgressMonitor monitor)
Deprecated. use #newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor) instead |
ITypeHierarchy |
newSupertypeHierarchy(WorkingCopyOwner owner,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type and all of its supertypes, considering types in the working copies with the given owner. |
ITypeHierarchy |
newTypeHierarchy(ICompilationUnit[] workingCopies,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace, considering types in the given working copies. |
ITypeHierarchy |
newTypeHierarchy(IJavaProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the context of the given project. |
ITypeHierarchy |
newTypeHierarchy(IJavaProject project,
WorkingCopyOwner owner,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the context of the given project, considering types in the working copies with the given owner. |
ITypeHierarchy |
newTypeHierarchy(org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace. |
ITypeHierarchy |
newTypeHierarchy(IWorkingCopy[] workingCopies,
org.eclipse.core.runtime.IProgressMonitor monitor)
Deprecated. use #newTypeHierarchy(ICompilationUnit[], IProgressMonitor) instead |
ITypeHierarchy |
newTypeHierarchy(WorkingCopyOwner owner,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace, considering types in the working copies with the given owner. |
java.lang.String[][] |
resolveType(java.lang.String typeName)
Resolves the given type name within the context of this type (depending on the type hierarchy and its imports). |
java.lang.String[][] |
resolveType(java.lang.String typeName,
WorkingCopyOwner owner)
Resolves the given type name within the context of this type (depending on the type hierarchy and its imports) and using the given owner's working copies, considering types in the working copies with the given owner. |
| Methods inherited from interface org.eclipse.jdt.core.IMember |
getClassFile, getCompilationUnit, getDeclaringType, getFlags, getNameRange, getType, isBinary |
| Methods inherited from interface org.eclipse.jdt.core.IJavaElement |
exists, getAncestor, getCorrespondingResource, getElementType, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
| Methods inherited from interface org.eclipse.jdt.core.ISourceReference |
exists, getSource, getSourceRange |
| Methods inherited from interface org.eclipse.jdt.core.ISourceManipulation |
copy, delete, move, rename |
| Methods inherited from interface org.eclipse.jdt.core.IParent |
getChildren, hasChildren |
| Method Detail |
codeComplete
public void codeComplete(char[] snippet,
int insertion,
int position,
char[][] localVariableTypeNames,
char[][] localVariableNames,
int[] localVariableModifiers,
boolean isStatic,
ICompletionRequestor requestor)
throws JavaModelException
- Do code completion inside a code snippet in the context of the current type.
If the type can access to his source code and the insertion position is valid,
then completion is performed against source. Otherwise the completion is performed
against type structure and given locals variables.
- Since:
- 2.0
codeComplete
public void codeComplete(char[] snippet,
int insertion,
int position,
char[][] localVariableTypeNames,
char[][] localVariableNames,
int[] localVariableModifiers,
boolean isStatic,
ICompletionRequestor requestor,
WorkingCopyOwner owner)
throws JavaModelException
- Do code completion inside a code snippet in the context of the current type.
It considers types in the working copies with the given owner first. In other words,
the owner's working copies will take precedence over their original compilation units
in the workspace.
Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
If the type can access to his source code and the insertion position is valid, then completion is performed against source. Otherwise the completion is performed against type structure and given locals variables.
- Since:
- 3.0
createField
public IField createField(java.lang.String contents, IJavaElement sibling, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a field in this type with the
given contents.
Optionally, the new element can be positioned before the specified sibling. If no sibling is specified, the element will be inserted as the last field declaration in this type.
It is possible that a field with the same name already exists in this type. The value of the
forceparameter effects the resolution of such a conflict:-
true- in this case the field is created with the new contents -
false- in this case aJavaModelExceptionis thrown
-
createInitializer
public IInitializer createInitializer(java.lang.String contents, IJavaElement sibling, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a static initializer in this type with the
given contents.
Optionally, the new element can be positioned before the specified sibling. If no sibling is specified, the new initializer is positioned after the last existing initializer declaration, or as the first member in the type if there are no initializers.
createMethod
public IMethod createMethod(java.lang.String contents, IJavaElement sibling, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a method or constructor in this type with the
given contents.
Optionally, the new element can be positioned before the specified sibling. If no sibling is specified, the element will be appended to this type.
It is possible that a method with the same signature already exists in this type. The value of the
forceparameter effects the resolution of such a conflict:-
true- in this case the method is created with the new contents -
false- in this case aJavaModelExceptionis thrown
-
createType
public IType createType(java.lang.String contents, IJavaElement sibling, boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type in this type with the
given contents.
Optionally, the new type can be positioned before the specified sibling. If no sibling is specified, the type will be appended to this type.
It is possible that a type with the same name already exists in this type. The value of the
forceparameter effects the resolution of such a conflict:-
true- in this case the type is created with the new contents -
false- in this case aJavaModelExceptionis thrown
-
findMethods
public IMethod[] findMethods(IMethod method)
- Finds the methods in this type that correspond to
the given method.
A method m1 corresponds to another method m2 if:
- m1 has the same element name as m2.
- m1 has the same number of arguments as m2 and the simple names of the argument types must be equals.
- m1 exists.
- Since:
- 2.0
getElementName
public java.lang.String getElementName()
- Returns the simple name of this type, unqualified by package or enclosing type.
This is a handle-only method.
- Specified by:
getElementNamein interfaceIJavaElement
getField
public IField getField(java.lang.String name)
- Returns the field with the specified name
in this type (for example,
"bar"). This is a handle-only method. The field may or may not exist.
getFields
public IField[] getFields() throws JavaModelException
- Returns the fields declared by this type.
If this is a source type, the results are listed in the order
in which they appear in the source, otherwise, the results are
in no particular order. For binary types, this includes synthetic fields.
getFullyQualifiedName
public java.lang.String getFullyQualifiedName()
- Returns the fully qualified name of this type,
including qualification for any containing types and packages.
This is the name of the package, followed by
'.', followed by the type-qualified name. This is a handle-only method.
getFullyQualifiedName
public java.lang.String getFullyQualifiedName(char enclosingTypeSeparator)
- Returns the fully qualified name of this type,
including qualification for any containing types and packages.
This is the name of the package, followed by
'.', followed by the type-qualified name using theenclosingTypeSeparator. For example:- the fully qualified name of a class B defined as a member of a class A in a compilation unit A.java in a package x.y using the '.' separator is "x.y.A.B"
- the fully qualified name of a class B defined as a member of a class A in a compilation unit A.java in a package x.y using the '$' separator is "x.y.A$B"
- the fully qualified name of a binary type whose class file is x/y/A$B.class using the '.' separator is "x.y.A.B"
- the fully qualified name of a binary type whose class file is x/y/A$B.class using the '$' separator is "x.y.A$B"
- the fully qualified name of an anonymous binary type whose class file is x/y/A$1.class using the '.' separator is "x.y.A$1"
- Since:
- 2.0
getInitializer
public IInitializer getInitializer(int occurrenceCount)
- Returns the initializer with the specified position relative to
the order they are defined in the source.
Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0).
This is a handle-only method. The initializer may or may not be present.
getInitializers
public IInitializer[] getInitializers() throws JavaModelException
- Returns the initializers declared by this type.
For binary types this is an empty collection.
If this is a source type, the results are listed in the order
in which they appear in the source.
getMethod
public IMethod getMethod(java.lang.String name, java.lang.String[] parameterTypeSignatures)
- Returns the method with the specified name and parameter types
in this type (for example,
"foo", {"I", "QString;"}). To get the handle for a constructor, the name specified must be the simple name of the enclosing type. This is a handle-only method. The method may or may not be present.The type signatures may be either unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types). See Signature for details.
getMethods
public IMethod[] getMethods() throws JavaModelException
- Returns the methods and constructors declared by this type.
For binary types, this may include the special
<clinit> method and synthetic methods. If this is a source type, the results are listed in the order in which they appear in the source, otherwise, the results are in no particular order.
getPackageFragment
public IPackageFragment getPackageFragment()
- Returns the package fragment in which this element is defined.
This is a handle-only method.
getSuperclassName
public java.lang.String getSuperclassName() throws JavaModelException
- Returns the name of this type's superclass, or
nullfor source types that do not specify a superclass.For interfaces, the superclass name is always
"java.lang.Object". For source types, the name as declared is returned, for binary types, the resolved, qualified name is returned. For anonymous types, the superclass name is the name appearing after the 'new' keyword'. If the superclass is a parameterized type, the string may include its type arguments enclosed in "<>". If the returned string is needed for anything other than display purposes, usegetSuperclassTypeSignature()55 which returns a structured type signature string containing more precise information.
getSuperclassTypeSignature
public java.lang.String getSuperclassTypeSignature() throws JavaModelException
- Returns the type signature of this type's superclass, or
nullif none.The type signature may be either unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types). See Signature for details.
- Since:
- 3.0
getSuperInterfaceTypeSignatures
public java.lang.String[] getSuperInterfaceTypeSignatures() throws JavaModelException
- Returns the type signatures of the interfaces that this type
implements or extends, in the order in which they are listed in the
source.
For classes and enum types, this gives the interfaces that this class implements. For interfaces and annotation types, this gives the interfaces that this interface extends. An empty collection is returned if this type does not implement or extend any interfaces. For anonymous types, an empty collection is always returned.
The type signatures may be either unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types). See Signature for details.
- Since:
- 3.0
getSuperInterfaceNames
public java.lang.String[] getSuperInterfaceNames() throws JavaModelException
- Returns the names of interfaces that this type implements or extends,
in the order in which they are listed in the source.
For classes, this gives the interfaces that this class implements.
For interfaces, this gives the interfaces that this interface extends.
An empty collection is returned if this type does not implement or
extend any interfaces. For source types, simple names are returned,
for binary types, qualified names are returned.
For anonymous types, an empty collection is always returned.
If the list of supertypes includes parameterized types,
the string may include type arguments enclosed in "<>".
If the result is needed for anything other than display
purposes, use
getSuperInterfaceTypeSignatures()55 which returns structured signature strings containing more precise information.
getTypeParameterSignatures
public java.lang.String[] getTypeParameterSignatures() throws JavaModelException
- Returns the formal type parameter signatures for this type.
Returns an empty array if this type has no formal type parameters.
The formal type parameter signatures may be either unresolved (for source types) or resolved (for binary types). See Signature for details.
- Since:
- 3.0
getType
public IType getType(java.lang.String name)
- Returns the member type declared in this type with the given simple name.
This is a handle-only method. The type may or may not exist.
getTypeQualifiedName
public java.lang.String getTypeQualifiedName()
- Returns the type-qualified name of this type,
including qualification for any enclosing types,
but not including package qualification.
For source types, this consists of the simple names of any enclosing types,
separated by
'$', followed by the simple name of this type or the occurence count of this type if it is anonymous. For binary types, this is the name of the class file without the ".class" suffix. This is a handle-only method.
getTypeQualifiedName
public java.lang.String getTypeQualifiedName(char enclosingTypeSeparator)
- Returns the type-qualified name of this type,
including qualification for any enclosing types,
but not including package qualification.
For source types, this consists of the simple names of any enclosing types,
separated by
enclosingTypeSeparator, followed by the simple name of this type or the occurence count of this type if it is anonymous. For binary types, this is the name of the class file without the ".class" suffix. For example:- the type qualified name of a class B defined as a member of a class A using the '.' separator is "A.B"
- the type qualified name of a class B defined as a member of a class A using the '$' separator is "A$B"
- the type qualified name of a binary type whose class file is A$B.class using the '.' separator is "A.B"
- the type qualified name of a binary type whose class file is A$B.class using the '$' separator is "A$B"
- the type qualified name of an anonymous binary type whose class file is A$1.class using the '.' separator is "A$1"
- Since:
- 2.0
getTypes
public IType[] getTypes() throws JavaModelException
- Returns the immediate member types declared by this type.
The results are listed in the order in which they appear in the source or class file.
isAnonymous
public boolean isAnonymous()
throws JavaModelException
- Returns whether this type represents an anonymous type.
- Since:
- 2.0
isClass
public boolean isClass()
throws JavaModelException
- Returns whether this type represents a class.
Note that
isClass,isInterface,isEnum, andisAnnotationare mutually exclusive.
isEnum
public boolean isEnum()
throws JavaModelException
- Returns whether this type represents an enumeration class.
Note that
isClass,isInterface,isEnum, andisAnnotationare mutually exclusive.- Since:
- 3.0
isInterface
public boolean isInterface()
throws JavaModelException
- Returns whether this type represents an interface.
Note that
isClass,isInterface,isEnum, andisAnnotationare mutually exclusive.
isAnnotation
public boolean isAnnotation()
throws JavaModelException
- Returns whether this type represents an annotation type.
Note that
isClass,isInterface,isEnum, andisAnnotationare mutually exclusive.- Since:
- 3.0
isLocal
public boolean isLocal()
throws JavaModelException
- Returns whether this type represents a local type.
- Since:
- 2.0
isMember
public boolean isMember()
throws JavaModelException
- Returns whether this type represents a member type.
- Since:
- 2.0
loadTypeHierachy
public ITypeHierarchy loadTypeHierachy(java.io.InputStream input, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can
be stored using ITypeHierachy#store(OutputStream).
Only hierarchies originally created by the following methods can be loaded:
- IType#newSupertypeHierarchy(IProgressMonitor)
- IType#newTypeHierarchy(IJavaProject, IProgressMonitor)
- IType#newTypeHierarchy(IProgressMonitor)
- Since:
- 2.1
newSupertypeHierarchy
public ITypeHierarchy newSupertypeHierarchy(org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type and all of its supertypes.
newSupertypeHierarchy
public ITypeHierarchy newSupertypeHierarchy(ICompilationUnit[] workingCopies, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type and all of its supertypes, considering types in the given
working copies. In other words, the list of working copies will take
precedence over their original compilation units in the workspace.
Note that passing an empty working copy will be as if the original compilation unit had been deleted.
- Since:
- 3.0
newSupertypeHierarchy
public ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Deprecated. use #newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor) instead
- Creates and returns a type hierarchy for this type containing this type and all of its supertypes, considering types in the given working copies. In other words, the list of working copies will take precedence over their original compilation units in the workspace.
Note that passing an empty working copy will be as if the original compilation unit had been deleted.
- Since:
- 2.0
- Creates and returns a type hierarchy for this type containing this type and all of its supertypes, considering types in the given working copies. In other words, the list of working copies will take precedence over their original compilation units in the workspace.
newSupertypeHierarchy
public ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type and all of its supertypes, considering types in the
working copies with the given owner.
In other words, the owner's working copies will take
precedence over their original compilation units in the workspace.
Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Since:
- 3.0
newTypeHierarchy
public ITypeHierarchy newTypeHierarchy(IJavaProject project, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type, all of its supertypes, and all its subtypes
in the context of the given project.
newTypeHierarchy
public ITypeHierarchy newTypeHierarchy(IJavaProject project, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type, all of its supertypes, and all its subtypes
in the context of the given project, considering types in the
working copies with the given owner.
In other words, the owner's working copies will take
precedence over their original compilation units in the workspace.
Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Since:
- 3.0
newTypeHierarchy
public ITypeHierarchy newTypeHierarchy(org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type, all of its supertypes, and all its subtypes in the workspace.
newTypeHierarchy
public ITypeHierarchy newTypeHierarchy(ICompilationUnit[] workingCopies, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type, all of its supertypes, and all its subtypes in the workspace,
considering types in the given working copies. In other words, the list of working
copies that will take precedence over their original compilation units in the workspace.
Note that passing an empty working copy will be as if the original compilation unit had been deleted.
- Since:
- 3.0
newTypeHierarchy
public ITypeHierarchy newTypeHierarchy(IWorkingCopy[] workingCopies, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Deprecated. use #newTypeHierarchy(ICompilationUnit[], IProgressMonitor) instead
- Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace, considering types in the given working copies. In other words, the list of working copies that will take precedence over their original compilation units in the workspace.
Note that passing an empty working copy will be as if the original compilation unit had been deleted.
- Since:
- 2.0
- Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace, considering types in the given working copies. In other words, the list of working copies that will take precedence over their original compilation units in the workspace.
newTypeHierarchy
public ITypeHierarchy newTypeHierarchy(WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
- Creates and returns a type hierarchy for this type containing
this type, all of its supertypes, and all its subtypes in the workspace,
considering types in the working copies with the given owner.
In other words, the owner's working copies will take
precedence over their original compilation units in the workspace.
Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Since:
- 3.0
resolveType
public java.lang.String[][] resolveType(java.lang.String typeName) throws JavaModelException
- Resolves the given type name within the context of this type (depending on the type hierarchy
and its imports).
Multiple answers might be found in case there are ambiguous matches.
Each matching type name is decomposed as an array of two strings, the first denoting the package name (dot-separated) and the second being the type name. The package name is empty if it is the default package. The type name is the type qualified name using a '.' enclosing type separator.
Returns
nullif unable to find any matching type.For example, resolution of
"Object"would typically return{{"java.lang", "Object"}}. Another resolution that returns{{"", "X.Inner"}}represents the inner type Inner defined in type X in the default package.
resolveType
public java.lang.String[][] resolveType(java.lang.String typeName, WorkingCopyOwner owner) throws JavaModelException
- Resolves the given type name within the context of this type (depending on the type hierarchy
and its imports) and using the given owner's working copies, considering types in the
working copies with the given owner. In other words, the owner's working copies will take
precedence over their original compilation units in the workspace.
Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
Multiple answers might be found in case there are ambiguous matches.
Each matching type name is decomposed as an array of two strings, the first denoting the package name (dot-separated) and the second being the type name. The package name is empty if it is the default package. The type name is the type qualified name using a '.' enclosing type separator.
Returns
nullif unable to find any matching type.For example, resolution of
"Object"would typically return{{"java.lang", "Object"}}. Another resolution that returns{{"", "X.Inner"}}represents the inner type Inner defined in type X in the default package.- Since:
- 3.0
|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC