Package org.eclipse.xtend.lib.macro.declaration

Examples of org.eclipse.xtend.lib.macro.declaration.Type


        return newType;
      }
      List<TypeReference> _actualTypeArguments = target.getActualTypeArguments();
      boolean _contains = _actualTypeArguments.contains(oldType);
      if (_contains) {
        Type _type = target.getType();
        List<TypeReference> _actualTypeArguments_1 = target.getActualTypeArguments();
        final Function1<TypeReference, TypeReference> _function = new Function1<TypeReference, TypeReference>() {
          public TypeReference apply(final TypeReference it) {
            return Util.this.replace(it, oldType, newType);
          }
View Full Code Here


          _builder_2.append("\", new Class[]{");
          Iterable<? extends ParameterDeclaration> _parameters_1 = method.getParameters();
          final Function1<ParameterDeclaration, String> _function_1 = new Function1<ParameterDeclaration, String>() {
            public String apply(final ParameterDeclaration it) {
              TypeReference _type = it.getType();
              Type _type_1 = _type.getType();
              String _simpleName = _type_1.getSimpleName();
              return (_simpleName + ".class");
            }
          };
          String _join = IterableExtensions.join(_parameters_1, ", ", _function_1);
          _builder_2.append(_join, "");
View Full Code Here

    };
    IterableExtensions.forEach(elements, _function);
  }
 
  protected void _transform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
    Type _findTypeGlobally = context.findTypeGlobally(Data.class);
    AnnotationReference _findAnnotation = it.findAnnotation(_findTypeGlobally);
    boolean _tripleNotEquals = (_findAnnotation != null);
    if (_tripleNotEquals) {
      return;
    }
    Type _findTypeGlobally_1 = context.findTypeGlobally(Accessors.class);
    AnnotationReference _findAnnotation_1 = it.findAnnotation(_findTypeGlobally_1);
    boolean _tripleNotEquals_1 = (_findAnnotation_1 != null);
    if (_tripleNotEquals_1) {
      return;
    }
View Full Code Here

      }
      return null;
    }
   
    public AnnotationReference getAccessorsAnnotation(final AnnotationTarget it) {
      Type _findTypeGlobally = this.context.findTypeGlobally(Accessors.class);
      return it.findAnnotation(_findTypeGlobally);
    }
View Full Code Here

    boolean _or = false;
    boolean _needsFinalFieldConstructor = requiredArgsUtil.needsFinalFieldConstructor(it);
    if (_needsFinalFieldConstructor) {
      _or = true;
    } else {
      Type _findTypeGlobally = context.findTypeGlobally(FinalFieldsConstructor.class);
      AnnotationReference _findAnnotation = it.findAnnotation(_findTypeGlobally);
      boolean _tripleNotEquals = (_findAnnotation != null);
      _or = _tripleNotEquals;
    }
    if (_or) {
View Full Code Here

      cls.addMethod("toString", _function);
    }
  }
 
  public void doTransform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
    Type _findTypeGlobally = context.findTypeGlobally(Data.class);
    AnnotationReference _findAnnotation = it.findAnnotation(_findTypeGlobally);
    boolean _tripleNotEquals = (_findAnnotation != null);
    if (_tripleNotEquals) {
      return;
    }
    @Extension
    final ToStringProcessor.Util util = new ToStringProcessor.Util(context);
    Type _findTypeGlobally_1 = context.findTypeGlobally(ToString.class);
    final AnnotationReference annotation = it.findAnnotation(_findTypeGlobally_1);
    final ToStringConfiguration configuration = new ToStringConfiguration(annotation);
    boolean _hasToString = util.hasToString(it);
    if (_hasToString) {
      context.addWarning(annotation, "toString is already defined, this annotation has no effect.");
View Full Code Here

    }
   
    public ToStringConfiguration getToStringConfig(final ClassDeclaration it) {
      ToStringConfiguration _xblockexpression = null;
      {
        Type _findTypeGlobally = this.context.findTypeGlobally(ToString.class);
        final AnnotationReference anno = it.findAnnotation(_findTypeGlobally);
        ToStringConfiguration _xifexpression = null;
        boolean _tripleEquals = (anno == null);
        if (_tripleEquals) {
          _xifexpression = null;
View Full Code Here

   
    public void addFinalFieldsConstructor(final MutableClassDeclaration it) {
      ArrayList<TypeReference> _finalFieldsConstructorArgumentTypes = this.getFinalFieldsConstructorArgumentTypes(it);
      boolean _isEmpty = _finalFieldsConstructorArgumentTypes.isEmpty();
      if (_isEmpty) {
        Type _findTypeGlobally = this.context.findTypeGlobally(FinalFieldsConstructor.class);
        final AnnotationReference anno = it.findAnnotation(_findTypeGlobally);
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("There are no final fields, this annotation has no effect");
        this.context.addWarning(anno, _builder.toString());
        return;
View Full Code Here

    public void makeFinalFieldsConstructor(final MutableConstructorDeclaration it) {
      MutableTypeDeclaration _declaringType = it.getDeclaringType();
      ArrayList<TypeReference> _finalFieldsConstructorArgumentTypes = this.getFinalFieldsConstructorArgumentTypes(_declaringType);
      boolean _isEmpty = _finalFieldsConstructorArgumentTypes.isEmpty();
      if (_isEmpty) {
        Type _findTypeGlobally = this.context.findTypeGlobally(FinalFieldsConstructor.class);
        final AnnotationReference anno = it.findAnnotation(_findTypeGlobally);
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("There are no final fields, this annotation has no effect");
        this.context.addWarning(anno, _builder.toString());
        return;
View Full Code Here

      util.addSetter(it, _visibility_1);
    }
  }
 
  protected void _transform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
    Type _findTypeGlobally = context.findTypeGlobally(Data.class);
    AnnotationReference _findAnnotation = it.findAnnotation(_findTypeGlobally);
    boolean _tripleNotEquals = (_findAnnotation != null);
    if (_tripleNotEquals) {
      return;
    }
    @Extension
    final FinalFieldsConstructorProcessor.Util requiredArgsUtil = new FinalFieldsConstructorProcessor.Util(context);
    boolean _or = false;
    boolean _needsFinalFieldConstructor = requiredArgsUtil.needsFinalFieldConstructor(it);
    if (_needsFinalFieldConstructor) {
      _or = true;
    } else {
      Type _findTypeGlobally_1 = context.findTypeGlobally(FinalFieldsConstructor.class);
      AnnotationReference _findAnnotation_1 = it.findAnnotation(_findTypeGlobally_1);
      boolean _tripleNotEquals_1 = (_findAnnotation_1 != null);
      _or = _tripleNotEquals_1;
    }
    if (_or) {
View Full Code Here

TOP

Related Classes of org.eclipse.xtend.lib.macro.declaration.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.