Java Code Examples for com.openpojo.reflection.PojoClass#isSynthetic()

The following examples show how to use com.openpojo.reflection.PojoClass#isSynthetic() . 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: StructuralTest.java    From openpojo with Apache License 2.0 6 votes vote down vote up
public boolean include(PojoClass pojoClass) {

      if (pojoClass.getSourcePath().contains("test-classes")
          || RuntimeException.class.isAssignableFrom(pojoClass.getClazz())
          || excluded.contains(pojoClass.getName())
          || pojoClass.isSynthetic()
          || (pojoClass.isNestedClass() && pojoClass.isPrivate()))
        return false;

      boolean includeReturn = true;
      for (PojoMethod method : pojoClass.getPojoMethods())
      if (!method.isSynthetic() && !method.isConstructor())
        includeReturn &= method.isStatic();

      return includeReturn;
    }
 
Example 2
Source File: ValidationHelper.java    From openpojo with Apache License 2.0 5 votes vote down vote up
public static void runValidation(PojoClass pojoClass, List<Rule> rules, List<Tester> testers) {
  final Logger logger = LoggerFactory.getLogger(DefaultValidator.class);

  if (pojoClass.isSynthetic()) {
    logger.warn("Attempt to validate synthetic class=[{0}] ignored, consider using FilterSyntheticClasses filter when " +
        "calling PojoClassFactory", pojoClass.getClazz());
    return;
  }

  for (final Rule rule : rules) {
    rule.evaluate(pojoClass);
  }

  if ((pojoClass.isInterface() || pojoClass.isEnum()) && testers.size() > 0) {
    logger.warn("Attempt to execute behavioural test on non-constructable class=[{0}] ignored", pojoClass.getClazz());
    return;
  }

  try {
    for (final Tester tester : testers) {
      tester.run(pojoClass);
    }
  } catch (ASMNotLoadedException asmNotLoaded) {
    logger.warn("ASM not loaded while attempting to execute behavioural tests on non-constructable class[{0}], either " +
        "filter " + "abstract classes or add asm to your classpath.", pojoClass.getClazz());
  }
}
 
Example 3
Source File: FilterSyntheticClasses.java    From openpojo with Apache License 2.0 4 votes vote down vote up
public boolean include(PojoClass pojoClass) {
  return !pojoClass.isSynthetic();
}