org.eclipse.xtext.resource
Class XtextResource
java.lang.Object
org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.NotifierImpl
org.eclipse.emf.ecore.resource.impl.ResourceImpl
org.eclipse.xtext.resource.XtextResource
- All Implemented Interfaces:
- org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource.Internal
- Direct Known Subclasses:
- LazyLinkingResource
public class XtextResource
- extends org.eclipse.emf.ecore.resource.impl.ResourceImpl
An EMF resource that reads and writes models of an Xtext DSL.
- Author:
- Jan Köhnlein, Heiko Behrens, Dennis Hübner, Moritz Eysholdt, Sebastian Zarnekow, Sven Efftinge
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
org.eclipse.emf.ecore.resource.impl.ResourceImpl.ContentsEList<E extends java.lang.Object & org.eclipse.emf.ecore.EObject>, org.eclipse.emf.ecore.resource.impl.ResourceImpl.ModificationTrackingAdapter |
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList |
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource |
org.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException |
Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
contents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warnings |
Fields inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl |
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG |
Fields inherited from interface org.eclipse.emf.ecore.resource.Resource |
OPTION_CIPHER, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS |
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getContents, getDefaultURIConverter, getEObject, getEObjectByID, getEObjectForURIFragmentRootSegment, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getURI, getURIConverter, getURIFragmentRootSegment, getWarnings, handleLoadResponse, handleSaveResponse, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZip |
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl |
eAdapters, eBasicAdapters, eDeliver, eSetDeliver |
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
eAdapters, eDeliver, eNotify, eSetDeliver |
OPTION_RESOLVE_ALL
public static final java.lang.String OPTION_RESOLVE_ALL
OPTION_FORMAT
@Deprecated
public static final java.lang.String OPTION_FORMAT
- Deprecated. use
SaveOptions#configure(Map)
instead.
OPTION_SERIALIZATION_OPTIONS
@Deprecated
public static final java.lang.String OPTION_SERIALIZATION_OPTIONS
- Deprecated. use
SaveOptions#configure(Map)
instead.
OPTION_ENCODING
public static final java.lang.String OPTION_ENCODING
isUpdating
protected volatile boolean isUpdating
- Since:
- 2.1
XtextResource
public XtextResource(org.eclipse.emf.common.util.URI uri)
XtextResource
public XtextResource()
getResourceServiceProvider
public IResourceServiceProvider getResourceServiceProvider()
setResourceServiceProvider
public void setResourceServiceProvider(IResourceServiceProvider resourceServiceProvider)
setInjectedParser
@Inject
protected void setInjectedParser(IParser parser)
getParseResult
public IParseResult getParseResult()
doLoad
protected void doLoad(java.io.InputStream inputStream,
java.util.Map<?,?> options)
throws java.io.IOException
- Overrides:
doLoad
in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
- Throws:
java.io.IOException
setEncodingFromOptions
protected void setEncodingFromOptions(java.util.Map<?,?> options)
getEncoding
public java.lang.String getEncoding()
reparse
public void reparse(java.lang.String newContent)
throws java.io.IOException
- Throws:
java.io.IOException
reattachModificationTracker
protected void reattachModificationTracker(org.eclipse.emf.ecore.EObject element)
doUnload
protected void doUnload()
- Overrides:
doUnload
in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
update
public void update(int offset,
int replacedTextLength,
java.lang.String newText)
updateInternalState
protected void updateInternalState(IParseResult oldParseResult,
IParseResult newParseResult)
- Parameters:
oldParseResult
- the previous parse result that should be detached if necessary.newParseResult
- the current parse result that should be attached to the content of this resource- Since:
- 2.1
updateInternalState
protected void updateInternalState(IParseResult newParseResult)
clearErrorsAndWarnings
protected void clearErrorsAndWarnings()
addSyntaxErrors
protected void addSyntaxErrors()
unload
protected void unload(org.eclipse.emf.ecore.EObject oldRootObject)
clearInternalState
protected void clearInternalState()
doLinking
protected void doLinking()
getEObject
public org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment)
- Specified by:
getEObject
in interface org.eclipse.emf.ecore.resource.Resource
- Overrides:
getEObject
in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
getURIFragment
public java.lang.String getURIFragment(org.eclipse.emf.ecore.EObject object)
- Specified by:
getURIFragment
in interface org.eclipse.emf.ecore.resource.Resource
- Overrides:
getURIFragment
in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
doSave
public void doSave(java.io.OutputStream outputStream,
java.util.Map<?,?> options)
throws java.io.IOException
- Overrides:
doSave
in class org.eclipse.emf.ecore.resource.impl.ResourceImpl
- Throws:
java.io.IOException
getParser
public IParser getParser()
setParser
public void setParser(IParser parser)
getConcreteSyntaxValidator
public IConcreteSyntaxValidator getConcreteSyntaxValidator()
validateConcreteSyntax
public java.util.List<org.eclipse.emf.common.util.Diagnostic> validateConcreteSyntax()
getLinker
public ILinker getLinker()
setLinker
public void setLinker(ILinker linker)
getFragmentProvider
public IFragmentProvider getFragmentProvider()
setFragmentProvider
public void setFragmentProvider(IFragmentProvider fragmentProvider)
getSerializer
public ISerializer getSerializer()
setSerializer
public void setSerializer(ISerializer serializer)
setParseResult
public void setParseResult(IParseResult parseResult)
isValidationDisabled
public boolean isValidationDisabled()
setValidationDisabled
public void setValidationDisabled(boolean validationDisabled)
setUnloader
public void setUnloader(IReferableElementsUnloader unloader)
getUnloader
public IReferableElementsUnloader getUnloader()
getCache
public IResourceScopeCache getCache()
setCache
public void setCache(IResourceScopeCache cache)
getLanguageName
public java.lang.String getLanguageName()