Class AssistCompilationUnit

java.lang.Object
org.eclipse.core.runtime.PlatformObject
All Implemented Interfaces:
IBufferChangedListener, ICodeAssist, ICompilationUnit, IJavaElement, IOpenable, IParent, ISourceManipulation, ISourceReference, ITypeRoot, IWorkingCopy, ICompilationUnit, IDependent, SuffixConstants, org.eclipse.core.runtime.IAdaptable

public class AssistCompilationUnit extends CompilationUnit
  • Constructor Details

  • Method Details

    • getElementInfo

      public 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.
      Specified by:
      getImportContainer in interface ICompilationUnit
      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(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.
      Specified by:
      getPackageDeclaration in interface ICompilationUnit
      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(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.
      Specified by:
      getType in interface ICompilationUnit
      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