org.netbeans.modules.java.source 0.80.1 17

org.netbeans.api.java.source
Class ModificationResult

java.lang.Object
  extended by org.netbeans.api.java.source.ModificationResult

public final class ModificationResult
extends Object

Class that collects changes built during a modification task run.


Nested Class Summary
static class ModificationResult.Difference
           
 
Method Summary
 void commit()
          Once all of the changes have been collected, this method can be used to commit the changes to the source files
 List<? extends ModificationResult.Difference> getDifferences(FileObject fo)
           
 Set<? extends FileObject> getModifiedFileObjects()
           
 Set<File> getNewFiles()
           
 String getResultingSource(FileObject fileObject)
          Returned string represents preview of resulting source.
 int[] getSpan(Object tag)
          Provides span of tree tagged with tag
static ModificationResult runModificationTask(Collection<org.netbeans.modules.parsing.api.Source> sources, org.netbeans.modules.parsing.api.UserTask task)
          Runs a task over given sources, the task has an access to the WorkingCopy using the WorkingCopy.get(org.netbeans.modules.parsing.spi.Parser.Result) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

runModificationTask

@NonNull
public static ModificationResult runModificationTask(@NonNull
                                                             Collection<org.netbeans.modules.parsing.api.Source> sources,
                                                             @NonNull
                                                             org.netbeans.modules.parsing.api.UserTask task)
                                              throws org.netbeans.modules.parsing.spi.ParseException
Runs a task over given sources, the task has an access to the WorkingCopy using the WorkingCopy.get(org.netbeans.modules.parsing.spi.Parser.Result) method.

Parameters:
sources - on which the given task will be performed
task - to be performed
Returns:
the ModificationResult
Throws:
org.netbeans.modules.parsing.spi.ParseException
Since:
0.42

getModifiedFileObjects

@NonNull
public Set<? extends FileObject> getModifiedFileObjects()

getDifferences

public List<? extends ModificationResult.Difference> getDifferences(@NonNull
                                                                    FileObject fo)

getNewFiles

@NonNull
public Set<File> getNewFiles()

commit

public void commit()
            throws IOException
Once all of the changes have been collected, this method can be used to commit the changes to the source files

Throws:
IOException

getResultingSource

@NonNull
public String getResultingSource(@NonNull
                                         FileObject fileObject)
                          throws IOException,
                                 IllegalArgumentException
Returned string represents preview of resulting source. No difference really is applied. Respects isExcluded() flag of difference.

Parameters:
there - can be more resulting source, user has to specify which wants to preview.
Returns:
if changes are applied source looks like return string
Throws:
IllegalArgumentException - if the provided FileObject is not modified in this ModificationResult
IOException

getSpan

@NullUnknown
public int[] getSpan(@NonNull
                                 Object tag)
Provides span of tree tagged with tag

Parameters:
tag -
Returns:
borders in target document
Since:
0.37

org.netbeans.modules.java.source 0.80.1 17

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