Interface ITrace
-
- All Known Subinterfaces:
IPlatformSpecificTrace<PlatformResource,Location>
- All Known Implementing Classes:
AbstractTrace
public interface ITrace
The trace provides a way to work with tracing information of a code generator.- Noextend:
- This interface is not intended to be extended by clients.
- Noimplement:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<? extends ILocationInResource>
getAllAssociatedLocations()
Returns all known associatedlocations
.java.lang.Iterable<? extends ILocationInResource>
getAllAssociatedLocations(AbsoluteURI absoluteTargetResource)
Returns all knownlocations
that were produced from the associated resource in the givenabsoluteTargetResource
.java.lang.Iterable<? extends ILocationInResource>
getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion)
Returns all associatedlocations
that match the givenregion
.java.lang.Iterable<? extends ILocationInResource>
getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion, AbsoluteURI absoluteTargetResource)
Returns all individuallocations
that match the givenlocalRegion
for the expectedabsoluteTargetResource
.ILocationInResource
getBestAssociatedLocation(org.eclipse.xtext.util.ITextRegion localRegion)
Returns the best associatedlocation
that matches the givenregion
.ILocationInResource
getBestAssociatedLocation(org.eclipse.xtext.util.ITextRegion localRegion, AbsoluteURI absoluteTargetResource)
LanguageInfo
getLocalLanguage()
Returns the language that is associated with the local resource.IProjectConfig
getLocalProjectConfig()
Returns the local project.AbsoluteURI
getLocalURI()
Returns the absolute URI of the local resource.SourceRelativeURI
getSrcRelativeLocalURI()
Returns the relative URI of the local resource.boolean
hasTraceData()
Returns true if the trace is not empty and can provide at leat one location.
-
-
-
Method Detail
-
getBestAssociatedLocation
ILocationInResource getBestAssociatedLocation(org.eclipse.xtext.util.ITextRegion localRegion)
Returns the best associatedlocation
that matches the givenregion
. If the region does not match a single location, the following strategy applies:- If the region spans multiple locations where the first and the last location belong to the same resource, the merged location is returned.
- If the region spans multiple locations that belong to different resources, the longest prefix location for a single resource is returned.
-
If the region spans multiple overlapping locations that belong to different resources,
null
is returned.
null
.- Parameters:
localRegion
- the region in the current resource. May not benull
.- Returns:
- the best associated location or
null
if none.
-
getAllAssociatedLocations
java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion)
Returns all associatedlocations
that match the givenregion
.- Parameters:
localRegion
- the region in the current resource. May not benull
.- Returns:
- all associated locations. Never
null
.
-
getAllAssociatedLocations
java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations()
Returns all known associatedlocations
.- Returns:
- all associated locations. Never
null
.
-
getLocalProjectConfig
IProjectConfig getLocalProjectConfig()
Returns the local project. Nevernull
.- Returns:
- the local project. Never
null
.
-
getLocalURI
AbsoluteURI getLocalURI()
Returns the absolute URI of the local resource. Nevernull
.- Returns:
- the absolute URI of the local resource. Never
null
.
-
getSrcRelativeLocalURI
SourceRelativeURI getSrcRelativeLocalURI()
Returns the relative URI of the local resource. Nevernull
. In other words: returns the URI as it would be relative to the class path after the resource was packaged. If the resource resides in a source folder of a java project, it'll return the URI relative to the source folder itself. Otherwise relative to the project root.- Returns:
- the relative URI of the local resource. Never
null
.
-
getLocalLanguage
LanguageInfo getLocalLanguage()
Returns the language that is associated with the local resource. May benull
if the artifact does not have an associated Xtext language, e.g. for html or java files.- Returns:
- the language that is associated with the local resource. May be
null
.
-
getBestAssociatedLocation
ILocationInResource getBestAssociatedLocation(org.eclipse.xtext.util.ITextRegion localRegion, AbsoluteURI absoluteTargetResource)
Returns the bestlocation
that matches the givenlocalRegion
in theabsoluteTargetResource
. If the region does not match a single location in the target, the following strategy applies:-
The merged region of all matching locations in the
targetResource
is returned.
localRegion
does not yield a location inabsoluteTargetResource
, returnsnull
.- Parameters:
localRegion
- the region in the current resource. May not benull
.absoluteTargetResource
- the expected target resource. May not benull
.- Returns:
- the best associated location or
null
if none.
-
The merged region of all matching locations in the
-
getAllAssociatedLocations
java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion, AbsoluteURI absoluteTargetResource)
Returns all individuallocations
that match the givenlocalRegion
for the expectedabsoluteTargetResource
.- Parameters:
localRegion
- the region in the current resource. May not benull
.absoluteTargetResource
- the expected target resource. May not benull
.- Returns:
- all associated locations. Never
null
.
-
getAllAssociatedLocations
java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations(AbsoluteURI absoluteTargetResource)
Returns all knownlocations
that were produced from the associated resource in the givenabsoluteTargetResource
.- Parameters:
absoluteTargetResource
- the expected target resource. May not benull
.- Returns:
- all locations. Never
null
.
-
hasTraceData
boolean hasTraceData()
Returns true if the trace is not empty and can provide at leat one location.
-
-