Class XtextFile
- 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.WorkspaceSourceFile
-
- com._1c.g5.ides.core.handle.impl.xtext.XtextFile
-
- All Implemented Interfaces:
IXtextFile
,org.eclipse.core.runtime.IAdaptable
,org.eclipse.handly.model.IElement
,org.eclipse.handly.model.impl.IElementImpl
,org.eclipse.handly.model.impl.IElementImplExtension
,org.eclipse.handly.model.impl.ISourceElementImpl
,org.eclipse.handly.model.impl.ISourceFileImpl
,org.eclipse.handly.model.impl.ISourceFileImplExtension
,org.eclipse.handly.model.impl.support.IElementImplSupport
,org.eclipse.handly.model.impl.support.IModelManager.Provider
,org.eclipse.handly.model.impl.support.ISourceElementImplSupport
,org.eclipse.handly.model.impl.support.ISourceFileImplSupport
,org.eclipse.handly.model.ISourceElement
,org.eclipse.handly.model.ISourceFile
,org.eclipse.xtext.util.concurrent.IReadAccess<org.eclipse.xtext.resource.XtextResource>
,org.eclipse.xtext.util.concurrent.IWriteAccess<org.eclipse.xtext.resource.XtextResource>
public abstract class XtextFile extends org.eclipse.handly.model.impl.support.WorkspaceSourceFile implements IXtextFile
Represents an Xtext-based source file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.handly.model.impl.IElementImplExtension
org.eclipse.handly.model.impl.IElementImplExtension.CloseHint
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.util.concurrent.IReadAccess
org.eclipse.xtext.util.concurrent.IReadAccess.Priority<State extends Object>
-
Nested classes/interfaces inherited from interface org.eclipse.handly.model.impl.support.ISourceFileImplSupport
org.eclipse.handly.model.impl.support.ISourceFileImplSupport.NotifyingReconcileOperation, org.eclipse.handly.model.impl.support.ISourceFileImplSupport.ReconcileOperation
-
Nested classes/interfaces inherited from interface com._1c.g5.ides.core.handle.xtext.IXtextFile
IXtextFile.IModifyingUnitOfWork<T>, IXtextFile.ModifyingUnitOfWork, IXtextFile.ModifyingUnitOfWorkWithDelegate
-
-
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
-
-
Constructor Summary
Constructors Constructor Description XtextFile(org.eclipse.handly.model.impl.support.Element parent, org.eclipse.core.resources.IFile file)
Constructs a handle for an Xtext-based source file with the given parent element and the given underlying workspace file.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
buildSourceStructure_(org.eclipse.handly.context.IContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
protected abstract void
buildStructure(org.eclipse.handly.context.IContext context, org.eclipse.xtext.resource.XtextResource resource)
Creates and initializes bodies for the given XtextResource's contents.protected org.eclipse.xtext.resource.IResourceServiceProvider
getResourceServiceProvider()
Returns theIResourceSetProvider
corresponding to this file.protected org.eclipse.emf.common.util.URI
getResourceUri()
Returns the EMF resource URI for this file.protected <T> T
internalModify(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work)
The actual implementation ofmodify(IUnitOfWork)
protected <T> T
internalReadOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work)
The actual implementation ofreadOnly(IUnitOfWork)
<T> T
modify(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work)
protected org.eclipse.xtext.resource.XtextResource
parse(String contents, String encoding)
Returns a newXtextResource
loaded from the given contents.<T> T
readOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work)
-
Methods inherited from class org.eclipse.handly.model.impl.support.WorkspaceSourceFile
getFile_, getFileObject_, getResource_
-
Methods inherited from class org.eclipse.handly.model.impl.support.Element
equals, getName_, getParent_, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.handly.model.impl.IElementImpl
equalsAndSameParentChain_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getName_, getParent_, 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.xtext.util.concurrent.IReadAccess
tryReadOnly, tryReadOnly, tryReadOnly
-
Methods inherited from interface org.eclipse.handly.model.impl.support.ISourceElementImplSupport
getSourceElementAt_, getSourceElementAt_, getSourceElementInfo_
-
Methods inherited from interface org.eclipse.handly.model.impl.support.ISourceFileImplSupport
acquireExistingWorkingCopy_, becomeWorkingCopy_, buildStructure_, close_, defaultEquals_, defaultHashCode_, fileExists_, getBuffer_, getFileBuffer_, getFileSnapshotProvider_, getReconcileOperation_, getWorkingCopyContext_, isWorkingCopy_, needsReconciling_, newWorkingCopyContext_, openParent_, reconcile_, releaseWorkingCopy_, toStringName_, validateExistence_, workingCopyModeChanged_
-
-
-
-
Constructor Detail
-
XtextFile
public XtextFile(org.eclipse.handly.model.impl.support.Element parent, org.eclipse.core.resources.IFile file)
Constructs a handle for an Xtext-based source file with the given parent element and the given underlying workspace file.- Parameters:
parent
- the parent of the element (notnull
)file
- the workspace file underlying the element (notnull
)
-
-
Method Detail
-
readOnly
public <T> T readOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work)
- Specified by:
readOnly
in interfaceorg.eclipse.xtext.util.concurrent.IReadAccess<org.eclipse.xtext.resource.XtextResource>
-
modify
public <T> T modify(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work)
- Specified by:
modify
in interfaceorg.eclipse.xtext.util.concurrent.IWriteAccess<org.eclipse.xtext.resource.XtextResource>
-
buildSourceStructure_
public void buildSourceStructure_(org.eclipse.handly.context.IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
- Specified by:
buildSourceStructure_
in interfaceorg.eclipse.handly.model.impl.support.ISourceFileImplSupport
- Throws:
org.eclipse.core.runtime.CoreException
-
buildStructure
protected abstract void buildStructure(org.eclipse.handly.context.IContext context, org.eclipse.xtext.resource.XtextResource resource)
Creates and initializes bodies for the given XtextResource's contents.The resource is safe to read in the dynamic context of the method call, but must not be modified. Implementations must not keep references to any part of the given resource (including the node model) outside the dynamic scope of the invocation of this method.
- Parameters:
context
- the operation context (nevernull
)resource
- anXtextResource
corresponding to this file (nevernull
)
-
internalReadOnly
protected <T> T internalReadOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work) throws Exception
The actual implementation ofreadOnly(IUnitOfWork)
- Parameters:
work
-- Returns:
- Throws:
Exception
-
internalModify
protected <T> T internalModify(org.eclipse.xtext.util.concurrent.IUnitOfWork<T,org.eclipse.xtext.resource.XtextResource> work) throws Exception
The actual implementation ofmodify(IUnitOfWork)
- Parameters:
work
-- Returns:
- Throws:
Exception
-
parse
protected org.eclipse.xtext.resource.XtextResource parse(String contents, String encoding) throws IOException
Returns a newXtextResource
loaded from the given contents. The resource is created in a newResourceSet
obtained from theIResourceSetProvider
corresponding to this file. The resource's encoding is set to the given value. This is a handle-only method.- Parameters:
contents
- the contents to parse (notnull
)encoding
- the encoding to be set for the createdXtextResource
(notnull
)- Returns:
- the new
XtextResource
loaded from the given contents (nevernull
) - Throws:
IOException
- if resource loading failed
-
getResourceServiceProvider
protected org.eclipse.xtext.resource.IResourceServiceProvider getResourceServiceProvider()
Returns theIResourceSetProvider
corresponding to this file. This is a handle-only method.- Returns:
- the
IResourceSetProvider
for this file (nevernull
)
-
getResourceUri
protected org.eclipse.emf.common.util.URI getResourceUri()
Returns the EMF resource URI for this file. This is a handle-only method.- Returns:
- the resource URI for this file (never
null
)
-
-