Package org.eclipse.xtext.resource.impl
Class DefaultResourceDescriptionManager
- java.lang.Object
-
- org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager
-
- All Implemented Interfaces:
IResourceDescription.Manager
- Direct Known Subclasses:
StorageAwareResourceDescriptionManager
public class DefaultResourceDescriptionManager extends java.lang.Object implements IResourceDescription.Manager
Default implementation of theIResourceDescription.Manager. Customize by binding anotherIDefaultResourceDescriptionStrategy.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.resource.IResourceDescription.Manager
IResourceDescription.Manager.AllChangeAware
-
-
Constructor Summary
Constructors Constructor Description DefaultResourceDescriptionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddExportedNames(java.util.Set<QualifiedName> names, IResourceDescription resourceDescriptor)IResourceDescription.DeltacreateDelta(IResourceDescription oldDescription, IResourceDescription newDescription)org.eclipse.xtext.util.IResourceScopeCachegetCache()IContainer.ManagergetContainerManager()DescriptionUtilsgetDescriptionUtils()protected java.util.Collection<QualifiedName>getImportedNames(IResourceDescription candidate)IResourceDescriptiongetResourceDescription(org.eclipse.emf.ecore.resource.Resource resource)protected booleanhasChanges(IResourceDescription.Delta delta, IResourceDescription candidate)Whether the given delta is considered to have changed from the candidate's perspective.protected IResourceDescriptioninternalGetResourceDescription(org.eclipse.emf.ecore.resource.Resource resource, IDefaultResourceDescriptionStrategy strategy)protected booleanisAffected(java.util.Collection<QualifiedName> importedNames, IResourceDescription description)booleanisAffected(java.util.Collection<IResourceDescription.Delta> deltas, IResourceDescription candidate, IResourceDescriptions context)Batch operation to check whether a description is affected by any given delta in the given context.booleanisAffected(IResourceDescription.Delta delta, IResourceDescription candidate)protected booleanisAffectedByExtensions(java.util.Collection<IResourceDescription.Delta> deltas, IResourceDescription candidate, IResourceDescriptions context)Query all registered extensions.voidsetCache(org.eclipse.xtext.util.IResourceScopeCache cache)voidsetContainerManager(IContainer.Manager containerManager)voidsetDescriptionUtils(DescriptionUtils descriptionUtils)voidsetStrategy(IDefaultResourceDescriptionStrategy strategy)
-
-
-
Method Detail
-
getResourceDescription
public IResourceDescription getResourceDescription(org.eclipse.emf.ecore.resource.Resource resource)
- Specified by:
getResourceDescriptionin interfaceIResourceDescription.Manager- Returns:
- a resource description for the given resource. The result represents the current state of the given resource.
-
createDelta
public IResourceDescription.Delta createDelta(IResourceDescription oldDescription, IResourceDescription newDescription)
- Specified by:
createDeltain interfaceIResourceDescription.Manager- Returns:
- a delta for both given descriptions.
-
internalGetResourceDescription
protected IResourceDescription internalGetResourceDescription(org.eclipse.emf.ecore.resource.Resource resource, IDefaultResourceDescriptionStrategy strategy)
-
getContainerManager
public IContainer.Manager getContainerManager()
-
setContainerManager
public void setContainerManager(IContainer.Manager containerManager)
-
setCache
public void setCache(org.eclipse.xtext.util.IResourceScopeCache cache)
-
getCache
public org.eclipse.xtext.util.IResourceScopeCache getCache()
-
isAffected
public boolean isAffected(IResourceDescription.Delta delta, IResourceDescription candidate) throws java.lang.IllegalArgumentException
- Specified by:
isAffectedin interfaceIResourceDescription.Manager- Returns:
- whether the candidate is affected by the change in the delta.
- Throws:
java.lang.IllegalArgumentException- if this manager is not responsible for the given candidate.
-
getImportedNames
protected java.util.Collection<QualifiedName> getImportedNames(IResourceDescription candidate)
-
addExportedNames
protected void addExportedNames(java.util.Set<QualifiedName> names, IResourceDescription resourceDescriptor)
-
isAffected
public boolean isAffected(java.util.Collection<IResourceDescription.Delta> deltas, IResourceDescription candidate, IResourceDescriptions context)
Description copied from interface:IResourceDescription.ManagerBatch operation to check whether a description is affected by any given delta in the given context. Implementations may perform any optimizations to returnfalsewhenever possible, e.g. check the deltas against the visible containers.- Specified by:
isAffectedin interfaceIResourceDescription.Manager- Parameters:
deltas- List of deltas to check. May not benull.candidate- The description to check. May not benull.context- The current context of the batch operation. May not benull.- Returns:
- whether the candidate is affected by any of the given changes.
-
isAffectedByExtensions
@Beta protected boolean isAffectedByExtensions(java.util.Collection<IResourceDescription.Delta> deltas, IResourceDescription candidate, IResourceDescriptions context)
Query all registered extensions.- Since:
- 2.22
-
hasChanges
protected boolean hasChanges(IResourceDescription.Delta delta, IResourceDescription candidate)
Whether the given delta is considered to have changed from the candidate's perspective. By default this will just callDelta#haveEObjectDescriptionsChanged(). But in some cases even "internal" changes (that are not visible in the EObjectDescriptions) could be interesting.- Since:
- 2.7
-
isAffected
protected boolean isAffected(java.util.Collection<QualifiedName> importedNames, IResourceDescription description)
-
getDescriptionUtils
public DescriptionUtils getDescriptionUtils()
-
setDescriptionUtils
public void setDescriptionUtils(DescriptionUtils descriptionUtils)
-
setStrategy
public void setStrategy(IDefaultResourceDescriptionStrategy strategy)
-
-