Package org.reflections.scanners

Examples of org.reflections.scanners.MethodAnnotationsScanner


    return this;
  }

  private Set<Class<?>> scanTypes(String packageName) {
    Reflections reflections = new Reflections(packageName,
        new MethodAnnotationsScanner());
    Set<Class<?>> types = new HashSet<Class<?>>();
    types.addAll(typesAnnotatedWith(reflections, Given.class));
    types.addAll(typesAnnotatedWith(reflections, When.class));
    types.addAll(typesAnnotatedWith(reflections, Then.class));
    types.addAll(typesAnnotatedWith(reflections, Before.class));
View Full Code Here


    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

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

      if (d.getPackagesToScan() != null) {
        for (String pack : d.getPackagesToScan()) {
          Reflections reflections = new Reflections(
              new ConfigurationBuilder()
                  .setUrls(ClasspathHelper.forPackage(pack))
                  .setScanners(new MethodAnnotationsScanner()));

          Set<java.lang.reflect.Method> annotated = reflections
              .getMethodsAnnotatedWith(ar.com.jmfsg.documentation.annotation.Documentation.class);

          Iterator<java.lang.reflect.Method> it = annotated
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

            // Check if there are complements via annotations
            if (d.getPackagesToScan() != null) {
                for (String pack : d.getPackagesToScan()) {
                    Reflections reflections = new Reflections(new ConfigurationBuilder().setUrls(
                        ClasspathHelper.forPackage(pack)).setScanners(new MethodAnnotationsScanner()));

                    Set<Method> annotated = reflections.getMethodsAnnotatedWith(Documentation.class);

                    Iterator<Method> it = annotated.iterator();
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

        ConfigurationBuilder builder = new ConfigurationBuilder();

        Set<URL> packagesToScan = getPackagesToScanForRoutes();
        builder.addUrls(packagesToScan);

        builder.addScanners(new MethodAnnotationsScanner());
        Reflections reflections = new Reflections(builder);

        // collect the allowed annotated methods
        Map<Class<?>, Set<String>> controllers = Maps.newHashMap();
        List<Method> methods = Lists.newArrayList();
View Full Code Here

        ConfigurationBuilder builder = new ConfigurationBuilder();
       
        Set<URL> packagesToScan = getPackagesToScanForRoutes(ninjaProperties);
        builder.addUrls(packagesToScan);
       
        builder.addScanners(new MethodAnnotationsScanner());
        Reflections reflections = new Reflections(builder);

        Set<Method> methods = reflections.getMethodsAnnotatedWith(Route.class);

        logger.info("Generating {} routes.", methods.size());
View Full Code Here

TOP

Related Classes of org.reflections.scanners.MethodAnnotationsScanner

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.