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


Java PojoClassFilter类代码示例

本文整理汇总了Java中com.openpojo.reflection.PojoClassFilter的典型用法代码示例。如果您正苦于以下问题:Java PojoClassFilter类的具体用法?Java PojoClassFilter怎么用?Java PojoClassFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setup

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
@Before
public void setup() {
    pojoClasses = PojoClassFactory.getPojoClassesRecursively(POJO_PACKAGE, new PojoClassFilter() {

        @Override
        public boolean include(PojoClass pojoClass) {
            if(pojoClass.getName().contains("abstract")) {
                return false;
            }

            if(!pojoClass.getName().contains("pocketmedia")) {
                return false;
            }

            return true;
        }
    });

    pojoValidator = new PojoValidator();

    // Create Testers to validate behavior for POJO_PACKAGE
    pojoValidator.addTester(new SetterTester());
    pojoValidator.addTester(new GetterTester());
}
 
开发者ID:Pocketbrain,项目名称:androidnativeadslib,代码行数:25,代码来源:PojosTest.java

示例2: setup

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
@BeforeTest
public void setup() {
    this.pojoClasses = PojoClassFactory.getPojoClasses(POJO_PACKAGE, new PojoClassFilter() {

        @Override
        public boolean include(final PojoClass pojoClass) {
            System.out.println(pojoClass.getName());
            return pojoClass.getName().endsWith("Style");
        }
    });

    this.pojoValidator = new PojoValidator();

    // Create Testers to validate behavior for POJO_PACKAGE
    this.pojoValidator.addTester(new SetterTester());
    this.pojoValidator.addTester(new GetterTester());
}
 
开发者ID:eFaps,项目名称:Data-Exporter,代码行数:18,代码来源:TestPojos.java

示例3: exclude

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public final static PojoClassFilter exclude(Class<?>... classesToExclude) {
    return new ExcludeClassesFilter(classesToExclude);
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例4: excludeBySimpleName

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public final static PojoClassFilter excludeBySimpleName(String... simpleNamesToExclude) {
    return new ExcludeClassNameFilter(simpleNamesToExclude);
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例5: includeTypes

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public final static PojoClassFilter includeTypes(Class<?>... classesToInclude) {
    return new IncludeOnlyTypesFilter(classesToInclude);
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例6: excludeTestClasses

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public final static PojoClassFilter excludeTestClasses() {
    return new ExcludeTestClassesFilter();
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例7: excludeNonConcrete

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public final static PojoClassFilter excludeNonConcrete() {
    return new FilterNonConcrete();
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例8: excludeNestedClasses

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public final static PojoClassFilter excludeNestedClasses() {
    return new FilterNestedClasses();
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例9: hasFields

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public static final PojoClassFilter hasFields() {
    return new ClassHasFieldsFilter();
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例10: excludeInheritingFrom

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public static final PojoClassFilter excludeInheritingFrom(Class<?>... classesToExclude) {
    return new ExcludeInheritingFromFilter(classesToExclude);
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例11: excludeEnums

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public static final PojoClassFilter excludeEnums() {
    return excludeInheritingFrom(Enum.class);
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例12: excludeInterfaces

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
public static final PojoClassFilter excludeInterfaces() {
    return new ExcludeInterfacesFilter();
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:4,代码来源:PojoClassFilters.java

示例13: pojocClassesForPackageName

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
/**
 * creates parameters which are conform with a {@link AbstractPojoTest}, taking classes from below the given package
 * name and taking into account the given filters. The following filters are applied by default:
 * <ul>
 * <li>{@link FilterPackageInfo}: Ignores the package-info.java
 * <li>{@link ExcludeTestClassesFilter}: Ignores test classes
 * <li>{@link FilterCloverClasses}: Ignores all classes generated by clover instrumentation
 * <li>{@link FilterNestedClasses}: Ignores all nested classes
 * </ul>
 *
 * @param packageName the package name, from which to start searching for classes
 * @param classFilters the filters for the classes which will be used
 * @return a list of objects, which will represent a parameter array of className - class pairs. These can be
 *         directly used in a test which extends {@link AbstractPojoTest}.
 */
public static List<Class<?>> pojocClassesForPackageName(String packageName, PojoClassFilter... classFilters) {

    List<PojoClassFilter> filters = new ArrayList<>();
    filters.addAll(Arrays.asList(
            new PojoClassFilter[] { new FilterPackageInfo(), excludeTestClasses(), new FilterCloverClasses() }));
    filters.addAll(Arrays.asList(classFilters));

    List<PojoClass> pojoClasses = PojoClassFactory.getPojoClassesRecursively(packageName,
            new FilterChain(filters.toArray(new PojoClassFilter[] {})));

    return pojoClasses.stream().map(pc -> pc.getClazz()).collect(toList());
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:28,代码来源:PojoTests.java

示例14: pojoClassesForPackageNames

import com.openpojo.reflection.PojoClassFilter; //导入依赖的package包/类
/**
 * creates parameters which are conform with a {@link AbstractPojoTest}, taking classes from below all given package
 * names and taking into account the given filters. This is a convenience method for calling
 * {@link #pojocClassesForPackageName(String, PojoClassFilter...)} with many package names.
 *
 * @param packageNames the package names which shall be searched recursively for classes
 * @param classFilters the filters which shall be applied to the found classes
 * @return a list of objects, which will represent an array of parameters for the {@link AbstractPojoTest}. (Pairs
 *         of className + class)
 * @see #pojocClassesForPackageName(String, PojoClassFilter...)
 */
public static List<Class<?>> pojoClassesForPackageNames(String[] packageNames, PojoClassFilter... classFilters) {
    List<Class<?>> parameters = new ArrayList<>();
    for (String packageName : packageNames) {
        parameters.addAll(pojocClassesForPackageName(packageName, classFilters));
    }
    System.out.println("Found " + parameters.size() + " matching classes.");
    return parameters;
}
 
开发者ID:streamingpool,项目名称:streamingpool-core,代码行数:20,代码来源:PojoTests.java


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