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

The following examples show how to use com.openpojo.reflection.PojoClass#isAbstract() . 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: InstanceFactory.java    From openpojo with Apache License 2.0 5 votes vote down vote up
private static PojoMethod getConstructorByCriteria(final PojoClass pojoClass, final ArrayLengthBasedComparator comparator) {
  PojoMethod constructor = null;
  for (final PojoMethod pojoConstructor : pojoClass.getPojoConstructors()) {
    if (!pojoConstructor.isSynthetic() && !(pojoClass.isAbstract() && pojoConstructor.isPrivate()))
      if (constructor == null)
        constructor = pojoConstructor;
      else {
        if (comparator.compare(pojoConstructor.getParameterTypes(), constructor.getParameterTypes()))
          constructor = pojoConstructor;
      }
  }
  return constructor;
}
 
Example 2
Source File: PojoPackageTestBase.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Override
public boolean include(final PojoClass pojoClass) {
    return !pojoClass.isAbstract();
}
 
Example 3
Source File: AbstractUnitTest.java    From cia with Apache License 2.0 4 votes vote down vote up
public boolean include(final PojoClass pojoClass) {
	return !(pojoClass.getSourcePath().contains("/test-classes/")
			|| pojoClass.getClazz().getName().contains("_") || pojoClass.isEnum() || pojoClass.isAbstract())
			&& FilterPackageInfo.include(pojoClass);
}
 
Example 4
Source File: InstanceFactory.java    From openpojo with Apache License 2.0 2 votes vote down vote up
/**
 * This method returns a new instance created using the parameters given.
 * If parameters array is null or not null but is of length zero, then the getInstance will call
 * the no arg constructor.
 * If you want to pass null to a single/multiple parameter constructor, then create an array of the correct size
 * matching the parameters.
 *
 * @param pojoClass
 *     The pojoClass to instantiate.
 * @param parameters
 *     The parameters to pass to the constructor.
 * @return a newly created instance of the class represented in the pojoClass.
 */
public static Object getInstance(final PojoClass pojoClass, final Object... parameters) {
  if (pojoClass.isAbstract())
    return doGetInstance(wrapAbstractClass(pojoClass), parameters);
  return doGetInstance(pojoClass, parameters);
}