Search in sources :

Example 1 with TypeElementsScanner

use of org.reflections.scanners.TypeElementsScanner in project reflections by ronmamo.

the class JavaCodeSerializerTest method generateAndSave.

@BeforeClass
public static void generateAndSave() {
    Predicate<String> filter = new FilterBuilder().include("org.reflections.TestModel\\$.*");
    Reflections reflections = new Reflections(new ConfigurationBuilder().filterInputsBy(filter).setScanners(new TypeElementsScanner().includeFields().publicOnly(false)).setUrls(asList(ClasspathHelper.forClass(TestModel.class))));
    //save
    String filename = ReflectionsTest.getUserDir() + "/src/test/java/org.reflections.MyTestModelStore";
    reflections.save(filename, new JavaCodeSerializer());
}
Also used : ConfigurationBuilder(org.reflections.util.ConfigurationBuilder) JavaCodeSerializer(org.reflections.serializers.JavaCodeSerializer) FilterBuilder(org.reflections.util.FilterBuilder) TypeElementsScanner(org.reflections.scanners.TypeElementsScanner) BeforeClass(org.junit.BeforeClass)

Aggregations

BeforeClass (org.junit.BeforeClass)1 TypeElementsScanner (org.reflections.scanners.TypeElementsScanner)1 JavaCodeSerializer (org.reflections.serializers.JavaCodeSerializer)1 ConfigurationBuilder (org.reflections.util.ConfigurationBuilder)1 FilterBuilder (org.reflections.util.FilterBuilder)1