Package org.apache.xbean.finder.archive

Examples of org.apache.xbean.finder.archive.ClassesArchive


                    annotationFinder = af.select(names);
                    finder = af.select(clazz.getName());
                } else {
                    if (!dynamicBean) {
                        annotationFinder = createFinder(clazz);
                        finder = new AnnotationFinder(new ClassesArchive(clazz));
                    } else {
                        final Class<?>[] classes;
                        final Proxy proxy = metaClass.getAnnotation(Proxy.class);
                        if (proxy == null) {
                            classes = new Class<?>[]{clazz};
                        } else {
                            classes = new Class<?>[]{clazz, proxy.value()};
                        }
                        annotationFinder = createFinder(classes);
                        finder = new AnnotationFinder(new ClassesArchive(classes));
                    }
                }

                /*
                 * @PostConstruct
 
View Full Code Here


            final Set<Class<?>> parents = new HashSet<Class<?>>();
            for (final Class<?> clazz : classes) {
                parents.addAll(Classes.ancestors(clazz));
            }

            return new AnnotationFinder(new ClassesArchive(parents)).link();
        }
View Full Code Here

            } else {
                finder.enableMetaAnnotations(); // needed to stay compliant
                enableSubclassing(finder);
            }
        } else {
            finder = new AnnotationFinder(new ClassesArchive());
        }

        return new ModuleLimitedFinder(finder);
    }
View Full Code Here

            .build();
    }

    @Module
    public IAnnotationFinder finder() { // needed to run the test
        return new AnnotationFinder(new ClassesArchive());
    }
View Full Code Here

            .build();
    }

    @Module
    public IAnnotationFinder finder() { // needed to run the test
        return new AnnotationFinder(new ClassesArchive());
    }
View Full Code Here

    }


    @Test
    public void testSortClasses() throws Exception {
        final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(Emerald.class)).link();

        final List<Annotated<Class<?>>> classes = finder.findMetaAnnotatedClasses(Resource.class);
        assertTrue(classes.size() >= 3);

        final List<Annotated<Class<?>>> sorted = AnnotationDeployer.sortClasses(classes);
View Full Code Here

        assertEquals(Color.class, sorted.get(2).get());
    }

    @Test
    public void testSortMethods() throws Exception {
        final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(Emerald.class)).link();

        final List<Annotated<Method>> classes = finder.findMetaAnnotatedMethods(Resource.class);
        assertTrue(classes.size() >= 3);

        final List<Annotated<Method>> sorted = AnnotationDeployer.sortMethods(classes);
View Full Code Here

        final WebApp webApp = new WebApp();
        webApp.setContextRoot("/");
        webApp.setId("web");
        webApp.setVersion("2.5");
        WebModule webModule = new WebModule(webApp, webApp.getContextRoot(), Thread.currentThread().getContextClassLoader(), "myapp", webApp.getId());
        webModule.setFinder(new AnnotationFinder(new ClassesArchive(RESTClass.class, RESTMethod.class, RESTApp.class)).link());

        final AnnotationDeployer annotationDeployer = new AnnotationDeployer();
        webModule = annotationDeployer.deploy(webModule);

        final Set<String> classes = webModule.getRestClasses();
View Full Code Here

        delegate = new CompositeArchive(archives);
    }

    public CdiArchive(final Collection<Class<?>> classList)
    {
        delegate = new FilteredArchive(new ClassesArchive(classList), new Filter()
        {
            @Override
            public boolean accept(final String name)
            {
                classes.add(name);
View Full Code Here

            // TODO:  Put our scanning ehnancements back, here
            fillEjbJar(webModule, webEjbModule);

            if (webModule.getFinder() == null) {
                if (isMetadataComplete(webModule, webEjbModule)) {
                    final IAnnotationFinder finder = new org.apache.xbean.finder.AnnotationFinder(new ClassesArchive());
                    webModule.setFinder(finder);
                    webEjbModule.setFinder(finder);
                } else {
                    final IAnnotationFinder finder = FinderFactory.createFinder(webModule);
                    webModule.setFinder(finder);
View Full Code Here

TOP

Related Classes of org.apache.xbean.finder.archive.ClassesArchive

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.