Package org.eclipse.handly.model.impl.support

## Class FsSourceFile

- java.lang.Object
- - org.eclipse.core.runtime.PlatformObject
  - - org.eclipse.handly.model.impl.support.Element
    - - org.eclipse.handly.model.impl.support.SourceFile
      - - org.eclipse.handly.model.impl.support.FsSourceFile

- All Implemented Interfaces:
    `org.eclipse.core.runtime.IAdaptable`, `IElement`, `IElementImpl`, `IElementImplExtension`, `ISourceElementImpl`, `ISourceFileImpl`, `ISourceFileImplExtension`, `IElementImplSupport`, `IModelManager.Provider`, `ISourceElementImplSupport`, `ISourceFileImplSupport`, `ISourceElement`, `ISourceFile`

      public abstract class FsSourceFile
      extends SourceFile

  Provides a skeletal implementation of `ISourceFileImplExtension` for source files that have an underlying `IFileStore`. This class is just an implementation convenience. Clients might as well implement a source file by extending `SourceFile` or implementing ("mixing in") `ISourceFileImplSupport` directly if extending this class is not possible/desirable for some reason.
  Since:
    1.3
  See Also:
    `BaseSourceFile`, `WorkspaceSourceFile`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.handly.model.impl.IElementImplExtension

      `IElementImplExtension.CloseHint`

    - ### Nested classes/interfaces inherited from interface org.eclipse.handly.model.impl.support.ISourceFileImplSupport

      `ISourceFileImplSupport.NotifyingReconcileOperation, ISourceFileImplSupport.ReconcileOperation`

  - ### Field Summary

    - ### Fields inherited from interface org.eclipse.handly.model.impl.IElementImplExtension

      `CLOSE_HINT, FORCE_OPEN`

    - ### Fields inherited from interface org.eclipse.handly.model.impl.support.IElementImplSupport

      `NEW_ELEMENTS, NO_BODY`

    - ### Fields inherited from interface org.eclipse.handly.model.impl.ISourceFileImplExtension

      `WORKING_COPY_BUFFER, WORKING_COPY_CALLBACK, WORKING_COPY_CONTEXT`

    - ### Fields inherited from interface org.eclipse.handly.model.impl.support.ISourceFileImplSupport

      `SOURCE_AST, SOURCE_CONTENTS, SOURCE_SNAPSHOT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FsSourceFile​(IElement parent, org.eclipse.core.filesystem.IFileStore fileStore)` | Constructs a handle for a source file with the given parent element and the given underlying `IFileStore`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `getFileObject_()` | Returns the underlying file object, if any.
    `org.eclipse.core.filesystem.IFileStore` | `getFileStore_()` | Returns the corresponding `IFileStore`, or `null` if this source file has no corresponding file store.
    `java.net.URI` | `getLocationUri_()` | Returns a file system location for this element.

    - ### Methods inherited from class org.eclipse.handly.model.impl.support.Element

      `equals, getName_, getParent_, hashCode, toString`

    - ### Methods inherited from class org.eclipse.core.runtime.PlatformObject

      `getAdapter`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.handly.model.IElement

      `equals, hashCode`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.IElementImpl

      `equalsAndSameParentChain_, fetchChildren_, fetchChildrenOfType_, getChildrenOfType_, getHandleMemento_, getName_, getParent_, getResource_, getRoot_, toDisplayString_`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.IElementImplExtension

      `close_, getBody_, getBody_, getChildren_`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.support.IElementImplSupport

      `canEqual_, exists_, findBody_, getChildrenFromBody_, getElementManager_, getModel_, isOpenable_, newDoesNotExistException_, open_, peekAtBody_, remove_, removing_, toString_, toStringAncestors_, toStringBody_, toStringChildren_`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.support.IModelManager.Provider

      `getModelManager_`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.support.ISourceElementImplSupport

      `getSourceElementAt_, getSourceElementAt_, getSourceElementInfo_`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.ISourceFileImpl

      `getFile_`

    - ### Methods inherited from interface org.eclipse.handly.model.impl.support.ISourceFileImplSupport

      `acquireExistingWorkingCopy_, becomeWorkingCopy_, buildSourceStructure_, buildStructure_, close_, defaultEquals_, defaultHashCode_, fileExists_, getBuffer_, getFileBuffer_, getFileSnapshotProvider_, getReconcileOperation_, getWorkingCopyContext_, isWorkingCopy_, needsReconciling_, newWorkingCopyContext_, openParent_, reconcile_, releaseWorkingCopy_, toStringName_, validateExistence_, workingCopyModeChanged_`

- - ### Constructor Detail

    - #### FsSourceFile

          public FsSourceFile​(IElement parent,
                              org.eclipse.core.filesystem.IFileStore fileStore)

      Constructs a handle for a source file with the given parent element and the given underlying `IFileStore`.
      Parameters:
        `parent` - the parent of the element, or `null` if the element has no parent
        `fileStore` - the underlying `IFileStore` (not `null`)

  - ### Method Detail

    - #### getFileStore_

          public final org.eclipse.core.filesystem.IFileStore getFileStore_()

      Description copied from interface: `ISourceFileImpl`
      Returns the corresponding `IFileStore`, or `null` if this source file has no corresponding file store.

      This implementation returns the file store corresponding to the `location URI`, if any.

      Returns:
        the corresponding `IFileStore`, or `null` if this source file has no corresponding file store

    - #### getFileObject_

          public final java.lang.Object getFileObject_()

      Description copied from interface: `ISourceFileImplSupport`
      Returns the underlying file object, if any. The relationship between a source file and its underlying file object does not change.

      This implementation returns the underlying `IFile`, if any. If there is no underlying `IFile`, this implementation returns the corresponding `IFileStore` (if any), on the assumption that the relationship between this source file and the file store does not change.

      Returns:
        the underlying file object, or `null` if none
      See Also:
        `ISourceFileImpl.getFile_()`, `ISourceFileImpl.getFileStore_()`

    - #### getLocationUri_

          public final java.net.URI getLocationUri_()

      Description copied from interface: `IElementImpl`
      Returns a file system location for this element. The resulting URI is suitable to passing to `EFS.getStore(URI)`. Returns `null` if no location can be determined.
      Returns:
        a file system location for this element, or `null` if no location can be determined