Package org.reflections

Examples of org.reflections.reflections$TestModel$Usage$C1$fields


        return (T) jaxbProvider.deserialize(xmlObject);
    }

    @Test
    public void uniqueRootElementTest() throws Exception {
        Reflections reflections = new Reflections(
                ClasspathHelper.forPackage("org.kie.services"),
                new TypeAnnotationsScanner(), new FieldAnnotationsScanner(), new MethodAnnotationsScanner());
        Set<String> idSet = new HashSet<String>();
        Map<String, Class> idClassMap = new HashMap<String, Class>();
        for (Class<?> jaxbClass : reflections.getTypesAnnotatedWith(XmlRootElement.class)) {
            if( ! jaxbClass.getPackage().getName().startsWith("org.kie") ) {
                continue;
            }
            XmlRootElement rootElemAnno = jaxbClass.getAnnotation(XmlRootElement.class);
            String id = rootElemAnno.name();
View Full Code Here


        testRoundTripClassesSet(extraJaxbClasses);
    }

    @Test
    public void processInstanceIdFieldInCommands() throws Exception {
        Reflections cmdReflections = new Reflections(
                ClasspathHelper.forPackage("org.drools.command.*"),
                new TypeAnnotationsScanner(), new FieldAnnotationsScanner(), new MethodAnnotationsScanner(), new SubTypesScanner());

        Set<Class<?>> classes = cmdReflections.getTypesAnnotatedWith(XmlRootElement.class);
        Set<Class> cmdClasses = new HashSet<Class>();
        for (Class<?> jaxbClass : classes ) {
            if( jaxbClass.getSimpleName().endsWith("Command") ) {
                cmdClasses.add(jaxbClass);
            }
View Full Code Here

  }

  private static void dynamicallyBuildCommandFactoryMap()
  {
    Reflections reflections = new Reflections("edu.isi.karma");

    Set<Class<? extends CommandFactory>> subTypes =
        reflections.getSubTypesOf(CommandFactory.class);

    for (Class<? extends CommandFactory> subType : subTypes)
    {
      if(subType.getClass().getName().contains("FetchTransformingData"))
      {
View Full Code Here

        final Set<Class<?>> entities = new HashSet<Class<?>>();
        for (final String packageName : packages) {
            if (packageName.split("\\.").length < 3) {
                throw new IllegalArgumentException("The package name " + packageName + " is too short, please be more specific");
            }
            final Reflections reflections = new Reflections(packageName);
            entities.addAll(reflections.getTypesAnnotatedWith(Entity.class));
            entities.addAll(reflections.getTypesAnnotatedWith(MappedSuperclass.class));
        }
        return entities;
    }
View Full Code Here

      filterBuilder.include(FilterBuilder.prefix(basePkg));
    }

    cfgBldr.filterInputsBy(filterBuilder).setScanners(
        new SubTypesScanner(), new TypeAnnotationsScanner());
    this.reflections = new Reflections(cfgBldr);
  }
View Full Code Here

  @Provides
  private EventHubHandler getEventHubHandler(Injector injector, EventHub eventHub)
      throws ClassNotFoundException {
    Map<String, Provider<Command>> commandsMap = Maps.newHashMap();
    Reflections reflections = new Reflections(PACKAGE_NAME);
    Set<Class<? extends Command>> commandClasses = reflections.getSubTypesOf(Command.class);
    for (Class<? extends Command> commandClass : commandClasses) {
      String path = commandClass.getAnnotation(Path.class).value();
      //noinspection unchecked
      commandsMap.put(path, (Provider<Command>) injector.getProvider(commandClass));
    }
View Full Code Here

        }
    }

    // Gets all classes with some annotation from a package
    public static Set<Class<?>> getClassesWithAnnotation(Class<? extends Annotation> annotation, String[] packageNames) {
        Reflections reflections;
        Set<Class<?>> classes = new HashSet<Class<?>>();
        for (String packageName : packageNames) {
            reflections = new Reflections(packageName);
            classes.addAll(reflections.getTypesAnnotatedWith(annotation));
        }
        return classes;
    }
View Full Code Here

      });
      super.run(notifier);
    }
    private static Class<?>[] findClasses() {
      Reflections reflections = new Reflections("org.zkoss.test.zss.cases");
      Set<Class<?>> testCases = reflections.getTypesAnnotatedWith(ZSSTestCase.class);
      return testCases.toArray(new Class[testCases.size()]);
    }
View Full Code Here

        System.out.println("Starting command scan...");

        vault = new HashMap<String, Class<? extends Command>>();

        Reflections reflections = new Reflections("net.eldiosantos");

        Set<Class<? extends Command>> subTypes = reflections
            .getSubTypesOf(Command.class);

        for (Class<? extends Command> c : subTypes) {
          if (!Modifier.isAbstract(c.getModifiers())) {
            addClass(c);
View Full Code Here

        s.addAll(Arrays.asList(ClasspathUrlFinder.findClassPaths()));
        conf.setUrls(new ArrayList(s));

        conf.filterInputsBy(predicate);

        final Reflections r = new Reflections(conf);

        final Set<Class<?>> entities = r.getTypesAnnotatedWith(Entity.class);
        for (final Class<?> c : entities) {
            m.map(c);
        }
    }
View Full Code Here

TOP

Related Classes of org.reflections.reflections$TestModel$Usage$C1$fields

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.