org.aspectj.org.eclipse.jdt.internal.core
Class BinaryType

java.lang.Object
  extended by PlatformObject
      extended by org.aspectj.org.eclipse.jdt.internal.core.JavaElement
          extended by org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
              extended by org.aspectj.org.eclipse.jdt.internal.core.Member
                  extended by org.aspectj.org.eclipse.jdt.internal.core.NamedMember
                      extended by org.aspectj.org.eclipse.jdt.internal.core.BinaryMember
                          extended by org.aspectj.org.eclipse.jdt.internal.core.BinaryType
All Implemented Interfaces:
IAnnotatable, IJavaElement, IMember, IParent, ISourceManipulation, ISourceReference, IType, SuffixConstants
Direct Known Subclasses:
ResolvedBinaryType

public class BinaryType
extends BinaryMember
implements IType, SuffixConstants

Parent is an IClassFile.

See Also:
IType

Field Summary
static JavadocContents EMPTY_JAVADOC
           
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.NamedMember
name
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
occurrenceCount
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaElement
JEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LOCALVARIABLE, JEM_METHOD, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, parent
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement
ANNOTATION, 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, TYPE_PARAMETER
 
Fields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.util.SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA
 
Constructor Summary
protected BinaryType(JavaElement parent, java.lang.String name)
           
 
Method Summary
protected  void closing(java.lang.Object info)
          This element is being closed.
 void codeComplete(char[] snippet, int insertion, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic, CompletionRequestor 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, CompletionRequestor requestor, IProgressMonitor monitor)
          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, CompletionRequestor requestor, WorkingCopyOwner owner, IProgressMonitor monitor)
          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)
          Deprecated.  
 void codeComplete(char[] snippet, int insertion, int position, char[][] localVariableTypeNames, char[][] localVariableNames, int[] localVariableModifiers, boolean isStatic, ICompletionRequestor requestor, WorkingCopyOwner owner)
          Deprecated.  
 IField createField(java.lang.String contents, IJavaElement sibling, boolean force, IProgressMonitor monitor)
          Creates and returns a field in this type with the given contents.
 IInitializer createInitializer(java.lang.String contents, IJavaElement sibling, 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, 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, IProgressMonitor monitor)
          Creates and returns a type in this type with the given contents.
 boolean equals(java.lang.Object o)
          Returns true if this handle represents the same Java element as the given handle.
 IMethod[] findMethods(IMethod method)
          Finds the methods in this type that correspond to the given method.
 IAnnotation[] getAnnotations()
          Returns the annotations for this element.
 java.lang.String getAttachedJavadoc(IProgressMonitor monitor)
          Returns the Javadoc as an html source if this element has an attached javadoc, null otherwise.
 IJavaElement[] getChildren()
          Returns the immediate children of this element.
 IJavaElement[] getChildrenForCategory(java.lang.String category)
          Returns the children of this type that have the given category as a @category tag.
