org.eclipse.xtext.generator.trace
Interface ITrace

All Known Implementing Classes:
AbstractTrace, StorageAwareTrace

@NonNullByDefault
public interface ITrace

The trace provides a way to work with tracing information of a code generator.

Author:
Sebastian Zarnekow - Initial contribution and API
This interface is not intended to be implemented by clients.
This interface is not intended to be implemented by clients.
This class is not intended to be subclassed by clients.
This interface is not intended to be extended by clients.

Nested Class Summary
static interface ITrace.Internal
           
 
Method Summary
 java.lang.Iterable<ILocationInResource> getAllAssociatedLocations()
          Returns all known associated locations.
 java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(org.eclipse.core.resources.IStorage associatedStorage)
          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 localRegion, org.eclipse.core.resources.IStorage associatedStorage)
          Returns all individual locations that match the given sourceRegion for the expected targetResource.
 ILocationInResource getBestAssociatedLocation(ITextRegion localRegion)
          Returns the best associated location that matches the given region.
 ILocationInResource getBestAssociatedLocation(ITextRegion localRegion, org.eclipse.core.resources.IStorage associatedStorage)
          Returns the best location that matches the given sourceRegion in the targetResource.
 LanguageInfo getLanguage()
          Returns the language that is associated with the source resource.
 org.eclipse.core.resources.IProject getLocalProject()
          Returns the source project.
 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.
 

Method Detail

getBestAssociatedLocation

@Nullable
ILocationInResource getBestAssociatedLocation(ITextRegion localRegion)
Returns the best associated location that matches the given region. If the region does not match a single location, the following strategy applies: If no location data is available, returns null.

Parameters:
localRegion - the region in the current resource. May not be null.
Returns:
the best associated location or null if none.

getAllAssociatedLocations

java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(ITextRegion localRegion)
Returns all associated locations that match the given region.

Parameters:
localRegion - the region in the current resource. May not be null.
Returns:
all associated locations. Never null.

getAllAssociatedLocations

java.lang.Iterable<ILocationInResource> getAllAssociatedLocations()
Returns all known associated locations.

Returns:
all associated locations. Never null.

getLocalStorage

org.eclipse.core.resources.IStorage getLocalStorage()
Returns the storage that is associated with this trace.

Returns:
the associated storage. Never null.

getLocalProject

org.eclipse.core.resources.IProject getLocalProject()
Returns the source project. Never null.

Returns:
the source project. Never null.

getLocalURI

org.eclipse.emf.common.util.URI getLocalURI()
Returns the URI of the source resource. Never null.

Returns:
the URI of the source resource. Never null.

getLanguage

@Nullable
LanguageInfo getLanguage()
Returns the language that is associated with the source resource. Never null.

Returns:
the language that is associated with the source resource. Never null.

getBestAssociatedLocation

@Nullable
ILocationInResource getBestAssociatedLocation(ITextRegion localRegion,
                                                       org.eclipse.core.resources.IStorage associatedStorage)
Returns the best 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: If no location data is available or the sourceRegion does not yield a location in targetResource, returns null.

Parameters:
localRegion - the region in the current resource. May not be null.
associatedStorage - the expected target resource. May not be null.
Returns:
the best associated location or null if none.

getAllAssociatedLocations

java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(ITextRegion localRegion,
                                                                  org.eclipse.core.resources.IStorage associatedStorage)
Returns all individual locations that match the given sourceRegion for the expected targetResource.

Parameters:
localRegion - the region in the current resource. May not be null.
associatedStorage - the expected target resource. May not be null.
Returns:
all associated locations. Never null.

getAllAssociatedLocations

java.lang.Iterable<ILocationInResource> getAllAssociatedLocations(org.eclipse.core.resources.IStorage associatedStorage)
Returns all known locations that were produced from the associated resource in the given targetResource.

Parameters:
associatedStorage - the expected target resource. May not be null.
Returns:
all locations. Never null.