org.eclipse.ocl.examples.xtext.essentialocl.utilities
Class EssentialOCLCSResource

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.common.notify.impl.NotifierImpl
          extended by org.eclipse.emf.ecore.resource.impl.ResourceImpl
              extended by org.eclipse.xtext.resource.XtextResource
                  extended by org.eclipse.xtext.linking.lazy.LazyLinkingResource
                      extended by org.eclipse.ocl.examples.xtext.essentialocl.utilities.EssentialOCLCSResource
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource.Internal, BaseResource, BaseCSResource
Direct Known Subclasses:
CompleteOCLCSResource, EmbeddedXtextResource, OCLinEcoreCSResource, OCLstdlibCSResource

public class EssentialOCLCSResource
extends org.eclipse.xtext.linking.lazy.LazyLinkingResource
implements BaseCSResource


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.linking.lazy.LazyLinkingResource
org.eclipse.xtext.linking.lazy.LazyLinkingResource.DiagnosticMessageContext
 
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
 
Field Summary
 
Fields inherited from class org.eclipse.xtext.linking.lazy.LazyLinkingResource
resolving, UNRESOLVEABLE_PROXIES_KEY
 
Fields inherited from class org.eclipse.xtext.resource.XtextResource
isUpdating, OPTION_ENCODING, OPTION_FORMAT, OPTION_RESOLVE_ALL, OPTION_SERIALIZATION_OPTIONS
 
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
EssentialOCLCSResource()
           
 
Method Summary
protected  void addLibraryError(java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors, IllegalLibraryException e)
           
protected  void addSyntaxErrors()
           
protected  void createAndAddDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,org.eclipse.xtext.nodemodel.INode> triple)
           
 CS2Pivot createCS2Pivot(java.util.Map<? extends org.eclipse.emf.ecore.resource.Resource,? extends ASResource> cs2asResourceMap, MetaModelManager metaModelManager)
          Create the CS2AS converter for the cs2asResourceMap conversions using metaModelManager.
protected  org.eclipse.emf.ecore.resource.Resource.Diagnostic createDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,org.eclipse.xtext.nodemodel.INode> triple, org.eclipse.xtext.diagnostics.DiagnosticMessage message)
           
 MetaModelManager createMetaModelManager()
          Return a MetaModelManager for use with this CS resource, unless one can be located via a CS2AS adapter.
 Pivot2CS createPivot2CS(java.util.Map<? extends org.eclipse.emf.ecore.resource.Resource,? extends ASResource> cs2asResourceMap, MetaModelManager metaModelManager)
          Create the AS2CS converter for the cs2asResourceMap conversions using metaModelManager.
protected  void doLinking()
           
protected  void doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options)
           
 CS2PivotResourceAdapter findCS2ASAdapter()
          Return the CS2AS adapter for this resource, or null if none installed.
 java.lang.String getASContentType()
          Return the eContentType to be used when creating an AS resource.
 ASResource getASResource(MetaModelManager metaModelManager)
          Return the Abstract Syntax representation of thjis Concrete Syntax resource under the supervision of metaModelManager.
 org.eclipse.emf.common.util.URI getASURI(org.eclipse.emf.common.util.URI csURI)
          Return the Abstract Syntax URI for the fiven Concrete Syntax URI.
 CS2PivotResourceAdapter getCS2ASAdapter(MetaModelManager metaModelManager)
          Return the CS2AS adapter for this resource.
 java.lang.String getEditorName()
          Return the name of the editor for use in diagnostics.
 ParserContext getParserContext()
           
protected  boolean hasError(ElementCS csElement)
           
protected  void initializeResourceFactory(org.eclipse.emf.ecore.resource.Resource.Factory.Registry resourceFactoryRegistry)
          Install any required extension/content-type registrations to enable AS Resources to be created satisfactorily.
 void reparse(java.lang.String newContent)
           
 org.eclipse.emf.common.util.URI resolve(org.eclipse.emf.common.util.URI uri)
          Return a uri against the URI of this CS resource.
 void resolveLazyCrossReferences(org.eclipse.xtext.util.CancelIndicator mon)
           
