コード例 #1
0
ファイル: ASTElementType.java プロジェクト: b-cuts/transfuse
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof ASTType)) {
      return false;
    }

    ASTType that = (ASTType) o;

    return new EqualsBuilder().append(getName(), that.getName()).isEquals();
  }
コード例 #2
0
ファイル: Generators.java プロジェクト: cnbin/parceler
 public ReadWriteGenerator getGenerator(ASTType type) {
   for (Map.Entry<Matcher<ASTType>, ReadWriteGenerator> generatorEntry : generators.entrySet()) {
     if (generatorEntry.getKey().matches(type)) {
       return generatorEntry.getValue();
     }
   }
   throw new ParcelerRuntimeException(
       "Unable to find appropriate Parcel method to write " + type.getName());
 }
コード例 #3
0
  @Override
  public void analyzeType(InjectionNode injectionNode, ASTType astType, AnalysisContext context) {

    for (ASTAnnotation annotation : astType.getAnnotations()) {
      validateAnnotation(annotation, astType, astType.getAnnotations());
    }

    for (ASTConstructor astConstructor : astType.getConstructors()) {
      for (ASTAnnotation annotation : astConstructor.getAnnotations()) {
        validateAnnotation(
            annotation, astConstructor, astConstructor.getAnnotations(), astType.getAnnotations());

        for (ASTParameter astParameter : astConstructor.getParameters()) {
          validateParameter(astParameter, astConstructor, astType);
        }
      }
    }
  }
コード例 #4
0
 private void validateParameter(
     ASTParameter parameter, ASTBase containingAST, ASTType containingType) {
   for (ASTAnnotation paramAnnotation : parameter.getAnnotations()) {
     validateAnnotation(
         paramAnnotation,
         parameter,
         parameter.getAnnotations(),
         containingAST.getAnnotations(),
         containingType.getAnnotations());
   }
 }
コード例 #5
0
 @Override
 public void analyzeField(
     InjectionNode injectionNode,
     ASTType concreteType,
     ASTField astField,
     AnalysisContext context) {
   for (ASTAnnotation annotation : astField.getAnnotations()) {
     validateAnnotation(
         annotation, astField, astField.getAnnotations(), concreteType.getAnnotations());
   }
 }
コード例 #6
0
  @Override
  public void analyzeMethod(
      InjectionNode injectionNode,
      ASTType concreteType,
      ASTMethod astMethod,
      AnalysisContext context) {
    for (ASTAnnotation annotation : astMethod.getAnnotations()) {
      validateAnnotation(
          annotation, astMethod, astMethod.getAnnotations(), concreteType.getAnnotations());

      for (ASTParameter astParameter : astMethod.getParameters()) {
        validateParameter(astParameter, astMethod, concreteType);
      }
    }
  }