Java Code Examples for org.eclipse.xtend.lib.macro.RegisterGlobalsContext#registerClass()

The following examples show how to use org.eclipse.xtend.lib.macro.RegisterGlobalsContext#registerClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AccessObjectProcessor.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void doRegisterGlobals(final List<? extends ClassDeclaration> annotatedSourceElements, @Extension final RegisterGlobalsContext ctx) {
  final Consumer<ClassDeclaration> _function = (ClassDeclaration it) -> {
    String _qualifiedName = it.getQualifiedName();
    int _length = it.getQualifiedName().length();
    int _length_1 = it.getSimpleName().length();
    int _minus = (_length - _length_1);
    final String pkg = _qualifiedName.substring(0, _minus);
    String _simpleName = it.getSimpleName();
    final String PVersionName = ((pkg + "P") + _simpleName);
    String _simpleName_1 = it.getSimpleName();
    final String GVersionName = ((pkg + "G") + _simpleName_1);
    ctx.registerClass(PVersionName);
    ctx.registerClass(GVersionName);
  };
  annotatedSourceElements.forEach(_function);
}
 
Example 2
Source File: AddNestedTypesProcessor.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void doRegisterGlobals(final List<? extends TypeDeclaration> annotatedSourceElements, final RegisterGlobalsContext context) {
  for (final TypeDeclaration type : annotatedSourceElements) {
    {
      String _qualifiedName = type.getQualifiedName();
      String _plus = (_qualifiedName + ".NestedClass");
      context.registerClass(_plus);
      String _qualifiedName_1 = type.getQualifiedName();
      String _plus_1 = (_qualifiedName_1 + ".NestedInterface");
      context.registerInterface(_plus_1);
      String _qualifiedName_2 = type.getQualifiedName();
      String _plus_2 = (_qualifiedName_2 + ".NestedAnnotationType");
      context.registerAnnotationType(_plus_2);
      String _qualifiedName_3 = type.getQualifiedName();
      String _plus_3 = (_qualifiedName_3 + ".NestedEnumerationType");
      context.registerEnumerationType(_plus_3);
    }
  }
}
 
Example 3
Source File: _TESTDATA_InternalClassProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, @Extension final RegisterGlobalsContext context) {
  String _qualifiedName = annotatedClass.getQualifiedName();
  String _plus = (_qualifiedName + ".InternalClass");
  context.registerClass(_plus);
}
 
Example 4
Source File: EmfAdaptableProcessor.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, @Extension final RegisterGlobalsContext context) {
  context.registerClass(this.getAdapterClassName(annotatedClass));
}
 
Example 5
Source File: TypeAdapterImplProcessor.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, @Extension final RegisterGlobalsContext context) {
  String _qualifiedName = annotatedClass.getQualifiedName();
  String _plus = (_qualifiedName + ".Factory");
  context.registerClass(_plus);
}