protected  void setHasError(ElementCS csElement)
           
 void setParserContext(ParserContext parserContext)
           
 void updateFrom(ASResource asResource, MetaModelManager metaModelManager)
           
 
Methods inherited from class org.eclipse.xtext.linking.lazy.LazyLinkingResource
createAndAddDiagnostic, createDiagnosticMessage, createDiagnosticMessageContext, doResolveLazyCrossReference, getDiagnosticList, getDiagnosticMessageProvider, getEncoder, getEObject, getEObject, getLinkingHelper, getLinkingService, getReferences, getUnresolvableURIFragments, handleCyclicResolution, isEagerLinking, isPotentialLazyCrossReference, isUnresolveableProxyCacheable, markUnresolvable, removeDiagnostic, resolveLazyCrossReference, setDiagnosticMessageProvider, setEagerLinking, setEncoder, setLinkingHelper, setLinkingService
 
Methods inherited from class org.eclipse.xtext.resource.XtextResource
basicGetEObject, clearErrorsAndWarnings, clearInternalState, createReader, doSave, doUnload, getCache, getConcreteSyntaxValidator, getEncoding, getFragmentProvider, getLanguageName, getLinker, getModificationStamp, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, getURIFragment, isValidationDisabled, reattachModificationTracker, setCache, setEncodingFromOptions, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setModificationStamp, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, updateInternalState, updateInternalState, validateConcreteSyntax
 
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.ecore.resource.Resource
delete, getAllContents, getContents, getEObject, getErrors, getResourceSet, getTimeStamp, getURI, getURIFragment, getWarnings, isLoaded, isModified, isTrackingModification, load, load, save, save, setModified, setTimeStamp, setTrackingModification, setURI, unload
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Constructor Detail

EssentialOCLCSResource

public EssentialOCLCSResource()
Method Detail

addLibraryError

protected void addLibraryError(java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors,
                               IllegalLibraryException e)

addSyntaxErrors

protected void addSyntaxErrors()
Overrides:
addSyntaxErrors in class org.eclipse.xtext.resource.XtextResource

createAndAddDiagnostic

protected void createAndAddDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,org.eclipse.xtext.nodemodel.INode> triple)
Overrides:
createAndAddDiagnostic in class org.eclipse.xtext.linking.lazy.LazyLinkingResource

createCS2Pivot

@NonNull
public CS2Pivot createCS2Pivot(@NonNull
                                       java.util.Map<? extends org.eclipse.emf.ecore.resource.Resource,? extends ASResource> cs2asResourceMap,
                                       @NonNull
                                       MetaModelManager metaModelManager)
Description copied from interface: BaseCSResource
Create the CS2AS converter for the cs2asResourceMap conversions using metaModelManager.

Specified by:
createCS2Pivot in interface BaseCSResource

createDiagnostic

protected org.eclipse.emf.ecore.resource.Resource.Diagnostic createDiagnostic(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EReference,org.eclipse.xtext.nodemodel.INode> triple,
                                                                              org.eclipse.xtext.diagnostics.DiagnosticMessage message)
Overrides:
createDiagnostic in class org.eclipse.xtext.linking.lazy.LazyLinkingResource

createPivot2CS

@NonNull
public Pivot2CS createPivot2CS(@NonNull
                                       java.util.Map<? extends org.eclipse.emf.ecore.resource.Resource,? extends ASResource> cs2asResourceMap,
                                       @NonNull
                                       MetaModelManager metaModelManager)
Description copied from interface: BaseCSResource
Create the AS2CS converter for the cs2asResourceMap conversions using metaModelManager.

Specified by:
createPivot2CS in interface BaseCSResource

createMetaModelManager

