Dali Provisional API
Release 3.2

org.eclipse.jpt.common.core.resource.java
Interface JavaResourceCompilationUnit

All Superinterfaces:
JavaResourceNode, JavaResourceNode.Root, JptResourceModel, JptResourceTypeReference, Model
All Known Subinterfaces:
JavaResourcePackageInfoCompilationUnit

public interface JavaResourceCompilationUnit
extends JavaResourceNode.Root

Dali resource for JDT compilation unit (i.e. a Java source code file).

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Since:
3.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.resource.java.JavaResourceNode.Root
JavaResourceNode.Root.TypesTransformer
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.resource.java.JavaResourceNode
JavaResourceNode.FileTransformer, JavaResourceNode.Root
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
JptResourceTypeReference.ResourceTypeTransformer
 
Field Summary
static IContentType CONTENT_TYPE
          The content type for Java source code files.
static IContentType PACKAGE_INFO_CONTENT_TYPE
          The content type for package-info Java source code files.
 
Fields inherited from interface org.eclipse.jpt.common.core.resource.java.JavaResourceNode.Root
TYPES_COLLECTION, TYPES_TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.common.core.resource.java.JavaResourceNode
FILE_TRANSFORMER
 
Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
RESOURCE_TYPE_TRANSFORMER
 
Method Summary
 CompilationUnit buildASTRoot()
          Build an AST for the compilation unit with its bindings resolved.
 AnnotationEditFormatter getAnnotationEditFormatter()
          Return the JPA project's annotation formatter.
 ICompilationUnit getCompilationUnit()
          Return the corresponding JDT compilation unit.
 CommandExecutor getModifySharedDocumentCommandExecutor()
          This allows the resource model to modify the Java source code on the UI thread when it is executing on another thread.
 JavaResourceAbstractType getPrimaryType()
          The primary type of the AST compilation unit, can be null.
 void resolveTypes()
          Resolve type information that could be dependent on other files being added/removed.
 void synchronizeWithJavaSource()
          Something in Java has changed (typically either the compilation unit's source code or the Java classpath); synchronize the compilation unit's state with the Java source code etc.
 void synchronizeWithJavaSource(CompilationUnit astRoot)
          Call this method over synchronizeWithJavaSource() if possible It is more performant to pass an already build astRoot than to build a new one.
 void synchronizeWithJavaSourceIfNecessary()
          Checks IOpenable.isConsistent() and if true, does nothing.
 
Methods inherited from interface org.eclipse.jpt.common.core.resource.java.JavaResourceNode.Root
getAnnotationProvider, getTypes, resourceModelChanged
 
Methods inherited from interface org.eclipse.jpt.common.core.resource.java.JavaResourceNode
getFile, getJavaResourceCompilationUnit, getParent, getRoot, getTextRange
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener
 
Methods inherited from interface org.eclipse.jpt.common.core.JptResourceModel
addResourceModelListener, getFile, removeResourceModelListener
 
Methods inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference
getResourceType
 

Field Detail

CONTENT_TYPE

static final IContentType CONTENT_TYPE
The content type for Java source code files.


PACKAGE_INFO_CONTENT_TYPE

static final IContentType PACKAGE_INFO_CONTENT_TYPE
The content type for package-info Java source code files.

Method Detail

getCompilationUnit

ICompilationUnit getCompilationUnit()
Return the corresponding JDT compilation unit.


getAnnotationEditFormatter

AnnotationEditFormatter getAnnotationEditFormatter()
Return the JPA project's annotation formatter. This is used to make any manipulated annotations reasonably readable after being written to the Java source file.


getModifySharedDocumentCommandExecutor

CommandExecutor getModifySharedDocumentCommandExecutor()
This allows the resource model to modify the Java source code on the UI thread when it is executing on another thread.


resolveTypes

void resolveTypes()
Resolve type information that could be dependent on other files being added/removed.


getPrimaryType

JavaResourceAbstractType getPrimaryType()
The primary type of the AST compilation unit, can be null. This is named the same as the compilation unit.


synchronizeWithJavaSource

void synchronizeWithJavaSource()
Something in Java has changed (typically either the compilation unit's source code or the Java classpath); synchronize the compilation unit's state with the Java source code etc.


synchronizeWithJavaSource

void synchronizeWithJavaSource(CompilationUnit astRoot)
Call this method over synchronizeWithJavaSource() if possible It is more performant to pass an already build astRoot than to build a new one. The passed in CompilationUnit must have resolved bindings.


synchronizeWithJavaSourceIfNecessary

void synchronizeWithJavaSourceIfNecessary()
Checks IOpenable.isConsistent() and if true, does nothing. If false, calls synchronizeWithJavaSource() which calls buildASTRoot(). Trying to avoid building astRoots since that is expensive.


buildASTRoot

CompilationUnit buildASTRoot()
Build an AST for the compilation unit with its bindings resolved.


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.