org.eclipse.xtext.resource.generic
Class GenericResourceDescriptionManager

java.lang.Object
  extended by org.eclipse.xtext.resource.generic.GenericResourceDescriptionManager
All Implemented Interfaces:
IResourceDescription.Manager

public class GenericResourceDescriptionManager
extends java.lang.Object
implements IResourceDescription.Manager

An IResourceDescription.Manager for non-Xtext resources.

Author:
Jan Koehnlein - Initial contribution and API

Constructor Summary
GenericResourceDescriptionManager()
           
 
Method Summary
 IResourceDescription.Delta createDelta(IResourceDescription oldDescription, IResourceDescription newDescription)
           
 IResourceDescription getResourceDescription(org.eclipse.emf.ecore.resource.Resource resource)
           
 boolean isAffected(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.
 boolean isAffected(IResourceDescription.Delta delta, IResourceDescription candidate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericResourceDescriptionManager

public GenericResourceDescriptionManager()
Method Detail

getResourceDescription

public IResourceDescription getResourceDescription(org.eclipse.emf.ecore.resource.Resource resource)
Specified by:
getResourceDescription in interface IResourceDescription.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:
createDelta in interface IResourceDescription.Manager
Returns:
a delta for both given descriptions.

isAffected

public boolean isAffected(IResourceDescription.Delta delta,
                          IResourceDescription candidate)
                   throws java.lang.IllegalArgumentException
Specified by:
isAffected in interface IResourceDescription.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.

isAffected

public boolean isAffected(java.util.Collection<IResourceDescription.Delta> deltas,
                          IResourceDescription candidate,
                          IResourceDescriptions context)
                   throws java.lang.IllegalArgumentException
Description copied from interface: IResourceDescription.Manager
Batch operation to check whether a description is affected by any given delta in the given context. Implementations may perform any optimizations to return false whenever possible, e.g. check the deltas against the visible containers.

Specified by:
isAffected in interface IResourceDescription.Manager
Parameters:
deltas - List of deltas to check. May not be null.
candidate - The description to check. May not be null.
context - The current context of the batch operation. May not be null.
Returns:
whether the condidate is affected by any of the given changes.
Throws:
java.lang.IllegalArgumentException - if this manager is not responsible for the given candidate.