org.eclipse.xtext.builder
Class EclipseResourceFileSystemAccess2

java.lang.Object
  extended by org.eclipse.xtext.generator.AbstractFileSystemAccess
      extended by org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2
All Implemented Interfaces:
IFileSystemAccess, IFileSystemAccessExtension, IFileSystemAccessExtension2
Direct Known Subclasses:
JDTAwareEclipseResourceFileSystemAccess2

public class EclipseResourceFileSystemAccess2
extends AbstractFileSystemAccess

Since:
2.1
Author:
Sven Efftinge - Initial contribution and API

Nested Class Summary
static interface EclipseResourceFileSystemAccess2.IFileCallback
           
 
Field Summary
 
Fields inherited from interface org.eclipse.xtext.generator.IFileSystemAccess
DEFAULT_OUTPUT
 
Constructor Summary
EclipseResourceFileSystemAccess2()
           
 
Method Summary
protected  void createFolder(org.eclipse.core.resources.IFolder folder)
           
 void deleteFile(org.eclipse.core.resources.IFile file, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void deleteFile(java.lang.String fileName, java.lang.String outputName)
           
protected  void ensureExists(org.eclipse.core.resources.IContainer container)
           
protected  void ensureParentExists(org.eclipse.core.resources.IFile file)
           
 void flushSourceTraces()
          Can be used to announce that a builder participant is done with this file system access and all potentially recorded trace information should be persisted.
 void flushSourceTraces(java.lang.String generatorName)
          Can be used to announce that a builder participant is done with this file system access and all potentially recorded trace information should be persisted.
 void generateFile(java.lang.String fileName, java.lang.String outputName, java.lang.CharSequence contents)
           
protected  EclipseResourceFileSystemAccess2.IFileCallback getCallBack()
           
protected  java.lang.String getEncoding(org.eclipse.core.resources.IFile file)
           
protected  org.eclipse.core.resources.IFile getFile(java.lang.String fileName, java.lang.String outputName)
           
protected  org.eclipse.core.resources.IFolder getFolder(OutputConfiguration outputConfig)
           
protected  StringInputStream getInputStream(java.lang.String contentsAsString, java.lang.String encoding)
           
protected  org.eclipse.core.runtime.IProgressMonitor getMonitor()
           
protected  org.eclipse.core.resources.IFile getSmapFile(org.eclipse.core.resources.IFile javaSourceFile)
           
protected  org.eclipse.core.resources.IFile getTraceFile(org.eclipse.core.resources.IFile file)
           
 org.eclipse.emf.common.util.URI getURI(java.lang.String fileName, java.lang.String outputConfiguration)
          We cannot use the storage to URI mapper here, as it only works for Xtext based languages
protected  boolean hasContentsChanged(org.eclipse.core.resources.IFile file, StringInputStream newContent)
           
protected  void setDerived(org.eclipse.core.resources.IFile file, boolean derived)
           
 void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void setPostProcessor(EclipseResourceFileSystemAccess2.IFileCallback callBack)
           
 void setProject(org.eclipse.core.resources.IProject project)
           
protected  void updateSmapInformation(org.eclipse.core.resources.IFile smapFile, java.lang.CharSequence postProcessedContent, org.eclipse.core.resources.IFile javaSource)
           
protected  void updateTraceInformation(org.eclipse.core.resources.IFile traceFile, java.lang.CharSequence contents, boolean derived)
           
 
Methods inherited from class org.eclipse.xtext.generator.AbstractFileSystemAccess
deleteFile, generateFile, getOutputConfig, getOutputConfigurations, getPathes, getURI, postProcess, setOutputConfigurations, setOutputPath, setOutputPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipseResourceFileSystemAccess2

public EclipseResourceFileSystemAccess2()
Method Detail

getCallBack

protected EclipseResourceFileSystemAccess2.IFileCallback getCallBack()
Since:
2.3

setProject

public void setProject(org.eclipse.core.resources.IProject project)

setMonitor

public void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)

setPostProcessor

public void setPostProcessor(EclipseResourceFileSystemAccess2.IFileCallback callBack)

getMonitor

