use of org.eclipse.xtend.lib.macro.declaration.FieldDeclaration in project xtext-xtend by eclipse.
the class ExternalizedProcessor method doGenerateCode.
@Override
public void doGenerateCode(final List<? extends ClassDeclaration> annotatedSourceElements, @Extension final CodeGenerationContext context) {
for (final ClassDeclaration clazz : annotatedSourceElements) {
{
final Path filePath = clazz.getCompilationUnit().getFilePath();
Path _targetFolder = context.getTargetFolder(filePath);
String _replace = clazz.getQualifiedName().replace(".", "/");
String _plus = (_replace + ".properties");
final Path file = _targetFolder.append(_plus);
StringConcatenation _builder = new StringConcatenation();
{
Iterable<? extends FieldDeclaration> _declaredFields = clazz.getDeclaredFields();
for (final FieldDeclaration field : _declaredFields) {
String _simpleName = field.getSimpleName();
_builder.append(_simpleName);
_builder.append(" = ");
String _initializerAsString = this.getInitializerAsString(field);
_builder.append(_initializerAsString);
_builder.newLineIfNotEmpty();
}
}
context.setContents(file, _builder);
}
}
}
Aggregations