mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
[tracing] rename (#287)
This commit is contained in:
parent
3e96aa3939
commit
ac2b856e6e
5 changed files with 16 additions and 16 deletions
|
@ -29,7 +29,7 @@ import org.eclipse.xtext.generator.trace.ITraceRegionProvider
|
|||
@InjectWith(LazyLinkingTestLanguageInjectorProvider)
|
||||
class TracingSugarTest {
|
||||
|
||||
@TracingExtensionsForEMF(LazyLinkingFactory)
|
||||
@TracingExtensions(LazyLinkingFactory)
|
||||
static class MyExtensions {
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.eclipse.xtext.generator.trace.ITraceRegionProvider;
|
|||
import org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode;
|
||||
import org.eclipse.xtext.generator.trace.node.IGeneratorNode;
|
||||
import org.eclipse.xtext.generator.trace.node.Traced;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingExtensionsForEMF;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingExtensions;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingSugar;
|
||||
import org.eclipse.xtext.linking.lazy.lazyLinking.LazyLinkingFactory;
|
||||
import org.eclipse.xtext.linking.lazy.lazyLinking.Model;
|
||||
|
@ -46,7 +46,7 @@ import org.junit.runner.RunWith;
|
|||
@InjectWith(LazyLinkingTestLanguageInjectorProvider.class)
|
||||
@SuppressWarnings("all")
|
||||
public class TracingSugarTest {
|
||||
@TracingExtensionsForEMF(LazyLinkingFactory.class)
|
||||
@TracingExtensions(LazyLinkingFactory.class)
|
||||
public static class MyExtensions extends TracingSugar {
|
||||
/**
|
||||
* manual implementation for unsupported multi cross reference
|
||||
|
|
|
@ -22,17 +22,17 @@ import org.eclipse.xtext.generator.trace.ILocationData
|
|||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Active(TracingExtensionsForEMFProcessor)
|
||||
annotation TracingExtensionsForEMF {
|
||||
@Active(TracingExtensionsProcessor)
|
||||
annotation TracingExtensions {
|
||||
Class<? extends EFactory>[] value
|
||||
}
|
||||
|
||||
class TracingExtensionsForEMFProcessor extends AbstractClassProcessor {
|
||||
class TracingExtensionsProcessor extends AbstractClassProcessor {
|
||||
|
||||
override doTransform(MutableClassDeclaration annotatedClass, extension TransformationContext context) {
|
||||
val eobjectType = EObject.newTypeReference()
|
||||
annotatedClass.extendedClass = TracingSugar.newTypeReference()
|
||||
val annotationType = findTypeGlobally(TracingExtensionsForEMF)
|
||||
val annotationType = findTypeGlobally(TracingExtensions)
|
||||
val factories = annotatedClass.findAnnotation(annotationType)?.getClassArrayValue("value")
|
||||
if (factories === null) {
|
||||
return;
|
|
@ -9,12 +9,12 @@ package org.eclipse.xtext.generator.trace.node;
|
|||
|
||||
import org.eclipse.emf.ecore.EFactory;
|
||||
import org.eclipse.xtend.lib.macro.Active;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingExtensionsForEMFProcessor;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingExtensionsProcessor;
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
@Active(TracingExtensionsForEMFProcessor.class)
|
||||
public @interface TracingExtensionsForEMF {
|
||||
@Active(TracingExtensionsProcessor.class)
|
||||
public @interface TracingExtensions {
|
||||
public Class<? extends EFactory>[] value();
|
||||
}
|
|
@ -28,7 +28,7 @@ import org.eclipse.xtend2.lib.StringConcatenationClient;
|
|||
import org.eclipse.xtext.generator.trace.ILocationData;
|
||||
import org.eclipse.xtext.generator.trace.node.CompositeGeneratorNode;
|
||||
import org.eclipse.xtext.generator.trace.node.IGeneratorNode;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingExtensionsForEMF;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingExtensions;
|
||||
import org.eclipse.xtext.generator.trace.node.TracingSugar;
|
||||
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
|
||||
import org.eclipse.xtext.xbase.lib.Conversions;
|
||||
|
@ -40,12 +40,12 @@ import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
|
|||
import org.eclipse.xtext.xbase.lib.StringExtensions;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class TracingExtensionsForEMFProcessor extends AbstractClassProcessor {
|
||||
public class TracingExtensionsProcessor extends AbstractClassProcessor {
|
||||
@Override
|
||||
public void doTransform(final MutableClassDeclaration annotatedClass, @Extension final TransformationContext context) {
|
||||
final TypeReference eobjectType = context.newTypeReference(EObject.class);
|
||||
annotatedClass.setExtendedClass(context.newTypeReference(TracingSugar.class));
|
||||
final Type annotationType = context.findTypeGlobally(TracingExtensionsForEMF.class);
|
||||
final Type annotationType = context.findTypeGlobally(TracingExtensions.class);
|
||||
AnnotationReference _findAnnotation = annotatedClass.findAnnotation(annotationType);
|
||||
TypeReference[] _classArrayValue = null;
|
||||
if (_findAnnotation!=null) {
|
||||
|
@ -75,7 +75,7 @@ public class TracingExtensionsForEMFProcessor extends AbstractClassProcessor {
|
|||
for (final ResolvedMethod getter : _filter_1) {
|
||||
{
|
||||
final TypeReference rt = getter.getResolvedReturnType();
|
||||
boolean _contains = TracingExtensionsForEMFProcessor.allowedLowerCaseTypeNames.contains(rt.getType().getSimpleName().toLowerCase());
|
||||
boolean _contains = TracingExtensionsProcessor.allowedLowerCaseTypeNames.contains(rt.getType().getSimpleName().toLowerCase());
|
||||
if (_contains) {
|
||||
final Procedure1<MutableMethodDeclaration> _function_4 = (MutableMethodDeclaration it) -> {
|
||||
it.setReturnType(context.newTypeReference(IGeneratorNode.class));
|
||||
|
@ -85,7 +85,7 @@ public class TracingExtensionsForEMFProcessor extends AbstractClassProcessor {
|
|||
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
|
||||
_builder.append(EStructuralFeature.class);
|
||||
_builder.append(" feature = target.eClass().getEStructuralFeature(\"");
|
||||
String _featureName = TracingExtensionsForEMFProcessor.this.featureName(getter);
|
||||
String _featureName = TracingExtensionsProcessor.this.featureName(getter);
|
||||
_builder.append(_featureName);
|
||||
_builder.append("\");");
|
||||
_builder.newLineIfNotEmpty();
|
||||
|
@ -120,7 +120,7 @@ public class TracingExtensionsForEMFProcessor extends AbstractClassProcessor {
|
|||
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
|
||||
_builder.append(EStructuralFeature.class);
|
||||
_builder.append(" feature = target.eClass().getEStructuralFeature(\"");
|
||||
String _featureName = TracingExtensionsForEMFProcessor.this.featureName(getter);
|
||||
String _featureName = TracingExtensionsProcessor.this.featureName(getter);
|
||||
_builder.append(_featureName);
|
||||
_builder.append("\");");
|
||||
_builder.newLineIfNotEmpty();
|
Loading…
Reference in a new issue