Package org.reflections.scanners

Examples of org.reflections.scanners.FieldAnnotationsScanner


  private static Configuration getConfiguration(List<URL> urls) {
    return new ConfigurationBuilder()
            .setUrls(urls)
                    //.filterInputsBy(new FilterBuilder().exclude(CLIENT_PKG_REGEX))
            .setScanners(
                    new FieldAnnotationsScanner(),
                    new MethodAnnotationsScanner(),
                    new TypeAnnotationsScanner(),
                    //new SubTypesScanner(),
                    propScanner
            );
View Full Code Here


  private static Configuration getConfiguration(List<URL> urls) {

    return new ConfigurationBuilder()
            .setUrls(urls)
            .setScanners(
                    new FieldAnnotationsScanner(),
                    new MethodAnnotationsScanner(),
                    new TypeAnnotationsScanner() {
                      @Override
                      public void scan(Object cls) {
                        @SuppressWarnings("unchecked")
View Full Code Here

      CtClass mainclas = cp.makeClass("org.zkoss.zkplus.cdi.ZKComponentProducerMethods");
      final List<URL> l = getUrlsForCurrentClasspath();
     
      Reflections reflections = new Reflections(
          new ConfigurationBuilder().setUrls(l)
          .setScanners(new FieldAnnotationsScanner()));
     
      Set<Field> fields = reflections.getFieldsAnnotatedWith(ComponentId.class);
      for (Iterator iterator2 = fields.iterator(); iterator2
          .hasNext();) {
        Field field = (Field) iterator2.next();
View Full Code Here

        //above procedure doesn't ensure to obtain 'WEB-INF/classes'
        urlSet.add(ClasspathHelper.getUrlForServletContextClasses(sce.getServletContext()));
      }
      Reflections reflections = new Reflections(
          new ConfigurationBuilder().setUrls(urlSet)
          .setScanners(new FieldAnnotationsScanner()));
     
      Set<Field> fields = reflections.getFieldsAnnotatedWith(Autowired.class);
      int methodCounter = 0;
      for (Iterator<Field> iterator2 = fields.iterator(); iterator2.hasNext();) {
        Field mField = (Field) iterator2.next();
View Full Code Here

        //
        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(filter)
                .setScanners(new SubTypesScanner().filterResultsBy(filter),
                        new TypeAnnotationsScanner().filterResultsBy(filter),
                        new FieldAnnotationsScanner().filterResultsBy(filter),
                        new MethodAnnotationsScanner().filterResultsBy(filter),
                        new MethodParameterScanner())
                .setUrls(ClasspathHelper.forPackage(packName)));

        return reflections;
View Full Code Here

    @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;
View Full Code Here

    @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") ) {
View Full Code Here

        //
        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(filter)
                .setScanners(new SubTypesScanner().filterResultsBy(filter),
                        new TypeAnnotationsScanner().filterResultsBy(filter),
                        new FieldAnnotationsScanner().filterResultsBy(filter),
                        new MethodAnnotationsScanner().filterResultsBy(filter),
                        new MethodParameterScanner())
                .setUrls(ClasspathHelper.forPackage(packName)));

        return reflections;
View Full Code Here

    scanners = 0;
    if (isScanClassAnnotations()) {
      config[scanners++] = new TypeAnnotationsScanner();
    }
    if (isScanFieldAnnotations()) {
      config[scanners++] = new FieldAnnotationsScanner();
    }
    if (isScanMethodAnnotations()) {
      config[scanners++] = new MethodAnnotationsScanner();
    }
    if (isScanParameterAnnotations()) {
View Full Code Here

      } catch (Exception ex) {
        // ignore
      }
      Configuration config = new ConfigurationBuilder()
        .setUrls(ClasspathHelper.forManifest(ClasspathHelper.forJavaClassPath()))
        .setScanners(new TypeAnnotationsScanner(), new FieldAnnotationsScanner(), new SubTypesScanner(false))
        .filterInputsBy(FilterBuilder.parse(AnnotationReflector.DEFAULT_ANNOTATION_REFLECTOR_FILTER))
        .addClassLoaders(loaders)
        .useParallelExecutor();
      AnnotationReflector.initDefaultReflector(new AnnotationReflector(config));
      AnnotationReflector reflector = AnnotationReflector.getDefaultReflector();
View Full Code Here

TOP

Related Classes of org.reflections.scanners.FieldAnnotationsScanner

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.