protected org.eclipse.core.runtime.IProgressMonitor getMonitor()

generateFile

public void generateFile(java.lang.String fileName,
                         java.lang.String outputName,
                         java.lang.CharSequence contents)
Parameters:
fileName - using '/' as file separator
outputName - the name of the output configuration
contents - the to-be-written contents.

getEncoding

protected java.lang.String getEncoding(org.eclipse.core.resources.IFile file)
                                throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException
Since:
2.3

setDerived

protected void setDerived(org.eclipse.core.resources.IFile file,
                          boolean derived)
                   throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException
Since:
2.3

createFolder

protected void createFolder(org.eclipse.core.resources.IFolder folder)
                     throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

ensureParentExists

protected void ensureParentExists(org.eclipse.core.resources.IFile file)
                           throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

ensureExists

protected void ensureExists(org.eclipse.core.resources.IContainer container)
                     throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getInputStream

protected StringInputStream getInputStream(java.lang.String contentsAsString,
                                           java.lang.String encoding)

getFolder

protected org.eclipse.core.resources.IFolder getFolder(OutputConfiguration outputConfig)

hasContentsChanged

protected boolean hasContentsChanged(org.eclipse.core.resources.IFile file,
                                     StringInputStream newContent)

updateTraceInformation

protected void updateTraceInformation(org.eclipse.core.resources.IFile traceFile,
                                      java.lang.CharSequence contents,
                                      boolean derived)
                               throws org.eclipse.core.runtime.CoreException,
                                      java.io.IOException
Throws:
org.eclipse.core.runtime.CoreException - if something unexpected happens during resource access
java.io.IOException - if serialization of the trace data fails
Since:
2.3

getSmapFile

protected org.eclipse.core.resources.IFile getSmapFile(org.eclipse.core.resources.IFile javaSourceFile)
Since:
2.3

updateSmapInformation

protected void updateSmapInformation(org.eclipse.core.resources.IFile smapFile,
                                     java.lang.CharSequence postProcessedContent,
                                     org.eclipse.core.resources.IFile javaSource)
Since:
2.3
This method is not intended to be referenced by clients.
This method is not intended to be referenced by clients.
This method is not intended to be extended (re-implement with a call to the overridden parent) or re-implemented (with no call to the overridden parent) by clients.
This method is not intended to be re-implemented or extended by clients.

flushSourceTraces

public void flushSourceTraces()
                       throws org.eclipse.core.runtime.CoreException
Can be used to announce that a builder participant is done with this file system access and all potentially recorded trace information should be persisted. Uses the default generator name.

Throws:
org.eclipse.core.runtime.CoreException
Since:
2.3
See Also:
TraceMarkers.DEFAULT_GENERATOR_NAME

flushSourceTraces

public void flushSourceTraces(java.lang.String generatorName)
                       throws org.eclipse.core.runtime.CoreException
Can be used to announce that a builder participant is done with this file system access and all potentially recorded trace information should be persisted.

Parameters:
generatorName - the name of the generator.
Throws:
org.eclipse.core.runtime.CoreException
Since:
2.3

getTraceFile

protected org.eclipse.core.resources.IFile getTraceFile(org.eclipse.core.resources.IFile file)
Since:
2.3

deleteFile

public void deleteFile(java.lang.String fileName,
                       java.lang.String outputName)
Specified by:
deleteFile in interface IFileSystemAccessExtension
Overrides:
deleteFile in class AbstractFileSystemAccess
Parameters:
fileName - using '/' as file separator
outputName - the name of the output configuration

deleteFile

public void deleteFile(org.eclipse.core.resources.IFile file,
                       org.eclipse.core.runtime.IProgressMonitor monitor)
                throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException
Since:
2.3

getFile

protected org.eclipse.core.resources.IFile getFile(java.lang.String fileName,
                                                   java.lang.String outputName)

getURI

public org.eclipse.emf.common.util.URI getURI(java.lang.String fileName,
                                              java.lang.String outputConfiguration)
We cannot use the storage to URI mapper here, as it only works for Xtext based languages

Since:
2.3