use of org.eclipse.xtend2.lib.StringConcatenationClient in project xtext-xtend by eclipse.
the class ArtificialMethodsProcessor method doTransform.
@Override
public void doTransform(final MutableClassDeclaration annotatedClass, @Extension final TransformationContext context) {
final Procedure1<MutableMethodDeclaration> _function = (MutableMethodDeclaration it) -> {
final CompilationStrategy _function_1 = (CompilationStrategy.CompilationContext it_1) -> {
StringConcatenation _builder = new StringConcatenation();
return _builder;
};
it.setBody(_function_1);
};
annotatedClass.addMethod("blank", _function);
final Procedure1<MutableMethodDeclaration> _function_1 = (MutableMethodDeclaration it) -> {
final CompilationStrategy _function_2 = (CompilationStrategy.CompilationContext it_1) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("\t\t\t\t");
_builder.newLine();
return _builder;
};
it.setBody(_function_2);
};
annotatedClass.addMethod("blank_1", _function_1);
final Procedure1<MutableMethodDeclaration> _function_2 = (MutableMethodDeclaration it) -> {
final CompilationStrategy _function_3 = (CompilationStrategy.CompilationContext it_1) -> {
return "";
};
it.setBody(_function_3);
};
annotatedClass.addMethod("blank_2", _function_2);
final Procedure1<MutableMethodDeclaration> _function_3 = (MutableMethodDeclaration it) -> {
final CompilationStrategy _function_4 = (CompilationStrategy.CompilationContext it_1) -> {
return "\n";
};
it.setBody(_function_4);
};
annotatedClass.addMethod("blank_3", _function_3);
final Procedure1<MutableMethodDeclaration> _function_4 = (MutableMethodDeclaration it) -> {
final CompilationStrategy _function_5 = (CompilationStrategy.CompilationContext it_1) -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("int foo = 42;");
_builder.newLine();
return _builder;
};
it.setBody(_function_5);
};
annotatedClass.addMethod("blank_4", _function_4);
final Procedure1<MutableMethodDeclaration> _function_5 = (MutableMethodDeclaration it) -> {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("int foo = 42;");
_builder.newLine();
}
};
it.setBody(_client);
};
annotatedClass.addMethod("blank_5", _function_5);
final Procedure1<MutableMethodDeclaration> _function_6 = (MutableMethodDeclaration it) -> {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("int foo = 42;");
}
};
it.setBody(_client);
};
annotatedClass.addMethod("blank_6", _function_6);
final Procedure1<MutableMethodDeclaration> _function_7 = (MutableMethodDeclaration it) -> {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append(List.class);
_builder.append("<? extends Object> list = new ");
_builder.append(ArrayList.class);
_builder.append("<");
_builder.append(BigDecimal.class);
_builder.append(">();");
}
};
it.setBody(_client);
};
annotatedClass.addMethod("blank_7", _function_7);
}
use of org.eclipse.xtend2.lib.StringConcatenationClient in project xtext-xtend by eclipse.
the class ToAnnoProcessor method doTransform.
@Override
public void doTransform(final MutableClassDeclaration annotatedClass, @Extension final TransformationContext context) {
super.doTransform(annotatedClass, context);
Type _findTypeGlobally = context.findTypeGlobally(this.generatedAnnotationName(annotatedClass));
final MutableAnnotationTypeDeclaration annotationType = ((MutableAnnotationTypeDeclaration) _findTypeGlobally);
final Procedure1<MutableAnnotationTypeElementDeclaration> _function = (MutableAnnotationTypeElementDeclaration it) -> {
it.setDocComment("Best building strategy game ever");
it.setType(context.newTypeReference(Integer.TYPE));
boolean _booleanValue = annotatedClass.findAnnotation(context.findTypeGlobally(ToAnno.class)).getBooleanValue("defaultValue");
if (_booleanValue) {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("1602");
}
};
it.setDefaultValueExpression(_client);
}
};
annotationType.addAnnotationTypeElement("anno", _function);
}
use of org.eclipse.xtend2.lib.StringConcatenationClient in project xtext-xtend by eclipse.
the class MutableJvmFieldDeclarationImpl method setConstantValueAsString.
@Override
public void setConstantValueAsString(final String value) {
this.internalGenericSetConstantValue(value);
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("\"");
String _convertToJavaString = Strings.convertToJavaString(value);
_builder.append(_convertToJavaString);
_builder.append("\"");
}
};
this.getCompilationUnit().setCompilationTemplate(this.getDelegate(), _client);
}
use of org.eclipse.xtend2.lib.StringConcatenationClient in project xtext-xtend by eclipse.
the class MutableJvmFieldDeclarationImpl method setConstantValueAsChar.
@Override
public void setConstantValueAsChar(final char value) {
this.internalGenericSetConstantValue(Character.valueOf(value));
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("\'");
String _convertToJavaString = Strings.convertToJavaString(Character.toString(value));
_builder.append(_convertToJavaString);
_builder.append("\'");
}
};
this.getCompilationUnit().setCompilationTemplate(this.getDelegate(), _client);
}
use of org.eclipse.xtend2.lib.StringConcatenationClient in project xtext-xtend by eclipse.
the class MutableJvmFieldDeclarationImpl method setConstantValueAsFloat.
@Override
public void setConstantValueAsFloat(final float value) {
this.internalGenericSetConstantValue(Float.valueOf(value));
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append(value);
_builder.append("f");
}
};
this.getCompilationUnit().setCompilationTemplate(this.getDelegate(), _client);
}
Aggregations