当前位置: 首页>>代码示例>>Java>>正文


Java SuperficialValidation.validateElements方法代码示例

本文整理汇总了Java中com.google.auto.common.SuperficialValidation.validateElements方法的典型用法代码示例。如果您正苦于以下问题:Java SuperficialValidation.validateElements方法的具体用法?Java SuperficialValidation.validateElements怎么用?Java SuperficialValidation.validateElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.auto.common.SuperficialValidation的用法示例。


在下文中一共展示了SuperficialValidation.validateElements方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import com.google.auto.common.SuperficialValidation; //导入方法依赖的package包/类
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  Set<? extends Element> builderTypes =
      roundEnv.getElementsAnnotatedWith(RetroFacebook.Builder.class);
  if (!SuperficialValidation.validateElements(builderTypes)) {
    return false;
  }
  for (Element annotatedType : builderTypes) {
    // Double-check that the annotation is there. Sometimes the compiler gets confused in case of
    // erroneous source code. SuperficialValidation should protect us against this but it doesn't
    // cost anything to check again.
    if (isAnnotationPresent(annotatedType, RetroFacebook.Builder.class)) {
      validate(
          annotatedType,
          "@RetroFacebook.Builder can only be applied to a class or interface inside an"
              + " @RetroFacebook class");
    }
  }

  Set<? extends Element> validateMethods =
      roundEnv.getElementsAnnotatedWith(RetroFacebook.Validate.class);
  if (!SuperficialValidation.validateElements(validateMethods)) {
    return false;
  }
  for (Element annotatedMethod : validateMethods) {
    if (isAnnotationPresent(annotatedMethod, RetroFacebook.Validate.class)) {
      validate(
          annotatedMethod,
          "@RetroFacebook.Validate can only be applied to a method inside an @RetroFacebook class");
    }
  }
  return false;
}
 
开发者ID:yongjhih,项目名称:RetroFacebook,代码行数:34,代码来源:RetroFacebookBuilderProcessor.java

示例2: process

import com.google.auto.common.SuperficialValidation; //导入方法依赖的package包/类
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  Set<? extends Element> builderTypes =
      roundEnv.getElementsAnnotatedWith(AutoCursor.Builder.class);
  if (!SuperficialValidation.validateElements(builderTypes)) {
    return false;
  }
  for (Element annotatedType : builderTypes) {
    // Double-check that the annotation is there. Sometimes the compiler gets confused in case of
    // erroneous source code. SuperficialValidation should protect us against this but it doesn't
    // cost anything to check again.
    if (isAnnotationPresent(annotatedType, AutoCursor.Builder.class)) {
      validate(
          annotatedType,
          "@AutoCursor.Builder can only be applied to a class or interface inside an"
              + " @AutoCursor class");
    }
  }

  Set<? extends Element> validateMethods =
      roundEnv.getElementsAnnotatedWith(AutoCursor.Validate.class);
  if (!SuperficialValidation.validateElements(validateMethods)) {
    return false;
  }
  for (Element annotatedMethod : validateMethods) {
    if (isAnnotationPresent(annotatedMethod, AutoCursor.Validate.class)) {
      validate(
          annotatedMethod,
          "@AutoCursor.Validate can only be applied to a method inside an @AutoCursor class");
    }
  }
  return false;
}
 
开发者ID:yongjhih,项目名称:AutoCursor,代码行数:34,代码来源:AutoCursorBuilderProcessor.java

示例3: process

