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 Detail

      • getBestAssociatedLocation

        ILocationInResource getBestAssociatedLocation​(org.eclipse.xtext.util.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 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.
        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<? extends ILocationInResource> getAllAssociatedLocations​(org.eclipse.xtext.util.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<? extends ILocationInResource> getAllAssociatedLocations()
        Returns all known associated locations.
        Returns:
        all associated locations. Never null.
      • getLocalProjectConfig

        IProjectConfig getLocalProjectConfig()
        Returns the local project. Never null.
        Returns:
        the local project. Never null.
      • getLocalURI

        AbsoluteURI getLocalURI()
        Returns the absolute URI of the local resource. Never null.
        Returns:
        the absolute URI of the local resource. Never null.
      • getSrcRelativeLocalURI

        SourceRelativeURI getSrcRelativeLocalURI()
        Returns the relative URI of the local resource. Never null. 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 be null 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 best location that matches the given localRegion in the absoluteTargetResource. 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.
        If no location data is available or the localRegion does not yield a location in absoluteTargetResource, returns null.
        Parameters:
        localRegion - the region in the current resource. May not be null.
        absoluteTargetResource - the expected target resource. May not be null.
        Returns:
        the best associated location or null if none.
      • getAllAssociatedLocations

        java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations​(org.eclipse.xtext.util.ITextRegion localRegion,
                                                                                    AbsoluteURI absoluteTargetResource)
        Returns all individual locations that match the given localRegion for the expected absoluteTargetResource.
        Parameters:
        localRegion - the region in the current resource. May not be null.
        absoluteTargetResource - the expected target resource. May not be null.
        Returns:
        all associated locations. Never null.
      • getAllAssociatedLocations

        java.lang.Iterable<? extends ILocationInResource> getAllAssociatedLocations​(AbsoluteURI absoluteTargetResource)
        Returns all known locations that were produced from the associated resource in the given absoluteTargetResource.
        Parameters:
        absoluteTargetResource - the expected target resource. May not be null.
        Returns:
        all locations. Never null.
      • hasTraceData

        boolean hasTraceData()
        Returns true if the trace is not empty and can provide at leat one location.