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.ITextRegion
createRegion(java.util.List<INode> nodes)
protected org.eclipse.xtext.util.ITextRegion
createRegion(java.util.List<INode> nodes, ILocationInFileProviderExtension.RegionDescription query)
protected org.eclipse.xtext.util.ITextRegion
doGetLocationOfFeature(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, boolean isSignificant)
protected org.eclipse.xtext.util.ITextRegion
doGetLocationOfFeature(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)
protected org.eclipse.xtext.util.ITextRegion
doGetTextRegion(org.eclipse.emf.ecore.EObject obj, ILocationInFileProviderExtension.RegionDescription query)
protected ICompositeNode
findNodeFor(org.eclipse.emf.ecore.EObject semanticObject)
Returns the smallest node that covers all assigned values of the given object.org.eclipse.xtext.util.ITextRegion
getFullTextRegion(org.eclipse.emf.ecore.EObject obj)
org.eclipse.xtext.util.ITextRegion
getFullTextRegion(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)
protected org.eclipse.emf.ecore.EStructuralFeature
getIdentifierFeature(org.eclipse.emf.ecore.EObject obj)
protected java.util.List<INode>
getLocationNodes(org.eclipse.emf.ecore.EObject obj)
protected org.eclipse.xtext.util.ITextRegion
getLocationOfAttribute(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EAttribute attribute, int indexInList, boolean isSignificant)
protected org.eclipse.xtext.util.ITextRegion
getLocationOfContainmentReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference feature, int indexInList, boolean isSignificant)
protected org.eclipse.xtext.util.ITextRegion
getLocationOfContainmentReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)
protected org.eclipse.xtext.util.ITextRegion
getLocationOfCrossReference(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EReference reference, int indexInList, boolean isSignificant)
org.eclipse.xtext.util.ITextRegion
getSignificantTextRegion(org.eclipse.emf.ecore.EObject obj)
org.eclipse.xtext.util.ITextRegion
getSignificantTextRegion(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList)
protected org.eclipse.xtext.util.ITextRegion
getTextRegion(org.eclipse.emf.ecore.EObject obj, boolean isSignificant)
org.eclipse.xtext.util.ITextRegion
getTextRegion(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.ITextRegion
getTextRegion(org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription query)
Queries for parts of the text region that the given object is originates from.protected boolean
isHidden(INode node)
protected boolean
isHidden(INode node, ILocationInFileProviderExtension.RegionDescription query)
protected org.eclipse.xtext.util.TextRegionWithLineInformation
toZeroBasedRegion(org.eclipse.xtext.util.ITextRegionWithLineInformation region)
protected boolean
useKeyword(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:
getSignificantTextRegion
in interfaceILocationInFileProvider
- See Also:
ILocationInFileProviderExtension.RegionDescription.SIGNIFICANT
-
getFullTextRegion
public org.eclipse.xtext.util.ITextRegion getFullTextRegion(org.eclipse.emf.ecore.EObject obj)
- Specified by:
getFullTextRegion
in 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:ILocationInFileProviderExtension
Queries for parts of the text region that the given object is originates from.- Specified by:
getTextRegion
in interfaceILocationInFileProviderExtension
- Parameters:
object
- the instance whose region should be returned.query
- the hint about the requested range.- Returns:
- the text region or
null
if 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:
getSignificantTextRegion
in 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:
getFullTextRegion
in 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:ILocationInFileProviderExtension
Queries for parts of the text region that parts of the given object originate from.- Specified by:
getTextRegion
in 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.-1
if all values should be considered.query
- the hint about the requested range.- Returns:
- the text region or
null
if 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 ofactions
andunassigned rule calls
.- Returns:
- the minimal node that covers all assigned values of the given object.
- Since:
- 2.3
-
-