Package org.grouplens.grapht.reflect

Examples of org.grouplens.grapht.reflect.Desire


        instantiator = NodeInstantiator.create();
    }

    @Override
    public <T> T getInstance(Class<T> type) throws InjectionException {
        Desire d = Desires.create(null, type, true);
        DAGEdge<Component, Dependency> e =
                graph.getOutgoingEdgeWithLabel(Dependency.hasInitialDesire(d));

        if (e != null) {
            return type.cast(instantiator.instantiate(e.getTail()));
View Full Code Here


        InjectionPoint ip = d.getInjectionPoint();
        return ip.getAttribute(Transient.class) != null;
    }

    public static boolean edgeIsTransient(DAGEdge<?, Dependency> input) {
        Desire desire = input.getLabel().getInitialDesire();
        return desireIsTransient(desire);
    }
View Full Code Here

    public static Predicate<DAGEdge<?, Dependency>> edgeIsTransient() {
        return new Predicate<DAGEdge<?, Dependency>>() {
            @Override
            public boolean apply(@Nullable DAGEdge<?, Dependency> input) {
                Desire desire = input == null ? null : input.getLabel().getInitialDesire();
                return desire != null && !desireIsTransient(desire);
            }
        };
    }
View Full Code Here

               .setShared(!unsharedNodes.contains(currentNode))
               .setIsProvider(pid != null);
            List<DAGEdge<Component, Dependency>> edges = Lists.newArrayList(currentNode.getOutgoingEdges());
            Collections.sort(edges, GraphtUtils.DEP_EDGE_ORDER);
            for (DAGEdge<Component, Dependency> e: edges) {
                Desire dep = e.getLabel().getInitialDesire();
                Annotation q = dep.getInjectionPoint().getQualifier();
                DAGNode<Component, Dependency> targetNode = e.getTail();
                if (q != null && q.annotationType().getAnnotation(Parameter.class) != null) {
                    logger.debug("dumping parameter {}", q);
                    Component tcsat = targetNode.getLabel();
                    assert tcsat != null;
View Full Code Here

TOP

Related Classes of org.grouplens.grapht.reflect.Desire

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.