org.eclipse.xtend.lib.macro.RegisterGlobalsContext Java Examples

The following examples show how to use org.eclipse.xtend.lib.macro.RegisterGlobalsContext. 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: ExtractProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, final RegisterGlobalsContext context) {
  context.registerInterface(this.getInterfaceName(annotatedClass));
}
 
Example #4
Source File: CheckMutableParameterDeclarationProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final List<? extends ParameterDeclaration> annotatedSourceElements, final RegisterGlobalsContext context) {
}
 
Example #5
Source File: AddInterfaceWithDefaultProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, final RegisterGlobalsContext context) {
  context.registerInterface("de.test.Test");
}
 
Example #6
Source File: AnnotationWithNestedEnumProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, final RegisterGlobalsContext context) {
  context.registerInterface(this.getInterfaceName(annotatedClass));
}
 
Example #7
Source File: AnnotationWithNestedAnnotationsProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void doRegisterGlobals(final TypeDeclaration decl, @Extension final RegisterGlobalsContext context) {
  AnnotationWithNestedAnnotationsProcessor.readConfig(decl);
}
 
Example #8
Source File: CheckMutableInterfaceDeclarationProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final List<? extends InterfaceDeclaration> annotatedSourceElements, final RegisterGlobalsContext context) {
}
 
Example #9
Source File: ToAnnoProcessor.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) {
  super.doRegisterGlobals(annotatedClass, context);
  context.registerAnnotationType(this.generatedAnnotationName(annotatedClass));
}
 
Example #10
Source File: CheckMutableEnumerationTypeDeclarationProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final List<? extends EnumerationTypeDeclaration> annotatedSourceElements, final RegisterGlobalsContext context) {
}
 
Example #11
Source File: AddInterfaceProcessor.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, final RegisterGlobalsContext context) {
  context.registerInterface("de.test.Test");
}
 
Example #12
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 #13
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 #14
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);
}