Examples of StereotypeDiscovery


Examples of org.apache.felix.ipojo.manipulator.metadata.annotation.model.discovery.StereotypeDiscovery

        AnnotationParser parser = new AnnotationParser();
        AnnotationType annotationType = parser.read(bytes);

        // Search meta-annotations
        ChainedAnnotationDiscovery chain = new ChainedAnnotationDiscovery();
        StereotypeDiscovery stereotypeDiscovery = new StereotypeDiscovery();
        HandlerBindingDiscovery handlerBindingDiscovery = new HandlerBindingDiscovery();
        IgnoredDiscovery ignoredDiscovery = new IgnoredDiscovery();
        chain.getDiscoveries().add(stereotypeDiscovery);
        chain.getDiscoveries().add(handlerBindingDiscovery);
        chain.getDiscoveries().add(ignoredDiscovery);

        annotationType.traverse(chain);

        // Produced Bindings
        List<Binding> bindings = new ArrayList<Binding>();

        // @Stereotype support
        if (stereotypeDiscovery.isStereotype()) {
            m_reporter.trace("@Stereotype detected: @%s", type.getClassName());
            Binding binding = new Binding();
            binding.setAnnotationType(type);
            binding.setPredicate(alwaysTrue());
            binding.setFactory(new StereotypeVisitorFactory(annotationType));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.