org.eclipse.xtext.parsetree.reconstr.impl
Class DefaultTransientValueService

java.lang.Object
  extended by org.eclipse.xtext.parsetree.reconstr.impl.AbstractTransientValueService
      extended by org.eclipse.xtext.parsetree.reconstr.impl.DefaultTransientValueService
All Implemented Interfaces:
ITransientValueService
Direct Known Subclasses:
XtextTransientValueService

public class DefaultTransientValueService
extends AbstractTransientValueService

Author:
Moritz Eysholdt - Initial contribution and API, Jan Koehnlein - support for cross-resource containment

Constructor Summary
DefaultTransientValueService()
           
 
Method Summary
protected  boolean isContainerReferenceInSameResource(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature)
           
 boolean isTransient(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int index)
          Decides whether a value should be serialized.
 
Methods inherited from class org.eclipse.xtext.parsetree.reconstr.impl.AbstractTransientValueService
isCheckElementsIndividually
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTransientValueService

public DefaultTransientValueService()
Method Detail

isTransient

public boolean isTransient(org.eclipse.emf.ecore.EObject owner,
                           org.eclipse.emf.ecore.EStructuralFeature feature,
                           int index)
Description copied from interface: ITransientValueService
Decides whether a value should be serialized. If !feature.isMany() or !isMixedList(feature), this method is only called once for each feature. In this case, index is < 0. If feature.isMany() and isMixedList(feature), this method is called for each of the feature's values. Attention: Values marked transient are only not serialized when they are optional in the grammar. Example: Rule1: transientF=INT normalF=INT; In this case, the grammar requires to serialize transientF to produce a valid DSL-script. Attention: Think of how many times the serializer calls this method and supply a fast implementation. The serializer tries to avoid multiple calls to this method using the same parameters, but depending on the grammar and the model, it may happen.

Parameters:
owner - The EObject holding the feature's value
Returns:
true, if the feature's value(s) should NOT be serialized

isContainerReferenceInSameResource

protected boolean isContainerReferenceInSameResource(org.eclipse.emf.ecore.EObject owner,
                                                     org.eclipse.emf.ecore.EStructuralFeature feature)