org.netbeans.modules.java.source 0.80.1 17

org.netbeans.api.java.source
Class CompilationController

java.lang.Object
  extended by org.netbeans.api.java.source.CompilationInfo
      extended by org.netbeans.api.java.source.CompilationController
Direct Known Subclasses:
WorkingCopy

public class CompilationController
extends CompilationInfo

Class for explicit invocation of compilation phases on a java source. The implementation delegates to the CompilationInfo to get the data, the access to CompilationInfo is not synchronized, so the class isn't reentrant. XXX: make toPhase automatic in getTrees(), Trees.getElement, etc....


Method Summary
protected  void doInvalidate()
          Marks this CompilationInfo as invalid, may be used to verify confinement.
static CompilationController get(org.netbeans.modules.parsing.spi.Parser.Result result)
          Returns an instance of the CompilationController for given Parser.Result if it is a result of a java parser.
 JavaSource.Phase toPhase(JavaSource.Phase phase)
          Moves the state to required phase.
 
Methods inherited from class org.netbeans.api.java.source.CompilationInfo
getChangedTree, getClasspathInfo, getCompilationUnit, getDiagnostics, getDocument, getElements, getElementUtilities, getFileObject, getJavaSource, getPhase, getPositionConverter, getSnapshot, getSourceVersion, getText, getTokenHierarchy, getTopLevelElements, getTrees, getTreeUtilities, getTypes, getTypeUtilities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

@NullUnknown
public static CompilationController get(@NonNull
                                                    org.netbeans.modules.parsing.spi.Parser.Result result)
Returns an instance of the CompilationController for given Parser.Result if it is a result of a java parser.

Parameters:
result - for which the CompilationController should be returned.
Returns:
a CompilationController or null when the given result is not a result of java parsing.
Since:
0.42

toPhase

@NonNull
public JavaSource.Phase toPhase(@NonNull
                                        JavaSource.Phase phase)
                         throws IOException
Moves the state to required phase. If given state was already reached the state is not changed. The method will throw exception if a state is illegal required. Acceptable parameters for thid method are
  • org.netbeans.api.java.source.JavaSource.Phase.PARSED
  • org.netbeans.api.java.source.JavaSource.Phase.ELEMENTS_RESOLVED
  • org.netbeans.api.java.source.JavaSource.Phase.RESOLVED
  • org.netbeans.api.java.source.JavaSource.Phase.UP_TO_DATE

    Parameters:
    phase - The required phase
    Returns:
    the reached state
    Throws:
    IllegalArgumentException - in case that given state can not be reached using this method
    IOException - when the file cannot be red

  • doInvalidate

    protected void doInvalidate()
    Marks this CompilationInfo as invalid, may be used to verify confinement.

    Overrides:
    doInvalidate in class CompilationInfo

    org.netbeans.modules.java.source 0.80.1 17

    Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.