Java Code Examples for com.openpojo.reflection.PojoClassFilter#include()
The following examples show how to use
com.openpojo.reflection.PojoClassFilter#include() .
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: FilterNonConcreteTest.java From openpojo with Apache License 2.0 | 6 votes |
@Test public void testInclude() { PojoClassFilter pojoClassFilter = new FilterNonConcrete(); PojoClass stubPojoClass = PojoStubFactory.getStubPojoClass(false); Affirm.affirmTrue(String.format("Filter[%s] was supposed to filter OUT non concrete class", pojoClassFilter), stubPojoClass .isConcrete() == pojoClassFilter.include(stubPojoClass)); stubPojoClass = PojoStubFactory.getStubPojoClass(true); Affirm.affirmTrue(String.format("Filter[%s] was supposed to filter IN concrete class", pojoClassFilter), stubPojoClass.isConcrete() == pojoClassFilter.include(stubPojoClass)); final StubPojoClassFilter stubPojoClassFilter = new StubPojoClassFilter(); pojoClassFilter = new FilterChain(new FilterNonConcrete(), stubPojoClassFilter); stubPojoClass = PojoStubFactory.getStubPojoClass(true); pojoClassFilter.include(stubPojoClass); Affirm.affirmTrue(String.format("Filter [%s] didn't invoke next in filter chain", pojoClassFilter), stubPojoClassFilter .includeCalled); }
Example 2
Source File: PojoClassCoverageFilter.java From openpojo with Apache License 2.0 | 5 votes |
public boolean include(PojoClass pojoClass) { for (PojoClassFilter filter : filters) { if (!filter.include(pojoClass)) return false; } return true; }
Example 3
Source File: PojoPackageImpl.java From openpojo with Apache License 2.0 | 5 votes |
public List<PojoClass> getPojoClasses(final PojoClassFilter filter) { List<PojoClass> pojoClasses = new LinkedList<PojoClass>(); for (Type type : jdkPackage.getTypes()) { PojoClass pojoClass = PojoClassFactory.getPojoClass((Class<?>) type); if (pojoClass != null && (filter == null || filter.include(pojoClass))) { pojoClasses.add(pojoClass); } } return pojoClasses; }
Example 4
Source File: FilterChain.java From openpojo with Apache License 2.0 | 5 votes |
public boolean include(final PojoClass pojoClass) { for (PojoClassFilter pojoClassFilter : pojoClassFilters) { if (!pojoClassFilter.include(pojoClass)) return false; } return true; }