Class 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.
    • Nested Class Summary

      • 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, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList
      • 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean isUpdating  
      protected OperationCanceledManager operationCanceledManager  
      static java.lang.String OPTION_ENCODING  
      static java.lang.String OPTION_FORMAT
      Deprecated.
      static java.lang.String OPTION_RESOLVE_ALL  
      static java.lang.String OPTION_SERIALIZATION_OPTIONS
      Deprecated.
      • 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_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, 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
    • Constructor Summary

      Constructors 
      Constructor Description
      XtextResource()  
      XtextResource​(org.eclipse.emf.common.util.URI uri)  
    • Field Detail

      • OPTION_RESOLVE_ALL

        public static final java.lang.String OPTION_RESOLVE_ALL
      • OPTION_FORMAT

        @Deprecated
        public static final java.lang.String OPTION_FORMAT
        Deprecated.
      • OPTION_SERIALIZATION_OPTIONS

        @Deprecated
        public static final java.lang.String OPTION_SERIALIZATION_OPTIONS
        Deprecated.
      • OPTION_ENCODING

        public static final java.lang.String OPTION_ENCODING
      • isUpdating

        protected volatile boolean isUpdating
        Since:
        2.1
    • Constructor Detail

      • XtextResource

        public XtextResource​(org.eclipse.emf.common.util.URI uri)
      • XtextResource

        public XtextResource()
    • Method Detail

      • setResourceServiceProvider

        public void setResourceServiceProvider​(IResourceServiceProvider resourceServiceProvider)
      • setInjectedParser

        @Inject
        protected void setInjectedParser​(IParser parser)
      • 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
      • createReader

        protected java.io.Reader createReader​(java.io.InputStream inputStream)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
        Since:
        2.5
      • 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
      • relink

        public void relink()
        Since:
        2.9
      • 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)
      • clearCache

        protected void clearCache()
        Since:
        2.26
      • 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
      • basicGetEObject

        protected org.eclipse.emf.ecore.EObject basicGetEObject​(java.lang.String uriFragment)
        Resolves a fragment to an EObject. The returned object is not necessarily contained in this resource. It may resolve to a different one, instead. The result may be null.
        Since:
        2.4
        See Also:
        ResourceImpl.getEObject(String), IFragmentProvider
      • 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
      • addSyntaxDiagnostic

        protected void addSyntaxDiagnostic​(java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> diagnostics,
                                           INode error)
        Since:
        2.7
      • getParser

        public IParser getParser()
      • setParser

        public void setParser​(IParser parser)
      • getEntryPoint

        public ParserRule getEntryPoint()
      • setEntryPoint

        public void setEntryPoint​(ParserRule parserRule)
      • validateConcreteSyntax

        public java.util.List<org.eclipse.emf.common.util.Diagnostic> validateConcreteSyntax()
      • getLinker

        public ILinker getLinker()
      • setLinker

        public void setLinker​(ILinker linker)
      • setFragmentProvider

        public void setFragmentProvider​(IFragmentProvider fragmentProvider)
      • setSerializer

        public void setSerializer​(ISerializer serializer)
      • setParseResult

        public void setParseResult​(IParseResult parseResult)
      • isValidationDisabled

        public boolean isValidationDisabled()
      • setValidationDisabled

        public void setValidationDisabled​(boolean validationDisabled)
      • getCache

        public org.eclipse.xtext.util.IResourceScopeCache getCache()
      • setCache

        public void setCache​(org.eclipse.xtext.util.IResourceScopeCache cache)
      • getLanguageName

        public java.lang.String getLanguageName()
      • setLanguageName

        public void setLanguageName​(java.lang.String languageName)
        Since:
        2.3
      • setModificationStamp

        public void setModificationStamp​(long documentModificationStamp)
        Since:
        2.4
      • getModificationStamp

        public long getModificationStamp()
        The modification stamp of the document reflected in the current state of this resource. Has to be set externally.
        Since:
        2.4