protected  org.aspectj.org.eclipse.jdt.internal.core.ClassFileInfo getClassFileInfo()
           
 IType getDeclaringType()
          Returns the type in which this member is declared, or null if this member is not declared in a type (for example, a top-level type).
 java.lang.Object getElementInfo(IProgressMonitor monitor)
          Returns the info for this handle.
 int getElementType()
          Returns this element's kind encoded as an integer.
 IField getField(java.lang.String fieldName)
          Returns the field with the specified name in this type (for example, "bar").
 IField[] getFields()
          Returns the fields declared by this type in the order in which they appear in the source or class file.
 int getFlags()
          Returns the modifier flags for this member.
 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.
 java.lang.String getFullyQualifiedParameterizedName()
          Returns this type's fully qualified name using a '.' enclosing type separator followed by its type parameters between angle brackets if it is a generic type.
 IJavaElement getHandleFromMemento(java.lang.String token, MementoTokenizer memento, WorkingCopyOwner workingCopyOwner)
           
 IInitializer getInitializer(int count)
          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.
 JavadocContents getJavadocContents(IProgressMonitor monitor)
           
 java.lang.String getKey(boolean forceOpen)
           
 IMethod getMethod(java.lang.String selector, 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 getSourceFileName(IBinaryType info)
           
 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 typeName)
          Returns the member type declared in this type with the given simple name.
 ITypeParameter getTypeParameter(java.lang.String typeParameterName)
          Returns the type parameter declared in this type with the given name.
 ITypeParameter[] getTypeParameters()
          Returns the formal type parameters for this type.
 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.
 boolean isResolved()
          Returns whether this type represents a resolved type.
 ITypeHierarchy loadTypeHierachy(java.io.InputStream input, IProgressMonitor monitor)
          Loads a previously saved ITypeHierarchy from an input stream.
 ITypeHierarchy loadTypeHierachy(java.io.InputStream input, WorkingCopyOwner owner, IProgressMonitor monitor)
           
 ITypeHierarchy newSupertypeHierarchy(ICompilationUnit[] workingCopies, 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(IProgressMonitor monitor)
          Creates and returns a type hierarchy for this type containing this type and all of its supertypes.
 ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies, IProgressMonitor monitor)
          Deprecated.  
 ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner, 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, 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, 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, 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(IProgressMonitor monitor)
          Deprecated.  
 ITypeHierarchy newTypeHierarchy(IWorkingCopy[] workingCopies, IProgressMonitor monitor)
          Deprecated.  
 ITypeHierarchy newTypeHierarchy(WorkingCopyOwner owner, 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.
 JavaElement resolved(Binding binding)
           
 java.lang.String sourceFileName(IBinaryType info)
           
protected  void toStringInfo(int tab, java.lang.StringBuffer buffer, java.lang.Object info, boolean showResolvedInfo)
          Debugging purposes
protected  void toStringName(java.lang.StringBuffer buffer)
          Debugging purposes
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.BinaryMember
copy, getAnnotations, getCategories, getKey, getNameRange, getSourceRange, getStandardAnnotations, isBinary, isStructureKnown, move, rename, setContents
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.NamedMember
getElementName, getFullyQualifiedName, getFullyQualifiedParameterizedName, getKey, getKey, getKey, getTypeQualifiedName, resolveType, resolveType
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.Member
areSimilarMethods, convertConstant, findMethods, getClassFile, getHandleMementoDelimiter, getJavadocRange, getOuterMostLocalContext, getType, getTypeRoot, isMainMethod, isReadOnly, readableName
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.SourceRefElement
createElementInfo, delete, findNode, generateInfos, getAnnotation, getCompilationUnit, getCorrespondingResource, getHandleMemento, getHandleUpdatingCountFromMemento, getOccurrenceCount, getOpenableParent, getPath, getSource, getUnderlyingResource, hasChildren, resource
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaElement
close, escapeMementoName, exists, getAncestor, getChildrenOfType, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenable, getParent, getPrimaryElement, getPrimaryElement, getResource, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, hashCode, isAncestorOf, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IType
getElementName, getKey, resolveType, resolveType
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IMember
getCategories, getClassFile, getCompilationUnit, getJavadocRange, getOccurrenceCount, getType, getTypeRoot, isBinary
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getCorrespondingResource, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.ISourceReference
exists, getNameRange, getSource, getSourceRange
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.ISourceManipulation
copy, delete, move, rename
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IParent
hasChildren
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IAnnotatable
getAnnotation
 

Field Detail

EMPTY_JAVADOC

public static final JavadocContents EMPTY_JAVADOC
Constructor Detail

BinaryType

protected BinaryType(JavaElement parent,
                     java.lang.String name)
Method Detail

closing

protected void closing(java.lang.Object info)
                throws JavaModelException
Description copied from class: SourceRefElement
This element is being closed. Do any necessary cleanup.

Overrides:
closing in class SourceRefElement
Throws:
JavaModelException

codeComplete

public void codeComplete(char[] snippet,
                         int insertion,
                         int position,
                         char[][] localVariableTypeNames,
                         char[][] localVariableNames,
                         int[] localVariableModifiers,
                         boolean isStatic,
                         ICompletionRequestor requestor)
                  throws JavaModelException
Deprecated. 

Description copied from interface: IType
Do code completion inside a code snippet in the context of the current type. If the type has access to its source code and the insertion position is valid, then completion is performed against the source. Otherwise the completion is performed against the type structure and the given locals variables.

Specified by:
codeComplete in interface IType
Parameters:
snippet - the code snippet
insertion - the position with in source where the snippet is inserted. This position must not be in comments. A possible value is -1, if the position is not known.
position - the position within snippet where the user is performing code assist.
localVariableTypeNames - an array (possibly empty) of fully qualified type names of local variables visible at the current scope
localVariableNames - an array (possibly empty) of local variable names that are visible at the current scope
localVariableModifiers - an array (possible empty) of modifiers for local variables
isStatic - whether the current scope is in a static context
requestor - the completion requestor
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IType.codeComplete(char[], int, int, char[][], char[][], int[], boolean, ICompletionRequestor)

codeComplete

public void codeComplete(char[] snippet,
                         int insertion,
                         int position,
                         char[][] localVariableTypeNames,
                         char[][] localVariableNames,
                         int[] localVariableModifiers,
                         boolean isStatic,
                         ICompletionRequestor requestor,
                         WorkingCopyOwner owner)
                  throws JavaModelException
Deprecated. 

Description copied from interface: IType
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 has access to its source code and the insertion position is valid, then completion is performed against the source. Otherwise the completion is performed against the type structure and the given locals variables.

Specified by:
codeComplete in interface IType
Parameters:
snippet - the code snippet
insertion - the position with in source where the snippet is inserted. This position must not be in comments. A possible value is -1, if the position is not known.
position - the position with in snippet where the user is performing code assist.
localVariableTypeNames - an array (possibly empty) of fully qualified type names of local variables visible at the current scope
localVariableNames - an array (possibly empty) of local variable names that are visible at the current scope
localVariableModifiers - an array (possible empty) of modifiers for local variables
isStatic - whether the current scope is in a static context
requestor - the completion requestor
owner - the owner of working copies that take precedence over their original compilation units
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IType.codeComplete(char[], int, int, char[][], char[][], int[], boolean, ICompletionRequestor, WorkingCopyOwner)

codeComplete

public void codeComplete(char[] snippet,
                         int insertion,
                         int position,
                         char[][] localVariableTypeNames,
                         char[][] localVariableNames,
                         int[] localVariableModifiers,
                         boolean isStatic,
                         CompletionRequestor requestor)
                  throws JavaModelException
Description copied from interface: IType
Do code completion inside a code snippet in the context of the current type. If the type has access to its source code and the insertion position is valid, then completion is performed against the source. Otherwise the completion is performed against the type structure and the given locals variables.

Specified by:
codeComplete in interface IType
Parameters:
snippet - the code snippet
insertion - the position with in source where the snippet is inserted. This position must not be in comments. A possible value is -1, if the position is not known.
position - the position within snippet where the user is performing code assist.
localVariableTypeNames - an array (possibly empty) of fully qualified type names of local variables visible at the current scope
localVariableNames - an array (possibly empty) of local variable names that are visible at the current scope
localVariableModifiers - an array (possible empty) of modifiers for local variables
isStatic - whether the current scope is in a static context
requestor - the completion requestor
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

codeComplete

public void codeComplete(char[] snippet,
                         int insertion,
                         int position,
                         char[][] localVariableTypeNames,
                         char[][] localVariableNames,
                         int[] localVariableModifiers,
                         boolean isStatic,
                         CompletionRequestor requestor,
                         IProgressMonitor monitor)
                  throws JavaModelException
Description copied from interface: IType
Do code completion inside a code snippet in the context of the current type. If the type has access to its source code and the insertion position is valid, then completion is performed against the source. Otherwise the completion is performed against the type structure and the given locals variables.

If IProgressMonitor is not null then some proposals which can be very long to compute are proposed. To avoid that the code assist operation take too much time a IProgressMonitor which automatically cancel the code assist operation when a specified amount of time is reached could be used.

 new IProgressMonitor() {
     private final static int TIMEOUT = 500; //ms
     private long endTime;
     public void beginTask(String name, int totalWork) {
         fEndTime= System.currentTimeMillis() + TIMEOUT;
     }
     public boolean isCanceled() {
         return endTime <= System.currentTimeMillis();
     }
     ...
 };
 

Specified by:
codeComplete in interface IType
Parameters:
snippet - the code snippet
insertion - the position with in source where the snippet is inserted. This position must not be in comments. A possible value is -1, if the position is not known.
position - the position within snippet where the user is performing code assist.
localVariableTypeNames - an array (possibly empty) of fully qualified type names of local variables visible at the current scope
localVariableNames - an array (possibly empty) of local variable names that are visible at the current scope
localVariableModifiers - an array (possible empty) of modifiers for local variables
isStatic - whether the current scope is in a static context
requestor - the completion requestor
monitor - the progress monitor used to report progress
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

codeComplete

public void codeComplete(char[] snippet,
                         int insertion,
                         int position,
                         char[][] localVariableTypeNames,
                         char[][] localVariableNames,
                         int[] localVariableModifiers,
                         boolean isStatic,
                         CompletionRequestor requestor,
                         WorkingCopyOwner owner,
                         IProgressMonitor monitor)
                  throws JavaModelException
Description copied from interface: IType
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 has access to its source code and the insertion position is valid, then completion is performed against the source. Otherwise the completion is performed against the type structure and the given locals variables.

If IProgressMonitor is not null then some proposals which can be very long to compute are proposed. To avoid that the code assist operation take too much time a IProgressMonitor which automatically cancel the code assist operation when a specified amount of time is reached could be used.

 new IProgressMonitor() {
     private final static int TIMEOUT = 500; //ms
     private long endTime;
     public void beginTask(String name, int totalWork) {
         endTime= System.currentTimeMillis() + TIMEOUT;
     }
     public boolean isCanceled() {
         return endTime <= System.currentTimeMillis();
     }
     ...
 };
 

Specified by:
codeComplete in interface IType
Parameters:
snippet - the code snippet
insertion - the position with in source where the snippet is inserted. This position must not be in comments. A possible value is -1, if the position is not known.
position - the position with in snippet where the user is performing code assist.
localVariableTypeNames - an array (possibly empty) of fully qualified type names of local variables visible at the current scope
localVariableNames - an array (possibly empty) of local variable names that are visible at the current scope
localVariableModifiers - an array (possible empty) of modifiers for local variables
isStatic - whether the current scope is in a static context
requestor - the completion requestor
owner - the owner of working copies that take precedence over their original compilation units
monitor - the progress monitor used to report progress
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

createField

public IField createField(java.lang.String contents,
                          IJavaElement sibling,
                          boolean force,
                          IProgressMonitor monitor)
                   throws JavaModelException
Description copied from interface: IType
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 force parameter affects the resolution of such a conflict:

Specified by:
createField in interface IType
Parameters:
contents - the given contents
sibling - the given sibling
force - a flag in case the same name already exists in this type
monitor - the given progress monitor
Returns:
a field in this type with the given contents
Throws:
JavaModelException - if the element could not be created. Reasons include:
  • This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
  • A CoreException occurred while updating an underlying resource
  • The specified sibling is not a child of this type (INVALID_SIBLING)
  • The contents could not be recognized as a field declaration (INVALID_CONTENTS)
  • This type is read-only (binary) (READ_ONLY)
  • There was a naming collision with an existing field (NAME_COLLISION)

createInitializer

public IInitializer createInitializer(java.lang.String contents,
                                      IJavaElement sibling,
                                      IProgressMonitor monitor)
                               throws JavaModelException
Description copied from interface: IType
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.

Specified by:
createInitializer in interface IType
Parameters:
contents - the given contents
sibling - the given sibling
monitor - the given progress monitor
Returns:
a static initializer in this type with the given contents
Throws:
JavaModelException - if the element could not be created. Reasons include:
  • This element does not exist
  • A CoreException occurred while updating an underlying resource
  • The specified sibling is not a child of this type (INVALID_SIBLING)
  • The contents could not be recognized as an initializer declaration (INVALID_CONTENTS)
  • This type is read-only (binary) (READ_ONLY)

createMethod

public IMethod createMethod(java.lang.String contents,
                            IJavaElement sibling,
                            boolean force,
                            IProgressMonitor monitor)
                     throws JavaModelException
Description copied from interface: IType
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 force parameter affects the resolution of such a conflict:

Specified by:
createMethod in interface IType
Parameters:
contents - the given contents
sibling - the given sibling
force - a flag in case the same name already exists in this type
monitor - the given progress monitor
Returns:
a method or constructor in this type with the given contents
Throws:
JavaModelException - if the element could not be created. Reasons include:
  • This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
  • A CoreException occurred while updating an underlying resource
  • The specified sibling is not a child of this type (INVALID_SIBLING)
  • The contents could not be recognized as a method or constructor declaration (INVALID_CONTENTS)
  • This type is read-only (binary) (READ_ONLY)
  • There was a naming collision with an existing method (NAME_COLLISION)

createType

public IType createType(java.lang.String contents,
                        IJavaElement sibling,
                        boolean force,
                        IProgressMonitor monitor)
                 throws JavaModelException
Description copied from interface: IType
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 force parameter affects the resolution of such a conflict:

Specified by:
createType in interface IType
Parameters:
contents - the given contents
sibling - the given sibling
force - a flag in case the same name already exists in this type
monitor - the given progress monitor
Returns:
a type in this type with the given contents
Throws:
JavaModelException - if the element could not be created. Reasons include:
  • This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
  • A CoreException occurred while updating an underlying resource
  • The specified sibling is not a child of this type (INVALID_SIBLING)
  • The contents could not be recognized as a type declaration (INVALID_CONTENTS)
  • This type is read-only (binary) (READ_ONLY)
  • There was a naming collision with an existing field (NAME_COLLISION)

equals

public boolean equals(java.lang.Object o)
Description copied from class: JavaElement
Returns true if this handle represents the same Java element as the given handle. By default, two handles represent the same element if they are identical or if they represent the same type of element, have equal names, parents, and occurrence counts.

If a subclass has other requirements for equality, this method must be overridden.

Overrides:
equals in class SourceRefElement
See Also:
Object.equals(java.lang.Object)

findMethods

public IMethod[] findMethods(IMethod method)
Description copied from interface: IType
Finds the methods in this type that correspond to the given method. A method m1 corresponds to another method m2 if:

Specified by:
findMethods in interface IType
Parameters:
method - the given method
Returns:
the found method or null if no such methods can be found.

getAnnotations

public IAnnotation[] getAnnotations()
                             throws JavaModelException
Description copied from interface: IAnnotatable
Returns the annotations for this element. Returns an empty array if this element has no annotations.

Specified by:
getAnnotations in interface IAnnotatable
Overrides:
getAnnotations in class SourceRefElement
Returns:
the annotations of this element, in the order declared in the source, or an empty array if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getChildren

public IJavaElement[] getChildren()
                           throws JavaModelException
Description copied from interface: IParent
Returns the immediate children of this element. Unless otherwise specified by the implementing element, the children are in no particular order.

Specified by:
getChildren in interface IParent
Overrides:
getChildren in class JavaElement
Returns:
the immediate children of this element
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource
See Also:
IParent

getChildrenForCategory

public IJavaElement[] getChildrenForCategory(java.lang.String category)
                                      throws JavaModelException
Description copied from interface: IType
Returns the children of this type that have the given category as a @category tag. Returns an empty array if no children with this category exist.

The results are listed in the order in which they appear in the source or class file.

Specified by:
getChildrenForCategory in interface IType
Returns:
the children for the given category.
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getClassFileInfo

protected org.aspectj.org.eclipse.jdt.internal.core.ClassFileInfo getClassFileInfo()
                                                                            throws JavaModelException
Throws:
JavaModelException

getDeclaringType

public IType getDeclaringType()
Description copied from interface: IMember
Returns the type in which this member is declared, or null if this member is not declared in a type (for example, a top-level type). This is a handle-only method.

Specified by:
getDeclaringType in interface IMember
Overrides:
getDeclaringType in class Member
Returns:
the type in which this member is declared, or null if this member is not declared in a type (for example, a top-level type)
See Also:
IMember

getElementInfo

public java.lang.Object getElementInfo(IProgressMonitor monitor)
                                throws JavaModelException
Description copied from class: JavaElement
Returns the info for this handle. If this element is not already open, it and all of its parents are opened. Does not return null. NOTE: BinaryType infos are NOT rooted under JavaElementInfo.

Overrides:
getElementInfo in class JavaElement
Throws:
JavaModelException - if the element is not present or not accessible

getElementType

public int getElementType()
Description copied from interface: IJavaElement
Returns this element's kind encoded as an integer. This is a handle-only method.

Specified by:
getElementType in interface IJavaElement
Returns:
the kind of element; one of the constants declared in IJavaElement
See Also:
IJavaElement

getField

public IField getField(java.lang.String fieldName)
Description copied from interface: IType
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.

Specified by:
getField in interface IType
Parameters:
fieldName - the given name
Returns:
the field with the specified name in this type

getFields

public IField[] getFields()
                   throws JavaModelException
Description copied from interface: IType
Returns the fields declared by this type in the order in which they appear in the source or class file. For binary types, this includes synthetic fields.

Specified by:
getFields in interface IType
Returns:
the fields declared by this type
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getFlags

public int getFlags()
             throws JavaModelException
Description copied from interface: IMember
Returns the modifier flags for this member. The flags can be examined using class Flags.

Note that only flags as indicated in the source are returned. Thus if an interface defines a method void myMethod(); the flags don't include the 'public' flag.

Specified by:
getFlags in interface IMember
Overrides:
getFlags in class Member
Returns:
the modifier flags for this member
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IMember

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Description copied from interface: IType
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.

Note: The enclosing type separator used in the type-qualified name is '$', not '.'.

This method is fully equivalent to getFullyQualifiedName('$'). This is a handle-only method.

Specified by:
getFullyQualifiedName in interface IType
Returns:
the fully qualified name of this type
See Also:
IType.getTypeQualifiedName(), IType.getFullyQualifiedName(char)

getFullyQualifiedName

public java.lang.String getFullyQualifiedName(char enclosingTypeSeparator)
Description copied from interface: IType
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 the enclosingTypeSeparator. For example: This is a handle-only method.

Specified by:
getFullyQualifiedName in interface IType
Parameters:
enclosingTypeSeparator - the given enclosing type separator
Returns:
the fully qualified name of this type, including qualification for any containing types and packages
See Also:
IType.getTypeQualifiedName(char)

getFullyQualifiedParameterizedName

public java.lang.String getFullyQualifiedParameterizedName()
                                                    throws JavaModelException
Description copied from interface: IType
Returns this type's fully qualified name using a '.' enclosing type separator followed by its type parameters between angle brackets if it is a generic type. For example, "p.X<T>", "java.util.Map<java.lang.String, p.X>"

Specified by:
getFullyQualifiedParameterizedName in interface IType
Returns:
the fully qualified parameterized representation of this type
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getHandleFromMemento

public IJavaElement getHandleFromMemento(java.lang.String token,
                                         MementoTokenizer memento,
                                         WorkingCopyOwner workingCopyOwner)
Overrides:
getHandleFromMemento in class Member

getInitializer

public IInitializer getInitializer(int count)
Description copied from interface: IType
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.

Specified by:
getInitializer in interface IType
Parameters:
count - the specified position
Returns:
the initializer with the specified position relative to the order they are defined in the source

getInitializers

public IInitializer[] getInitializers()
Description copied from interface: IType
Returns the initializers declared by this type. For binary types this is an empty collection. For source types, the results are listed in the order in which they appear in the source.

Specified by:
getInitializers in interface IType
Returns:
the initializers declared by this type

getKey

public java.lang.String getKey(boolean forceOpen)
                        throws JavaModelException
Specified by:
getKey in class BinaryMember
Throws:
JavaModelException
See Also:
Binding.computeUniqueKey()

getMethod

public IMethod getMethod(java.lang.String selector,
                         java.lang.String[] parameterTypeSignatures)
Description copied from interface: IType
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.

Specified by:
getMethod in interface IType
Parameters:
selector - the given name
parameterTypeSignatures - the given parameter types
Returns:
the method with the specified name and parameter types in this type

getMethods

public IMethod[] getMethods()
                     throws JavaModelException
Description copied from interface: IType
Returns the methods and constructors declared by this type. For binary types, this may include the special <clinit> method and synthetic methods.

The results are listed in the order in which they appear in the source or class file.

Specified by:
getMethods in interface IType
Returns:
the methods and constructors declared by this type
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getPackageFragment

public IPackageFragment getPackageFragment()
Description copied from interface: IType
Returns the package fragment in which this element is defined. This is a handle-only method.

Specified by:
getPackageFragment in interface IType
Overrides:
getPackageFragment in class NamedMember
Returns:
the package fragment in which this element is defined

getSuperclassTypeSignature

public java.lang.String getSuperclassTypeSignature()
                                            throws JavaModelException
Description copied from interface: IType
Returns the type signature of this type's superclass, or null if 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.

Specified by:
getSuperclassTypeSignature in interface IType
Returns:
the type signature of this type's superclass, or null if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
Since:
3.0
See Also:
IType.getSuperclassTypeSignature()

getSourceFileName

public java.lang.String getSourceFileName(IBinaryType info)

getSuperclassName

public java.lang.String getSuperclassName()
                                   throws JavaModelException
Description copied from interface: IType
Returns the name of this type's superclass, or null for 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, use IType.getSuperclassTypeSignature() which returns a structured type signature string containing more precise information.

Specified by:
getSuperclassName in interface IType
Returns:
the name of this type's superclass, or null for source types that do not specify a superclass
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getSuperInterfaceNames

public java.lang.String[] getSuperInterfaceNames()
                                          throws JavaModelException
Description copied from interface: IType
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 IType.getSuperInterfaceTypeSignatures() which returns structured signature strings containing more precise information.

Specified by:
getSuperInterfaceNames in interface IType
Returns:
the names of interfaces that this type implements or extends, in the order in which they are listed in the source, an empty collection if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getSuperInterfaceTypeSignatures

public java.lang.String[] getSuperInterfaceTypeSignatures()
                                                   throws JavaModelException
Description copied from interface: IType
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.

Specified by:
getSuperInterfaceTypeSignatures in interface IType
Returns:
the type signatures of interfaces that this type implements or extends, in the order in which they are listed in the source, an empty collection if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
Since:
3.0
See Also:
IType.getSuperInterfaceTypeSignatures()

getTypeParameters

public ITypeParameter[] getTypeParameters()
                                   throws JavaModelException
Description copied from interface: IType
Returns the formal type parameters for this type. Returns an empty array if this type has no formal type parameters.

Specified by:
getTypeParameters in interface IType
Overrides:
getTypeParameters in class NamedMember
Returns:
the formal type parameters of this type, in the order declared in the source, an empty array if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

getTypeParameterSignatures

public java.lang.String[] getTypeParameterSignatures()
                                              throws JavaModelException
Description copied from interface: IType
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.

Specified by:
getTypeParameterSignatures in interface IType
Returns:
the formal type parameter signatures of this type, in the order declared in the source, an empty array if none
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
Since:
3.0
See Also:
IType.getTypeParameterSignatures()

getType

public IType getType(java.lang.String typeName)
Description copied from interface: IType
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.

Specified by:
getType in interface IType
Parameters:
typeName - the given simple name
Returns:
the member type declared in this type with the given simple name

getTypeParameter

public ITypeParameter getTypeParameter(java.lang.String typeParameterName)
Description copied from interface: IType
Returns the type parameter declared in this type with the given name. This is a handle-only method. The type parameter may or may not exist.

Specified by:
getTypeParameter in interface IType
Parameters:
typeParameterName - the given simple name
Returns:
the type parameter declared in this type with the given name

getTypeQualifiedName

public java.lang.String getTypeQualifiedName()
Description copied from interface: IType
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 occurrence count of this type if it is anonymous. For binary types, this is the name of the class file without the ".class" suffix. This method is fully equivalent to getTypeQualifiedName('$'). This is a handle-only method.

Specified by:
getTypeQualifiedName in interface IType
Returns:
the type-qualified name of this type
See Also:
IType.getTypeQualifiedName(char)

getTypeQualifiedName

public java.lang.String getTypeQualifiedName(char enclosingTypeSeparator)
Description copied from interface: IType
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 occurrence count of this type if it is anonymous. For binary types, this is the name of the class file without the ".class" suffix, and - since 3.4 - the '$' characters in the class file name are replaced with the enclosingTypeSeparator character. For example: This is a handle-only method.

Specified by:
getTypeQualifiedName in interface IType
Parameters:
enclosingTypeSeparator - the specified enclosing type separator
Returns:
the type-qualified name of this type

getTypes

public IType[] getTypes()
                 throws JavaModelException
Description copied from interface: IType
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.

Specified by:
getTypes in interface IType
Returns:
the immediate member types declared by this type
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

isAnonymous

public boolean isAnonymous()
                    throws JavaModelException
Description copied from interface: IType
Returns whether this type represents an anonymous type.

Specified by:
isAnonymous in interface IType
Returns:
true if this type represents an anonymous type, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

isClass

public boolean isClass()
                throws JavaModelException
Description copied from interface: IType
Returns whether this type represents a class.

Note that a class can neither be an interface, an enumeration class, nor an annotation type.

Specified by:
isClass in interface IType
Returns:
true if this type represents a class, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

isEnum

public boolean isEnum()
               throws JavaModelException
Description copied from interface: IType
Returns whether this type represents an enumeration class.

Note that an enumeration class can neither be a class, an interface, nor an annotation type.

Specified by:
isEnum in interface IType
Returns:
true if this type represents an enumeration class, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
Since:
3.0
See Also:
IType.isEnum()

isInterface

public boolean isInterface()
                    throws JavaModelException
Description copied from interface: IType
Returns whether this type represents an interface.

Note that an interface can also be an annotation type, but it can neither be a class nor an enumeration class.

Specified by:
isInterface in interface IType
Returns:
true if this type represents an interface, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

isAnnotation

public boolean isAnnotation()
                     throws JavaModelException
Description copied from interface: IType
Returns whether this type represents an annotation type.

Note that an annotation type is also an interface, but it can neither be a class nor an enumeration class.

Specified by:
isAnnotation in interface IType
Returns:
true if this type represents an annotation type, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
Since:
3.0
See Also:
IType.isAnnotation()

isLocal

public boolean isLocal()
                throws JavaModelException
Description copied from interface: IType
Returns whether this type represents a local type. For an anonymous type, this method returns true.

Note: This deviates from JLS3 14.3, which states that anonymous types are not local types since they do not have a name.

Specified by:
isLocal in interface IType
Returns:
true if this type represents a local type, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
ITypeBinding.isLocal()

isMember

public boolean isMember()
                 throws JavaModelException
Description copied from interface: IType
Returns whether this type represents a member type.

Specified by:
isMember in interface IType
Returns:
true if this type represents a member type, false otherwise
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

isResolved

public boolean isResolved()
Description copied from interface: IType
Returns whether this type represents a resolved type. If a type is resolved, its key contains resolved information.

Specified by:
isResolved in interface IType
Returns:
whether this type represents a resolved type.

loadTypeHierachy

public ITypeHierarchy loadTypeHierachy(java.io.InputStream input,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Description copied from interface: IType
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:

Specified by:
loadTypeHierachy in interface IType
Parameters:
input - stream where hierarchy will be read
monitor - the given progress monitor
Returns:
the stored hierarchy
Throws:
JavaModelException - if the hierarchy could not be restored, reasons include: - type is not the focus of the hierarchy or - unable to read the input stream (wrong format, IOException during reading, ...)
See Also:
ITypeHierarchy.store(java.io.OutputStream, IProgressMonitor)

loadTypeHierachy

public ITypeHierarchy loadTypeHierachy(java.io.InputStream input,
                                       WorkingCopyOwner owner,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Throws:
JavaModelException

newSupertypeHierarchy

public ITypeHierarchy newSupertypeHierarchy(IProgressMonitor monitor)
                                     throws JavaModelException
Description copied from interface: IType
Creates and returns a type hierarchy for this type containing this type and all of its supertypes.

Specified by:
newSupertypeHierarchy in interface IType
Parameters:
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type and all of its supertypes
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

newSupertypeHierarchy

public ITypeHierarchy newSupertypeHierarchy(ICompilationUnit[] workingCopies,
                                            IProgressMonitor monitor)
                                     throws JavaModelException
Description copied from interface: IType
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.

Specified by:
newSupertypeHierarchy in interface IType
Parameters:
workingCopies - the working copies that take precedence over their original compilation units
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type and all of its supertypes
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

newSupertypeHierarchy

public ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies,
                                            IProgressMonitor monitor)
                                     throws JavaModelException
Deprecated. 

Description copied from interface: IType
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.

Specified by:
newSupertypeHierarchy in interface IType
Parameters:
workingCopies - the working copies that take precedence over their original compilation units
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type and all of its supertypes
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IType.newSupertypeHierarchy(IWorkingCopy[], IProgressMonitor)

newSupertypeHierarchy

public ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner,
                                            IProgressMonitor monitor)
                                     throws JavaModelException
Description copied from interface: IType
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.

Specified by:
newSupertypeHierarchy in interface IType
Parameters:
owner - the owner of working copies that take precedence over their original compilation units
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type and all of its supertypes
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

newTypeHierarchy

public ITypeHierarchy newTypeHierarchy(IJavaProject project,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Description copied from interface: IType
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.

Specified by:
newTypeHierarchy in interface IType
Parameters:
project - the given project
monitor - the given progress monitor
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
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

newTypeHierarchy

public ITypeHierarchy newTypeHierarchy(IJavaProject project,
                                       WorkingCopyOwner owner,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Description copied from interface: IType
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.

Specified by:
newTypeHierarchy in interface IType
Parameters:
project - the given project
owner - the owner of working copies that take precedence over their original compilation units
monitor - the given progress monitor
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
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

newTypeHierarchy

public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor)
                                throws JavaModelException
Deprecated. 

Description copied from interface: IType
Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace.

Specified by:
newTypeHierarchy in interface IType
Parameters:
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IType.newTypeHierarchy(IProgressMonitor monitor)

newTypeHierarchy

public ITypeHierarchy newTypeHierarchy(ICompilationUnit[] workingCopies,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Description copied from interface: IType
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.

Specified by:
newTypeHierarchy in interface IType
Parameters:
workingCopies - the working copies that take precedence over their original compilation units
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

newTypeHierarchy

public ITypeHierarchy newTypeHierarchy(IWorkingCopy[] workingCopies,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Deprecated. 

Description copied from interface: IType
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.

Specified by:
newTypeHierarchy in interface IType
Parameters:
workingCopies - the working copies that take precedence over their original compilation units
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.
See Also:
IType.newTypeHierarchy(IWorkingCopy[], IProgressMonitor)

newTypeHierarchy

public ITypeHierarchy newTypeHierarchy(WorkingCopyOwner owner,
                                       IProgressMonitor monitor)
                                throws JavaModelException
Description copied from interface: IType
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.

Specified by:
newTypeHierarchy in interface IType
Parameters:
owner - the owner of working copies that take precedence over their original compilation units
monitor - the given progress monitor
Returns:
a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace
Throws:
JavaModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource.

resolved

public JavaElement resolved(Binding binding)
Overrides:
resolved in class JavaElement

sourceFileName

public java.lang.String sourceFileName(IBinaryType info)

toStringInfo

protected void toStringInfo(int tab,
                            java.lang.StringBuffer buffer,
                            java.lang.Object info,
                            boolean showResolvedInfo)
Description copied from class: JavaElement
Debugging purposes

Overrides:
toStringInfo in class JavaElement
showResolvedInfo - TODO

toStringName

protected void toStringName(java.lang.StringBuffer buffer)
Description copied from class: JavaElement
Debugging purposes

Overrides:
toStringName in class SourceRefElement

getAttachedJavadoc

public java.lang.String getAttachedJavadoc(IProgressMonitor monitor)
                                    throws JavaModelException
Description copied from interface: IJavaElement

Returns the Javadoc as an html source if this element has an attached javadoc, null otherwise.

This should be used only for binary elements. Source elements will always return null.

The encoding used to read the javadoc is the one defined by the content type of the file. If none is defined, then the project's encoding of this java element is used. If the project's encoding cannot be retrieved, then the platform encoding is used.

In case of the javadoc doesn't exist for this element, null is returned.

The html is extracted from the attached javadoc and provided as is. No transformation or validation is done.

Specified by:
getAttachedJavadoc in interface IJavaElement
Overrides:
getAttachedJavadoc in class JavaElement
Parameters:
monitor - the given progress monitor
Returns:
the extracted javadoc from the attached javadoc, null if none
Throws:
JavaModelException - if:
  • this element does not exist
  • retrieving the attached javadoc fails (timed-out, invalid URL, ...)
  • the format of the javadoc doesn't match expected standards (different anchors,...)
See Also:
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME

getJavadocContents

public JavadocContents getJavadocContents(IProgressMonitor monitor)
                                   throws JavaModelException
Throws:
JavaModelException