org.eclipse.jdt.internal.codeassist.impl
Class AssistCompilationUnit

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.jdt.internal.core.JavaElement
          extended by org.eclipse.jdt.internal.core.Openable
              extended by org.eclipse.jdt.internal.core.CompilationUnit
                  extended by org.eclipse.jdt.internal.codeassist.impl.AssistCompilationUnit
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IBufferChangedListener, ICodeAssist, IJavaElement, IOpenable, IParent, ISourceManipulation, ISourceReference, ITypeRoot, IWorkingCopy, ICompilationUnit, IDependent, SuffixConstants

public class AssistCompilationUnit
extends CompilationUnit


Field Summary
 
Fields inherited from class org.eclipse.jdt.internal.core.CompilationUnit
owner
 
Fields inherited from class 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
 
Fields inherited from interface org.eclipse.jdt.core.ICompilationUnit
ENABLE_BINDINGS_RECOVERY, ENABLE_STATEMENTS_RECOVERY, FORCE_PROBLEM_DETECTION, NO_AST
 
Fields inherited from interface 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.eclipse.jdt.internal.compiler.env.IDependent
JAR_FILE_ENTRY_SEPARATOR
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.util.SuffixConstants
EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA
 
Constructor Summary
AssistCompilationUnit(ICompilationUnit compilationUnit, WorkingCopyOwner owner, java.util.Map bindingCache, java.util.Map infoCache)
           
 
Method Summary
 java.lang.Object getElementInfo(org.eclipse.core.runtime.IProgressMonitor monitor)
          Returns the info for this handle.
 IImportContainer getImportContainer()
          Returns the import container for this compilation unit.
 IPackageDeclaration getPackageDeclaration(java.lang.String pkg)
          Returns the first package declaration in this compilation unit with the given package name (there normally is at most one package declaration).
 IType getType(java.lang.String typeName)
          Returns the top-level type declared in this compilation unit with the given simple type name.
 boolean hasChildren()
          Returns whether this element has one or more immediate children.
 
Methods inherited from class org.eclipse.jdt.internal.core.CompilationUnit
applyTextEdit, becomeWorkingCopy, becomeWorkingCopy, canBeRemovedFromCache, canBufferBeRemovedFromCache, cloneCachingContents, close, codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeSelect, codeSelect, commit, commitWorkingCopy, copy, createImport, createImport, createPackageDeclaration, createType, delete, destroy, discardWorkingCopy, equals, findElements, findPrimaryType, findSharedWorkingCopy, findWorkingCopy, getAllTypes, getCompilationUnit, getContents, getCorrespondingResource, getElementAt, getElementName, getElementType, getFileName, getHandleFromMemento, getImport, getImports, getMainTypeName, getOriginal, getOriginalElement, getOwner, getPackageDeclarations, getPackageName, getPath, getPerWorkingCopyInfo, getPrimary, getPrimaryElement, getSharedWorkingCopy, getSource, getSourceRange, getTypeRoot, getTypes, getUnderlyingResource, getWorkingCopy, getWorkingCopy, getWorkingCopy, getWorkingCopy, getWorkingCopy, hasResourceChanged, isBasedOn, isConsistent, isPrimary, isWorkingCopy, makeConsistent, makeConsistent, move, originalFromClone, reconcile, reconcile, reconcile, reconcile, reconcile, rename, resource, restore, save
 
Methods inherited from class org.eclipse.jdt.internal.core.Openable
bufferChanged, exists, findRecommendedLineSeparator, getBuffer, getBufferFactory, getOpenable, getPackageFragmentRoot, getResource, hasUnsavedChanges, isOpen, isStructureKnown, open, resource
 
Methods inherited from class org.eclipse.jdt.internal.core.JavaElement
findNode, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getJavaModel, getJavaProject, getOpenableParent, getParent, getPrimaryElement, getSchedulingRule, getSourceMapper, hashCode, isAncestorOf, isReadOnly, newJavaModelException, newNotPresentException, readableName, resolved, toDebugString, toString, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly, isStructureKnown
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jdt.core.IParent
getChildren
 
Methods inherited from interface org.eclipse.jdt.core.IOpenable
findRecommendedLineSeparator, getBuffer, hasUnsavedChanges, isOpen, open
 
Methods inherited from interface org.eclipse.jdt.core.ISourceReference
exists
 

Constructor Detail

AssistCompilationUnit

public AssistCompilationUnit(ICompilationUnit compilationUnit,
                             WorkingCopyOwner owner,
                             java.util.Map bindingCache,
                             java.util.Map infoCache)
Method Detail

getElementInfo

public java.lang.Object getElementInfo(org.eclipse.core.runtime.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

getImportContainer

public IImportContainer getImportContainer()
Description copied from interface: ICompilationUnit
Returns the import container for this compilation unit. This is a handle-only method. The import container may or may not exist. The import container can used to access the imports.

Overrides:
getImportContainer in class CompilationUnit
Returns:
a handle onto the corresponding import container. The import contain may or may not exist.
See Also:
ICompilationUnit.getImportContainer()

getPackageDeclaration

public IPackageDeclaration getPackageDeclaration(java.lang.String pkg)
Description copied from interface: ICompilationUnit
Returns the first package declaration in this compilation unit with the given package name (there normally is at most one package declaration). This is a handle-only method. The package declaration may or may not exist.

Overrides:
getPackageDeclaration in class CompilationUnit
Parameters:
pkg - the name of the package declaration as defined by JLS2 7.4. (For example, "java.lang")
Returns:
the first package declaration in this compilation unit with the given package name
See Also:
ICompilationUnit.getPackageDeclaration(String)

getType

public IType getType(java.lang.String typeName)
Description copied from interface: ICompilationUnit
Returns the top-level type declared in this compilation unit with the given simple type name. The type name has to be a valid compilation unit name. This is a handle-only method. The type may or may not exist.

Overrides:
getType in class CompilationUnit
Parameters:
typeName - the simple name of the requested type in the compilation unit
Returns:
a handle onto the corresponding type. The type may or may not exist.
See Also:
ICompilationUnit.getType(String)

hasChildren

public boolean hasChildren()
                    throws JavaModelException
Description copied from interface: IParent
Returns whether this element has one or more immediate children. This is a convenience method, and may be more efficient than testing whether getChildren is an empty array.

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