@NonNull
public MetaModelManager createMetaModelManager()
Description copied from interface: BaseCSResource
Return a MetaModelManager for use with this CS resource, unless one can be located via a CS2AS adapter.

Specified by:
createMetaModelManager in interface BaseCSResource

doLinking

protected void doLinking()
Overrides:
doLinking in class org.eclipse.xtext.linking.lazy.LazyLinkingResource

doLoad

protected void doLoad(java.io.InputStream inputStream,
                      java.util.Map<?,?> options)
               throws java.io.IOException
Overrides:
doLoad in class org.eclipse.xtext.linking.lazy.LazyLinkingResource
Throws:
java.io.IOException

findCS2ASAdapter

@Nullable
public final CS2PivotResourceAdapter findCS2ASAdapter()
Description copied from interface: BaseCSResource
Return the CS2AS adapter for this resource, or null if none installed.

Specified by:
findCS2ASAdapter in interface BaseCSResource

getASContentType

@NonNull
public java.lang.String getASContentType()
Description copied from interface: BaseCSResource
Return the eContentType to be used when creating an AS resource.

Specified by:
getASContentType in interface BaseCSResource

getCS2ASAdapter

@NonNull
public final CS2PivotResourceAdapter getCS2ASAdapter(@Nullable
                                                             MetaModelManager metaModelManager)
Description copied from interface: BaseCSResource
Return the CS2AS adapter for this resource. If no CS2AS adapter installed, one is created and installed using the provided metaModelManager, which if null is also created.

Specified by:
getCS2ASAdapter in interface BaseCSResource

getEditorName

@NonNull
public java.lang.String getEditorName()
Description copied from interface: BaseCSResource
Return the name of the editor for use in diagnostics.

Specified by:
getEditorName in interface BaseCSResource

getParserContext

@Nullable
public final ParserContext getParserContext()
Specified by:
getParserContext in interface BaseResource

getASResource

@NonNull
public final ASResource getASResource(@Nullable
                                              MetaModelManager metaModelManager)
Description copied from interface: BaseResource
Return the Abstract Syntax representation of thjis Concrete Syntax resource under the supervision of metaModelManager.

Specified by:
getASResource in interface BaseResource

getASURI

@NonNull
public org.eclipse.emf.common.util.URI getASURI(@NonNull
                                                        org.eclipse.emf.common.util.URI csURI)
Description copied from interface: BaseCSResource
Return the Abstract Syntax URI for the fiven Concrete Syntax URI.

Specified by:
getASURI in interface BaseCSResource

hasError

protected boolean hasError(ElementCS csElement)

initializeResourceFactory

protected void initializeResourceFactory(@NonNull
                                         org.eclipse.emf.ecore.resource.Resource.Factory.Registry resourceFactoryRegistry)
Install any required extension/content-type registrations to enable AS Resources to be created satisfactorily.


reparse

public void reparse(java.lang.String newContent)
             throws java.io.IOException
Overrides:
reparse in class org.eclipse.xtext.resource.XtextResource
Throws:
java.io.IOException

resolve

@NonNull
public final org.eclipse.emf.common.util.URI resolve(@NonNull
                                                             org.eclipse.emf.common.util.URI uri)
Description copied from interface: BaseCSResource
Return a uri against the URI of this CS resource.

Specified by:
resolve in interface BaseCSResource

resolveLazyCrossReferences

public void resolveLazyCrossReferences(org.eclipse.xtext.util.CancelIndicator mon)
Overrides:
resolveLazyCrossReferences in class org.eclipse.xtext.linking.lazy.LazyLinkingResource

setHasError

protected void setHasError(ElementCS csElement)

setParserContext

public final void setParserContext(@Nullable
                                   ParserContext parserContext)
Specified by:
setParserContext in interface BaseResource

updateFrom

public void updateFrom(@NonNull
                       ASResource asResource,
                       @NonNull
                       MetaModelManager metaModelManager)
Specified by:
updateFrom in interface BaseResource