Package org.apache.felix.ipojo.manipulator.metadata.annotation.model.discovery

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


        // 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));

            bindings.add(binding);
        }

        // @HandlerBinding support
        if (handlerBindingDiscovery.isHandlerBinding()) {

            m_reporter.trace("@HandlerBinding detected: @%s", type.getClassName());
            Binding binding = new Binding();
            binding.setAnnotationType(type);
            binding.setPredicate(alwaysTrue());
            final Element element = buildElement(handlerBindingDiscovery, type);
            binding.setFactory(new GenericVisitorFactory(element.getName(), element.getNameSpace()));

            bindings.add(binding);
        }

        // Its IMPORTANT that the @Ignore is processed last since it removes existing bindings
        if (ignoredDiscovery.isIgnore()) {
            m_reporter.trace("@Ignore detected: @%s", type.getClassName());
            Binding binding = new NullBinding(type);

            bindings.clear();
            bindings.add(binding);
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.manipulator.metadata.annotation.model.discovery.IgnoredDiscovery

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.