private static ILocationData createLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, EObject object, ILocationInFileProviderExtension.RegionDescription query, boolean skipEmpty) { ITextRegion textRegion = locationProvider instanceof ILocationInFileProviderExtension ? ((ILocationInFileProviderExtension) locationProvider).getTextRegion(object, query) : locationProvider.getFullTextRegion(object); if (!(textRegion instanceof ITextRegionWithLineInformation)) { if (log.isDebugEnabled()) log.debug("location provider returned text region without line information.", new Exception()); if (textRegion != null) textRegion = new TextRegionWithLineInformation(textRegion.getOffset(), textRegion.getLength(), 0, 0); else return null; } // usually we want to skip empty regions but if the root region is empty, we want to use it to store the path information along // with the empty offset / length pair if (skipEmpty && textRegion == ITextRegion.EMPTY_REGION) { return null; } ILocationData newData = createLocationData(converter, object, (ITextRegionWithLineInformation) textRegion); return newData; }
public TreeAppendable(ImportManager importManager, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject source, String indentation, String lineSeparator) { this( new SharedAppendableState(indentation, lineSeparator, importManager, source.eResource()), converter, locationProvider, jvmModelAssociations, source); }
protected TreeAppendable(SharedAppendableState state, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject source) { this( state, converter, locationProvider, jvmModelAssociations, createAllLocationData( converter, locationProvider, jvmModelAssociations, source, ILocationInFileProviderExtension.RegionDescription.INCLUDING_COMMENTS, false), // don't skip empty root regions false); }
protected TreeAppendable(SharedAppendableState state, final ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, Set<ILocationData> sourceLocations, boolean useForDebugging) { this.state = state; this.traceURIConverter = converter; this.locationProvider = locationProvider; this.jvmModelAssociations = jvmModelAssociations; this.children = Lists.newArrayList(); this.locationData = sourceLocations; this.useForDebugging = useForDebugging; this.lightweightTypeReferenceSerializer = createLightweightTypeReferenceSerializer(); }
protected static ILocationData createLocationData(ITraceURIConverter converter, EObject object, ITextRegionWithLineInformation textRegion) { Resource resource = object.eResource(); SourceRelativeURI uriForTrace = null; if (converter != null) { uriForTrace = converter.getURIForTrace(resource); } ILocationData newData = new LocationData(textRegion, uriForTrace); return newData; }
public ErrorTreeAppendable(SharedAppendableState state, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, Set<ILocationData> sourceLocations, boolean useForDebugging) { super(state, converter, locationProvider, jvmModelAssociations, sourceLocations, useForDebugging); encoder = getOrCreateURIEncoder(); }
protected boolean isAssociatedWith(AbstractTraceRegion region, AbsoluteURI uri, IProjectConfig project) { ITraceURIConverter traceURIConverter = getService(uri, ITraceURIConverter.class); if (traceURIConverter == null) { traceURIConverter = getService(getLocalURI(), ITraceURIConverter.class); } SourceRelativeURI convertedUri = traceURIConverter.getURIForTrace(project, uri); return convertedUri.equals(region.getAssociatedSrcRelativePath()); }
public ITraceURIConverter getTraceURIConverter() { return traceURIConverter; }
protected static ILocationData createLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, EObject object, ILocationInFileProviderExtension.RegionDescription query) { return createLocationData(converter, locationProvider, object, query, true); }
private static Set<ILocationData> createAllLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject object, ILocationInFileProviderExtension.RegionDescription query) { return createAllLocationData(converter, locationProvider, jvmModelAssociations, object, query, true); }
protected SourceRelativeURI getGeneratedUriForTrace(IProjectConfig projectConfig, AbsoluteURI absoluteSourceResource, AbsoluteURI generatedFileURI, ITraceURIConverter traceURIConverter) { return traceURIConverter.getURIForTrace(projectConfig, generatedFileURI); }
/** * @since 2.4 */ public Class<? extends ITraceURIConverter> bindITraceURIConverter() { return DefaultTraceURIConverter.class; }
public Class<? extends ITraceURIConverter> bindITraceURIConverter() { return TraceURIConverter.class; }