import com.google.auto.common.SuperficialValidation; //导入方法依赖的package包/类
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  Set<? extends Element> builderTypes =
      roundEnv.getElementsAnnotatedWith(Retrofit.Builder.class);
  if (!SuperficialValidation.validateElements(builderTypes)) {
    return false;
  }
  for (Element annotatedType : builderTypes) {
    // Double-check that the annotation is there. Sometimes the compiler gets confused in case of
    // erroneous source code. SuperficialValidation should protect us against this but it doesn't
    // cost anything to check again.
    if (isAnnotationPresent(annotatedType, Retrofit.Builder.class)) {
      validate(
          annotatedType,
          "@Retrofit.Builder can only be applied to a class or interface inside an"
              + " @Retrofit class");
    }
  }

  Set<? extends Element> validateMethods =
      roundEnv.getElementsAnnotatedWith(Retrofit.Validate.class);
  if (!SuperficialValidation.validateElements(validateMethods)) {
    return false;
  }
  for (Element annotatedMethod : validateMethods) {
    if (isAnnotationPresent(annotatedMethod, Retrofit.Validate.class)) {
      validate(
          annotatedMethod,
          "@Retrofit.Validate can only be applied to a method inside an @Retrofit class");
    }
  }
  return false;
}
 
开发者ID:yongjhih,项目名称:retrofit2.bak,代码行数:34,代码来源:RetrofitBuilderProcessor.java

示例4: process

import com.google.auto.common.SuperficialValidation; //导入方法依赖的package包/类
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  Set<? extends Element> builderTypes =
      roundEnv.getElementsAnnotatedWith(RetroWeibo.Builder.class);
  if (!SuperficialValidation.validateElements(builderTypes)) {
    return false;
  }
  for (Element annotatedType : builderTypes) {
    // Double-check that the annotation is there. Sometimes the compiler gets confused in case of
    // erroneous source code. SuperficialValidation should protect us against this but it doesn't
    // cost anything to check again.
    if (isAnnotationPresent(annotatedType, RetroWeibo.Builder.class)) {
      validate(
          annotatedType,
          "@RetroWeibo.Builder can only be applied to a class or interface inside an"
              + " @RetroWeibo class");
    }
  }

  Set<? extends Element> validateMethods =
      roundEnv.getElementsAnnotatedWith(RetroWeibo.Validate.class);
  if (!SuperficialValidation.validateElements(validateMethods)) {
    return false;
  }
  for (Element annotatedMethod : validateMethods) {
    if (isAnnotationPresent(annotatedMethod, RetroWeibo.Validate.class)) {
      validate(
          annotatedMethod,
          "@RetroWeibo.Validate can only be applied to a method inside an @RetroWeibo class");
    }
  }
  return false;
}
 
开发者ID:8tory,项目名称:SimpleWeibo,代码行数:34,代码来源:RetroWeiboBuilderProcessor.java

示例5: process

import com.google.auto.common.SuperficialValidation; //导入方法依赖的package包/类
@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  Set<? extends Element> builderTypes =
      roundEnv.getElementsAnnotatedWith(AutoJson.Builder.class);
  if (!SuperficialValidation.validateElements(builderTypes)) {
    return false;
  }
  for (Element annotatedType : builderTypes) {
    // Double-check that the annotation is there. Sometimes the compiler gets confused in case of
    // erroneous source code. SuperficialValidation should protect us against this but it doesn't
    // cost anything to check again.
    if (isAnnotationPresent(annotatedType, AutoJson.Builder.class)) {
      validate(
          annotatedType,
          "@AutoJson.Builder can only be applied to a class or interface inside an"
              + " @AutoJson class");
    }
  }

  Set<? extends Element> validateMethods =
      roundEnv.getElementsAnnotatedWith(AutoJson.Validate.class);
  if (!SuperficialValidation.validateElements(validateMethods)) {
    return false;
  }
  for (Element annotatedMethod : validateMethods) {
    if (isAnnotationPresent(annotatedMethod, AutoJson.Validate.class)) {
      validate(
          annotatedMethod,
          "@AutoJson.Validate can only be applied to a method inside an @AutoJson class");
    }
  }
  return false;
}
 
开发者ID:yongjhih,项目名称:AutoJson,代码行数:34,代码来源:AutoJsonBuilderProcessor.java


注:本文中的com.google.auto.common.SuperficialValidation.validateElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。