Package org.eclipse.xtext.resource
Class DefaultLocationInFileProvider
- java.lang.Object
-
- org.eclipse.xtext.resource.DefaultLocationInFileProvider
-
- All Implemented Interfaces:
ILocationInFileProvider,ILocationInFileProviderExtension
- Direct Known Subclasses:
XtextLocationInFileProvider
public class DefaultLocationInFileProvider extends java.lang.Object implements ILocationInFileProvider, ILocationInFileProviderExtension
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.resource.ILocationInFileProviderExtension
ILocationInFileProviderExtension.RegionDescription
-
-
Constructor Summary
Constructors Constructor Description DefaultLocationInFileProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.xtext.util.ITextRegioncreateRegion(java.util.List<INode> nodes)protected org.eclipse.xtext.util.ITextRegioncreateRegion(java.util.List<INode> nodes, ILocationInFileProviderExtension.RegionDescription query)protected org.eclipse.xtext.util.ITextRegiondoGetLocationOfFeature(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, boolean isSignificant)protected org.eclipse.xtext.util.ITextRegiondoGetLocationOfFeature(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)protected org.eclipse.xtext.util.ITextRegiondoGetTextRegion(org.eclipse.emf.ecore.EObject obj, ILocationInFileProviderExtension.RegionDescription query)protected ICompositeNodefindNodeFor(org.eclipse.emf.ecore.EObject semanticObject)Returns the smallest node that covers all assigned values of the given object.org.eclipse.xtext.util.ITextRegiongetFullTextRegion(org.eclipse.emf.ecore.EObject obj)org.eclipse.xtext.util.ITextRegiongetFullTextRegion(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)protected org.eclipse.emf.ecore.EStructuralFeaturegetIdentifierFeature(org.eclipse.emf.ecore.EObject obj)protected java.util.List<INode>getLocationNodes(org.eclipse.emf.ecore.EObject obj)protected org.eclipse.xtext.util.ITextRegiongetLocationOfAttribute(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EAttribute attribute, int indexInList, boolean isSignificant)protected org.eclipse.xtext.util.ITextRegiongetLocationOfContainmentReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference feature, int indexInList, boolean isSignificant)protected org.eclipse.xtext.util.ITextRegiongetLocationOfContainmentReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)protected org.eclipse.xtext.util.ITextRegiongetLocationOfCrossReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference, int indexInList, boolean isSignificant)org.eclipse.xtext.util.ITextRegiongetSignificantTextRegion(org.eclipse.emf.ecore.EObject obj)org.eclipse.xtext.util.ITextRegiongetSignificantTextRegion(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)protected org.eclipse.xtext.util.ITextRegiongetTextRegion(org.eclipse.emf.ecore.EObject obj, boolean isSignificant)org.eclipse.xtext.util.ITextRegiongetTextRegion(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)Queries for parts of the text region that parts of the given object originate from.org.eclipse.xtext.util.ITextRegiongetTextRegion(org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription query)Queries for parts of the text region that the given object is originates from.protected booleanisHidden(INode node)protected booleanisHidden(INode node, ILocationInFileProviderExtension.RegionDescription query)protected org.eclipse.xtext.util.TextRegionWithLineInformationtoZeroBasedRegion(org.eclipse.xtext.util.ITextRegionWithLineInformation region)protected booleanuseKeyword(Keyword keyword, org.eclipse.emf.ecore.EObject context)
-
-
-
Method Detail
-
getSignificantTextRegion
public org.eclipse.xtext.util.ITextRegion getSignificantTextRegion(org.eclipse.emf.ecore.EObject obj)
- Specified by:
getSignificantTextRegionin interfaceILocationInFileProvider- See Also:
ILocationInFileProviderExtension.RegionDescription.SIGNIFICANT
-
getFullTextRegion
public org.eclipse.xtext.util.ITextRegion getFullTextRegion(org.eclipse.emf.ecore.EObject obj)
- Specified by:
getFullTextRegionin interfaceILocationInFileProvider- See Also:
ILocationInFileProviderExtension.RegionDescription.FULL
-
getTextRegion
protected org.eclipse.xtext.util.ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject obj, boolean isSignificant)
-
getTextRegion
public org.eclipse.xtext.util.ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription query)Description copied from interface:ILocationInFileProviderExtensionQueries for parts of the text region that the given object is originates from.- Specified by:
getTextRegionin interfaceILocationInFileProviderExtension- Parameters:
object- the instance whose region should be returned.query- the hint about the requested range.- Returns:
- the text region or
nullif the object does not have an associated text region. - Since:
- 2.3
-
doGetTextRegion
protected org.eclipse.xtext.util.ITextRegion doGetTextRegion(org.eclipse.emf.ecore.EObject obj, ILocationInFileProviderExtension.RegionDescription query)- Since:
- 2.3
-
getSignificantTextRegion
public org.eclipse.xtext.util.ITextRegion getSignificantTextRegion(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)- Specified by:
getSignificantTextRegionin interfaceILocationInFileProvider- See Also:
ILocationInFileProviderExtension.RegionDescription.SIGNIFICANT
-
getFullTextRegion
public org.eclipse.xtext.util.ITextRegion getFullTextRegion(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)- Specified by:
getFullTextRegionin interfaceILocationInFileProvider- See Also:
ILocationInFileProviderExtension.RegionDescription.FULL
-
getTextRegion
public org.eclipse.xtext.util.ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)Description copied from interface:ILocationInFileProviderExtensionQueries for parts of the text region that parts of the given object originate from.- Specified by:
getTextRegionin interfaceILocationInFileProviderExtension- Parameters:
object- the instance whose region should be returned.feature- the feature that was set when the requested range was consumed by the parser.indexInList- the index in the list of feature values.-1if all values should be considered.query- the hint about the requested range.- Returns:
- the text region or
nullif the object does not have an associated text region. - Since:
- 2.3
-
getLocationOfContainmentReference
protected org.eclipse.xtext.util.ITextRegion getLocationOfContainmentReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference feature, int indexInList, boolean isSignificant)
-
getLocationOfContainmentReference
protected org.eclipse.xtext.util.ITextRegion getLocationOfContainmentReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)- Since:
- 2.3
-
getLocationOfCrossReference
protected org.eclipse.xtext.util.ITextRegion getLocationOfCrossReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference, int indexInList, boolean isSignificant)
-
getLocationOfAttribute
protected org.eclipse.xtext.util.ITextRegion getLocationOfAttribute(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EAttribute attribute, int indexInList, boolean isSignificant)
-
doGetLocationOfFeature
protected org.eclipse.xtext.util.ITextRegion doGetLocationOfFeature(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, boolean isSignificant)
-
doGetLocationOfFeature
protected org.eclipse.xtext.util.ITextRegion doGetLocationOfFeature(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)- Since:
- 2.3
-
getLocationNodes
protected java.util.List<INode> getLocationNodes(org.eclipse.emf.ecore.EObject obj)
-
useKeyword
protected boolean useKeyword(Keyword keyword, org.eclipse.emf.ecore.EObject context)
-
getIdentifierFeature
protected org.eclipse.emf.ecore.EStructuralFeature getIdentifierFeature(org.eclipse.emf.ecore.EObject obj)
-
createRegion
protected org.eclipse.xtext.util.ITextRegion createRegion(java.util.List<INode> nodes)
-
createRegion
protected org.eclipse.xtext.util.ITextRegion createRegion(java.util.List<INode> nodes, ILocationInFileProviderExtension.RegionDescription query)
- Since:
- 2.3
-
toZeroBasedRegion
protected org.eclipse.xtext.util.TextRegionWithLineInformation toZeroBasedRegion(org.eclipse.xtext.util.ITextRegionWithLineInformation region)
- Since:
- 2.5
-
isHidden
protected boolean isHidden(INode node, ILocationInFileProviderExtension.RegionDescription query)
- Since:
- 2.3
-
isHidden
protected boolean isHidden(INode node)
-
findNodeFor
protected ICompositeNode findNodeFor(org.eclipse.emf.ecore.EObject semanticObject)
Returns the smallest node that covers all assigned values of the given object. It handles the semantics ofactionsandunassigned rule calls.- Returns:
- the minimal node that covers all assigned values of the given object.
- Since:
- 2.3
-
-