org.eclipse.emf.ecore.xcore.resource
Class XcoreResource

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.xtext.resource.DerivedStateAwareResource
                          extended by org.eclipse.xtext.xbase.resource.XbaseResource
                              extended by org.eclipse.emf.ecore.xcore.resource.XcoreResource
All Implemented Interfaces:
Notifier, Resource, Resource.Internal

public class XcoreResource
extends org.eclipse.xtext.xbase.resource.XbaseResource


Nested Class Summary
protected  class XcoreResource.FragmentCache
           
 
Nested classes/interfaces inherited from class org.eclipse.xtext.xbase.resource.XbaseResource
org.eclipse.xtext.xbase.resource.XbaseResource.AssumptionState, org.eclipse.xtext.xbase.resource.XbaseResource.AssumptionTracker, org.eclipse.xtext.xbase.resource.XbaseResource.RootAssumptionTracker
 
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
ResourceImpl.ContentsEList<E extends java.lang.Object & EObject>, ResourceImpl.ModificationTrackingAdapter
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList<E extends java.lang.Object & Adapter>, BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource
Resource.Diagnostic, Resource.Factory, Resource.Internal, Resource.IOWrappedException
 
Field Summary
protected  XcoreResource.FragmentCache fragmentCache
           
 
Fields inherited from class org.eclipse.xtext.resource.DerivedStateAwareResource
fullyInitialized, isInitializing
 
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_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
XcoreResource()
           
 
Method Summary
protected  EObject findEObject(EClass eClass, org.eclipse.xtext.naming.QualifiedName name, java.lang.String uriFragment)
          Finds the EObject of the given type and the given QualifiedName.
 EObject getEObject(java.lang.String uriFragment)
          Returns the resolved object for the given URI fragment.
protected  EObject getEObjectForURIFragmentRootSegment(java.lang.String uriFragmentRootSegment)
          Returns the object associated with the URI fragment root segment.
 java.lang.String getURIFragment(EObject object)
          Returns the URI fragment that, when passed to getEObject will return the given object.
protected  java.lang.String getURIFragmentRootSegment(EObject eObject)
          Returns the URI fragment root segment for reaching the given direct content object.
 
Methods inherited from class org.eclipse.xtext.xbase.resource.XbaseResource
assumeLinked, getConstructor, getFeature, getImplicitFirstArgument, getImplicitReceiver, handleCyclicResolution, isUnresolveableProxyCacheable, trackAssumptions, trackResolution
 
Methods inherited from class org.eclipse.xtext.resource.DerivedStateAwareResource
discardDerivedState, getContents, installDerivedState, setDerivedStateComputer, updateInternalState, updateInternalState
 
Methods inherited from class org.eclipse.xtext.linking.lazy.LazyLinkingResource
createAndAddDiagnostic, createAndAddDiagnostic, createDiagnostic, createDiagnosticMessage, createDiagnosticMessageContext, doLinking, doLoad, getDiagnosticList, getDiagnosticMessageProvider, getEncoder, getLinkingHelper, getLinkingService, getReferences, isEagerLinking, removeDiagnostic, resolveLazyCrossReference, resolveLazyCrossReferences, setDiagnosticMessageProvider, setEagerLinking, setEncoder, setLinkingHelper, setLinkingService
 
Methods inherited from class org.eclipse.xtext.resource.XtextResource
addSyntaxErrors, clearErrorsAndWarnings, clearInternalState, doSave, doUnload, getCache, getConcreteSyntaxValidator, getEncoding, getFragmentProvider, getLanguageName, getLinker, getParser, getParseResult, getResourceServiceProvider, getSerializer, getUnloader, isValidationDisabled, reattachModificationTracker, reparse, setCache, setEncodingFromOptions, setFragmentProvider, setInjectedParser, setLanguageName, setLinker, setParser, setParseResult, setResourceServiceProvider, setSerializer, setUnloader, setValidationDisabled, unload, update, validateConcreteSyntax
 
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, getAllContents, getAllProperContents, getAllProperContents, getDefaultURIConverter, getEObject, getEObjectByID, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getURI, getURIConverter, 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
 

Field Detail

fragmentCache

protected XcoreResource.FragmentCache fragmentCache
Constructor Detail

XcoreResource

public XcoreResource()
Method Detail

getEObject

public EObject getEObject(java.lang.String uriFragment)
Description copied from interface: Resource
Returns the resolved object for the given URI fragment.

The fragment encoding will typically be that produced by getURIFragment.

Specified by:
getEObject in interface Resource
Overrides:
getEObject in class org.eclipse.xtext.xbase.resource.XbaseResource
Parameters:
uriFragment - the fragment to resolve.
Returns:
the resolved object for the given fragment, or null if it can't be resolved.
See Also:
Resource.getURIFragment(EObject), ResourceSet.getEObject(URI, boolean), EcoreUtil.resolve(EObject, ResourceSet), InternalEObject.eObjectForURIFragmentSegment(String)

findEObject

protected EObject findEObject(EClass eClass,
                              org.eclipse.xtext.naming.QualifiedName name,
                              java.lang.String uriFragment)
Finds the EObject of the given type and the given QualifiedName.


getURIFragment

public java.lang.String getURIFragment(EObject object)
Description copied from interface: Resource
Returns the URI fragment that, when passed to getEObject will return the given object.

In other words, the following is true for any object contained by a resource:

   Resource resource = eObject.eResource();
   eObject == resource.getEObject(resource.getURIFragment(eObject))
An implementation may choose to use IDs or to use structured URI fragments, as supported by eURIFragmentSegment.

Specified by:
getURIFragment in interface Resource
Overrides:
getURIFragment in class org.eclipse.xtext.resource.XtextResource
Parameters:
object - the object to identify.
Returns:
the URI fragment for the object.
See Also:
Resource.getEObject(String), InternalEObject.eURIFragmentSegment(org.eclipse.emf.ecore.EStructuralFeature, EObject)

getURIFragmentRootSegment

protected java.lang.String getURIFragmentRootSegment(EObject eObject)
Description copied from class: ResourceImpl
Returns the URI fragment root segment for reaching the given direct content object. This default implementation returns the position of the object, if there is more than one object, otherwise, the empty string. As a result, the URI fragment for a single root object will be "/".

Overrides:
getURIFragmentRootSegment in class org.eclipse.xtext.resource.DerivedStateAwareResource
Returns:
the URI fragment root segment for reaching the given direct content object.

getEObjectForURIFragmentRootSegment

protected EObject getEObjectForURIFragmentRootSegment(java.lang.String uriFragmentRootSegment)
Description copied from class: ResourceImpl
Returns the object associated with the URI fragment root segment. This default implementation uses the position of the object; an empty string is the same as "0".

Overrides:
getEObjectForURIFragmentRootSegment in class org.eclipse.xtext.resource.DerivedStateAwareResource
Returns:
the object associated with the URI fragment root segment.

Copyright 2001-2012 IBM Corporation and others.
All Rights Reserved.