Examples of AnnotationReference


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

    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;
    }
    @Extension
View Full Code Here

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

      }
      return _and;
    }
   
    public AccessorType getGetterType(final FieldDeclaration it) {
      AnnotationReference _elvis = null;
      AnnotationReference _accessorsAnnotation = this.getAccessorsAnnotation(it);
      if (_accessorsAnnotation != null) {
        _elvis = _accessorsAnnotation;
      } else {
        TypeDeclaration _declaringType = it.getDeclaringType();
        AnnotationReference _accessorsAnnotation_1 = this.getAccessorsAnnotation(_declaringType);
        _elvis = _accessorsAnnotation_1;
      }
      final AnnotationReference annotation = _elvis;
      boolean _tripleNotEquals = (annotation != null);
      if (_tripleNotEquals) {
        EnumerationValueDeclaration[] _enumArrayValue = annotation.getEnumArrayValue("value");
        final Function1<EnumerationValueDeclaration, AccessorType> _function = new Function1<EnumerationValueDeclaration, AccessorType>() {
          public AccessorType apply(final EnumerationValueDeclaration it) {
            String _simpleName = it.getSimpleName();
            return AccessorType.valueOf(_simpleName);
          }
View Full Code Here

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

      String _getterName = this.getGetterName(field);
      final Procedure1<MutableMethodDeclaration> _function = new Procedure1<MutableMethodDeclaration>() {
        public void apply(final MutableMethodDeclaration it) {
          Element _primarySourceElement = Util.this.context.getPrimarySourceElement(field);
          Util.this.context.setPrimarySourceElement(it, _primarySourceElement);
          AnnotationReference _newAnnotationReference = Util.this.context.newAnnotationReference(Pure.class);
          it.addAnnotation(_newAnnotationReference);
          TypeReference _type = field.getType();
          TypeReference _orObject = Util.this.orObject(_type);
          it.setReturnType(_orObject);
          StringConcatenationClient _client = new StringConcatenationClient() {
View Full Code Here

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

      };
      _declaringType.addMethod(_getterName, _function);
    }
   
    public AccessorType getSetterType(final FieldDeclaration it) {
      AnnotationReference _elvis = null;
      AnnotationReference _accessorsAnnotation = this.getAccessorsAnnotation(it);
      if (_accessorsAnnotation != null) {
        _elvis = _accessorsAnnotation;
      } else {
        TypeDeclaration _declaringType = it.getDeclaringType();
        AnnotationReference _accessorsAnnotation_1 = this.getAccessorsAnnotation(_declaringType);
        _elvis = _accessorsAnnotation_1;
      }
      final AnnotationReference annotation = _elvis;
      boolean _tripleNotEquals = (annotation != null);
      if (_tripleNotEquals) {
        EnumerationValueDeclaration[] _enumArrayValue = annotation.getEnumArrayValue("value");
        final Function1<EnumerationValueDeclaration, AccessorType> _function = new Function1<EnumerationValueDeclaration, AccessorType>() {
          public AccessorType apply(final EnumerationValueDeclaration it) {
            String _simpleName = it.getSimpleName();
            return AccessorType.valueOf(_simpleName);
          }
View Full Code Here

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

    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) {
      requiredArgsUtil.addFinalFieldsConstructor(it);
View Full Code Here

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

    }
  }
 
  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.");
    } else {
View Full Code Here

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

   
    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;
        } else {
View Full Code Here

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

        public void apply(final MutableMethodDeclaration it) {
          Element _primarySourceElement = Util.this.context.getPrimarySourceElement(cls);
          Util.this.context.setPrimarySourceElement(it, _primarySourceElement);
          TypeReference _string = Util.this.context.getString();
          it.setReturnType(_string);
          AnnotationReference _newAnnotationReference = Util.this.context.newAnnotationReference(Override.class);
          it.addAnnotation(_newAnnotationReference);
          AnnotationReference _newAnnotationReference_1 = Util.this.context.newAnnotationReference(Pure.class);
          it.addAnnotation(_newAnnotationReference_1);
          StringConcatenationClient _client = new StringConcatenationClient() {
            @Override
            protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
              _builder.append("String result = new ");
View Full Code Here

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

        public void apply(final MutableMethodDeclaration it) {
          Element _primarySourceElement = Util.this.context.getPrimarySourceElement(cls);
          Util.this.context.setPrimarySourceElement(it, _primarySourceElement);
          TypeReference _string = Util.this.context.getString();
          it.setReturnType(_string);
          AnnotationReference _newAnnotationReference = Util.this.context.newAnnotationReference(Override.class);
          it.addAnnotation(_newAnnotationReference);
          AnnotationReference _newAnnotationReference_1 = Util.this.context.newAnnotationReference(Pure.class);
          it.addAnnotation(_newAnnotationReference_1);
          StringConcatenationClient _client = new StringConcatenationClient() {
            @Override
            protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
              _builder.append(ToStringBuilder.class, "");
View Full Code Here

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.