|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.builder.trace.AbstractTrace
@NonNullByDefault public abstract class AbstractTrace
Nested Class Summary | |
---|---|
protected class |
AbstractTrace.TraceRegionsByURI
|
Nested classes/interfaces inherited from interface org.eclipse.xtext.generator.trace.ITrace |
---|
ITrace.Internal |
Constructor Summary | |
---|---|
AbstractTrace()
|
Method Summary | ||
---|---|---|
protected ILocationInResource |
createLocationInResourceFor(ILocationData location,
AbstractTraceRegion traceRegion)
Creates a new location for a target resource that matches the given location . |
|
protected abstract AbstractTraceRegion |
doGetRootTraceRegion()
|
|
boolean |
encloses(AbstractTraceRegion region,
int offset,
boolean includeRegionEnd)
Calculate whether the given region encloses the offset. |
|
boolean |
encloses(int regionOffset,
int regionLength,
int offset,
boolean includeRegionEnd)
Calculate whether the given region encloses the offset. |
|
protected LanguageInfo |
findLanguage(org.eclipse.emf.common.util.URI uri)
|
|
protected AbstractTraceRegion |
findParentByURI(AbstractTraceRegion region,
org.eclipse.emf.common.util.URI uri)
|
|
protected org.eclipse.core.resources.IProject |
findProject(java.lang.String projectName)
|
|
protected org.eclipse.core.resources.IStorage |
findStorage(org.eclipse.emf.common.util.URI uri,
org.eclipse.core.resources.IProject project)
|
|
protected AbstractTraceRegion |
findTraceRegionAt(int offset,
boolean includeRegionEnd)
|
|
AbstractTraceRegion |
findTraceRegionAtLeftOffset(int offset)
|
|
AbstractTraceRegion |
findTraceRegionAtRightOffset(int offset)
|
|
java.lang.Iterable<ILocationInResource> |
getAllAssociatedLocations()
Returns all known associated locations . |
|
java.lang.Iterable<ILocationInResource> |
getAllAssociatedLocations(org.eclipse.core.resources.IStorage storage)
Returns all known locations that were produced from the associated resource
in the given targetResource . |
|
java.lang.Iterable<ILocationInResource> |
getAllAssociatedLocations(ITextRegion localRegion)
Returns all associated locations that match the given region . |
|
java.lang.Iterable<ILocationInResource> |
getAllAssociatedLocations(ITextRegion region,
org.eclipse.core.resources.IStorage storage)
Returns all individual locations that match the given sourceRegion
for the expected targetResource . |
|
protected java.lang.Iterable<AbstractTraceRegion> |
getAllTraceRegions()
|
|
protected java.lang.Iterable<AbstractTraceRegion> |
getAllTraceRegions(ITextRegion localRegion)
|
|
ILocationInResource |
getBestAssociatedLocation(ITextRegion region)
Returns the best associated location that matches the given region . |
|
ILocationInResource |
getBestAssociatedLocation(ITextRegion region,
org.eclipse.core.resources.IStorage storage)
Returns the best location that matches the given
sourceRegion in the targetResource . |
|
LanguageInfo |
getLanguage()
Returns the language that is associated with the source resource. |
|
abstract org.eclipse.core.resources.IProject |
getLocalProject()
Returns the source project. |
|
abstract org.eclipse.core.resources.IStorage |
getLocalStorage()
Returns the storage that is associated with this trace. |
|
org.eclipse.emf.common.util.URI |
getLocalURI()
Returns the URI of the source resource. |
|
protected ILocationInResource |
getMergedLocationInResource(AbstractTraceRegion region)
|
|
protected org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.common.util.URI uri,
org.eclipse.core.resources.IProject project)
|
|
AbstractTraceRegion |
getRootTraceRegion()
Returns the root trace region where AbstractStatefulTraceRegion.getMyOffset() and
AbstractStatefulTraceRegion.getMyLength() return the information for the
resource that this ITrace is associated with. |
|
protected
|
getService(org.eclipse.emf.common.util.URI uri,
java.lang.Class<T> type)
|
|
protected org.eclipse.emf.common.util.URI |
getURIForStorage(org.eclipse.core.resources.IStorage storage)
|
|
protected boolean |
isAssociatedWith(AbstractTraceRegion region,
org.eclipse.emf.common.util.URI uri)
|
|
protected ILocationInResource |
mergeRegions(AbstractTraceRegion left,
AbstractTraceRegion right)
|
|
protected java.lang.Iterable<ILocationInResource> |
toLocations(java.lang.Iterable<AbstractTraceRegion> allTraceRegions)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractTrace()
Method Detail |
---|
@Nullable public final AbstractTraceRegion getRootTraceRegion()
AbstractStatefulTraceRegion.getMyOffset()
and
AbstractStatefulTraceRegion.getMyLength()
return the information for the
resource that this ITrace
is associated with.
getRootTraceRegion
in interface ITrace.Internal
null
if no trace data is available.@Nullable protected abstract AbstractTraceRegion doGetRootTraceRegion()
@Nullable public ILocationInResource getBestAssociatedLocation(ITextRegion region)
ITrace
location
that matches the given region
.
If the region does not match a single location, the following strategy applies:
null
is returned.
null
.
getBestAssociatedLocation
in interface ITrace
region
- the region in the current resource. May not be null
.
null
if none.@Nullable protected ILocationInResource mergeRegions(@Nullable AbstractTraceRegion left, @Nullable AbstractTraceRegion right)
@Nullable protected ILocationInResource getMergedLocationInResource(AbstractTraceRegion region)
@Nullable protected ILocationInResource createLocationInResourceFor(ILocationData location, AbstractTraceRegion traceRegion)
location
.
location
- the location
null
detecting a path or a projectName fails.@Nullable public AbstractTraceRegion findTraceRegionAtRightOffset(int offset)
@Nullable protected AbstractTraceRegion findTraceRegionAt(int offset, boolean includeRegionEnd)
@Nullable public AbstractTraceRegion findTraceRegionAtLeftOffset(int offset)
public boolean encloses(AbstractTraceRegion region, int offset, boolean includeRegionEnd)
region
encloses the offset.
region
- the region to be checked. May not be null
.offset
- the offset that should be enclosed by the region.includeRegionEnd
- whether a region is enclosing the offset if it ends at that location.
true if the given region encloses the offset.
public boolean encloses(int regionOffset, int regionLength, int offset, boolean includeRegionEnd)
region
encloses the offset.
regionOffset
- the start of the region that should be checked.regionLength
- the length of the region that should be checked.offset
- the offset that should be enclosed by the region.includeRegionEnd
- whether a region is enclosing the offset if it ends at that location.
true if the given region encloses the offset.- This method is not intended to be referenced by clients.
- This method is not intended to be referenced by clients.
- This method is not intended to be extended (re-implement with a call to the overridden parent) or re-implemented (with no call to the overridden parent) by clients.
- This method is not intended to be re-implemented or extended by clients.
public java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(ITextRegion localRegion)
ITrace
locations
that match the given region
.
getAllAssociatedLocations
in interface ITrace
localRegion
- the region in the current resource. May not be null
.
null
.@Nullable public ILocationInResource getBestAssociatedLocation(ITextRegion region, org.eclipse.core.resources.IStorage storage)
ITrace
location
that matches the given
sourceRegion
in the targetResource
.
If the region does not match a single location in the target, the following strategy applies:
targetResource
is returned.
sourceRegion
does not yield
a location in targetResource
, returns null
.
getBestAssociatedLocation
in interface ITrace
region
- the region in the current resource. May not be null
.storage
- the expected target resource. May not be null
.
null
if none.protected boolean isAssociatedWith(AbstractTraceRegion region, org.eclipse.emf.common.util.URI uri)
@Nullable protected AbstractTraceRegion findParentByURI(@Nullable AbstractTraceRegion region, org.eclipse.emf.common.util.URI uri)
public java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(ITextRegion region, org.eclipse.core.resources.IStorage storage)
ITrace
locations
that match the given sourceRegion
for the expected targetResource
.
getAllAssociatedLocations
in interface ITrace
region
- the region in the current resource. May not be null
.storage
- the expected target resource. May not be null
.
null
.public java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(org.eclipse.core.resources.IStorage storage)
ITrace
locations
that were produced from the associated resource
in the given targetResource
.
getAllAssociatedLocations
in interface ITrace
storage
- the expected target resource. May not be null
.
null
.@Nullable public LanguageInfo getLanguage()
ITrace
null
.
getLanguage
in interface ITrace
null
.public org.eclipse.emf.common.util.URI getLocalURI()
ITrace
null
.
getLocalURI
in interface ITrace
null
.protected org.eclipse.emf.common.util.URI getURIForStorage(org.eclipse.core.resources.IStorage storage)
public abstract org.eclipse.core.resources.IProject getLocalProject()
ITrace
null
.
getLocalProject
in interface ITrace
null
.public abstract org.eclipse.core.resources.IStorage getLocalStorage()
ITrace
getLocalStorage
in interface ITrace
null
.protected java.lang.Iterable<ILocationInResource> toLocations(java.lang.Iterable<AbstractTraceRegion> allTraceRegions)
protected java.lang.Iterable<AbstractTraceRegion> getAllTraceRegions(ITextRegion localRegion)
public java.lang.Iterable<ILocationInResource> getAllAssociatedLocations()
ITrace
locations
.
getAllAssociatedLocations
in interface ITrace
null
.protected java.lang.Iterable<AbstractTraceRegion> getAllTraceRegions()
@Nullable protected org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.util.URI uri, org.eclipse.core.resources.IProject project)
protected org.eclipse.core.resources.IStorage findStorage(org.eclipse.emf.common.util.URI uri, org.eclipse.core.resources.IProject project)
protected org.eclipse.core.resources.IProject findProject(java.lang.String projectName)
@Nullable protected LanguageInfo findLanguage(@Nullable org.eclipse.emf.common.util.URI uri)
@Nullable protected <T> T getService(@Nullable org.eclipse.emf.common.util.URI uri, java.lang.Class<T> type)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |