Interface ITrace
-
- All Known Subinterfaces:
IPlatformSpecificTrace<PlatformResource,Location>
- All Known Implementing Classes:
AbstractTrace
public interface ITraceThe 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 knownlocationsthat were produced from the associated resource in the givenabsoluteTargetResource.java.lang.Iterable<? extends ILocationInResource>getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion)Returns all associatedlocationsthat match the givenregion.java.lang.Iterable<? extends ILocationInResource>getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion, AbsoluteURI absoluteTargetResource)Returns all individuallocationsthat match the givenlocalRegionfor the expectedabsoluteTargetResource.ILocationInResourcegetBestAssociatedLocation(org.eclipse.xtext.util.ITextRegion localRegion)Returns the best associatedlocationthat matches the givenregion.ILocationInResourcegetBestAssociatedLocation(org.eclipse.xtext.util.ITextRegion localRegion, AbsoluteURI absoluteTargetResource)LanguageInfogetLocalLanguage()Returns the language that is associated with the local resource.IProjectConfiggetLocalProjectConfig()Returns the local project.AbsoluteURIgetLocalURI()Returns the absolute URI of the local resource.SourceRelativeURIgetSrcRelativeLocalURI()Returns the relative URI of the local resource.booleanhasTraceData()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 associatedlocationthat 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,
nullis returned.
null.- Parameters:
localRegion- the region in the current resource. May not benull.- Returns:
- the best associated location or
nullif none.
-
getAllAssociatedLocations
java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations(org.eclipse.xtext.util.ITextRegion localRegion)
Returns all associatedlocationsthat 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 benullif 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 bestlocationthat matches the givenlocalRegionin 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
targetResourceis returned.
localRegiondoes 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
nullif 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 individuallocationsthat match the givenlocalRegionfor 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 knownlocationsthat 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.
-
-