Examples of GraphBuilder


Examples of org.jboss.errai.ioc.rebind.ioc.graph.GraphBuilder

                    control.notifyDependency(parm.getType());
                    final Set<MetaClass> interfaceTypes = fillInInterface(parm.getType());
                    control.notifyDependencies(interfaceTypes);

                    if (!producerMember.isStatic()) {
                      final GraphBuilder graphBuilder = injectionContext.getGraphBuilder();
                      graphBuilder.addDependency(producerMember.getDeclaringClass(), Dependency.on(parm.getType()));
                      for (MetaClass type : interfaceTypes) {
                        graphBuilder.addDependency(producerMember.getDeclaringClass(), Dependency.on(type));
                      }
                    }
                  }

                  break;
View Full Code Here

Examples of org.jboss.errai.ioc.rebind.ioc.graph.GraphBuilder

                    final Set<MetaClass> classSet = fillInInterface(parm.getType());
                    control.notifyDependency(parm.getType());
                    control.notifyDependencies(classSet);

                    if (!producerMember.isStatic()) {
                      final GraphBuilder graphBuilder = injectionContext.getGraphBuilder();
                      graphBuilder.addDependency(producerMember.getDeclaringClass(), Dependency.on(parm.getType()));
                      for (MetaClass metaClass : classSet) {
                        graphBuilder.addDependency(producerMember.getDeclaringClass(), Dependency.on(metaClass));
                      }
                    }
                  }

                  break;
View Full Code Here

Examples of org.jboss.errai.ioc.rebind.ioc.graph.GraphBuilder

  public static void processDependencies(final DependencyControl control,
                                         final MetaClass metaClass,
                                         final InjectionContext context) {

    final GraphBuilder graphBuilder = context.getGraphBuilder();
    MetaClass mc = metaClass;
    do {
      for (MetaField field : mc.getDeclaredFields()) {

        if (context.isElementType(WiringElementType.InjectionPoint, field)) {
          control.notifyDependency(field.getType());

          for (MetaClass cls : fillInInterface(field.getType())) {
            graphBuilder.addDependency(field.getType(), Dependency.on(cls));
          }
        }
      }

      for (MetaMethod method : mc.getDeclaredMethods()) {
        if (context.isElementType(WiringElementType.InjectionPoint, method)) {
          for (MetaParameter parm : method.getParameters()) {
            control.notifyDependency(parm.getType());

            for (MetaClass cls : fillInInterface(parm.getType())) {
              graphBuilder.addDependency(parm.getType(), Dependency.on(cls));
            }
          }
        }
      }

      for (MetaConstructor constructor : mc.getConstructors()) {
        if (context.isElementType(WiringElementType.InjectionPoint, constructor)) {
          for (MetaParameter parm : constructor.getParameters()) {
            control.notifyDependency(parm.getType());

            for (MetaClass cls : fillInInterface(parm.getType())) {
              graphBuilder.addDependency(parm.getType(), Dependency.on(cls));
            }
          }
        }
      }
    }
View Full Code Here

Examples of org.opentripplanner.graph_builder.services.GraphBuilder

            graphBuilder.addGraphBuilder(embeddedConfigBuilder);
        }
        if (params.elevation) {
            File cacheDirectory = new File(params.cacheDirectory, "ned");
            ElevationGridCoverageFactory gcf = new NEDGridCoverageFactoryImpl(cacheDirectory);
            GraphBuilder elevationBuilder = new ElevationGraphBuilderImpl(gcf);
            graphBuilder.addGraphBuilder(elevationBuilder);
        }
        graphBuilder.serializeGraph = ( ! params.inMemory ) || params.preFlight;
        return graphBuilder;
    }
View Full Code Here

Examples of org.teavm.common.GraphBuilder

        }
        return graphBuilder.build();
    }

    public static Graph buildControlFlowGraphWithTryCatch(Program program) {
        GraphBuilder graphBuilder = new GraphBuilder(program.basicBlockCount());
        InstructionTransitionExtractor transitionExtractor = new InstructionTransitionExtractor();
        for (int i = 0; i < program.basicBlockCount(); ++i) {
            BasicBlock block = program.basicBlockAt(i);
            Instruction insn = block.getLastInstruction();
            if (insn != null) {
                insn.acceptVisitor(transitionExtractor);
                if (transitionExtractor.getTargets() != null) {
                    for (BasicBlock successor : transitionExtractor.getTargets()) {
                        graphBuilder.addEdge(i, successor.getIndex());
                        for (TryCatchBlock succTryCatch : successor.getTryCatchBlocks()) {
                            graphBuilder.addEdge(i, succTryCatch.getHandler().getIndex());
                        }
                    }
                }
            }
            for (TryCatchBlock tryCatch : block.getTryCatchBlocks()) {
                graphBuilder.addEdge(i, tryCatch.getHandler().getIndex());
            }
        }
        return graphBuilder.build();
    }
View Full Code Here

Examples of org.teavm.common.GraphBuilder

public final class ProgramUtils {
    private ProgramUtils() {
    }

    public static Graph buildControlFlowGraph(Program program) {
        GraphBuilder graphBuilder = new GraphBuilder(program.basicBlockCount());
        InstructionTransitionExtractor transitionExtractor = new InstructionTransitionExtractor();
        for (int i = 0; i < program.basicBlockCount(); ++i) {
            BasicBlock block = program.basicBlockAt(i);
            Instruction insn = block.getLastInstruction();
            if (insn != null) {
                insn.acceptVisitor(transitionExtractor);
                if (transitionExtractor.getTargets() != null) {
                    for (BasicBlock successor : transitionExtractor.getTargets()) {
                        graphBuilder.addEdge(i, successor.getIndex());
                    }
                }
            }
            for (TryCatchBlock tryCatch : block.getTryCatchBlocks()) {
                graphBuilder.addEdge(i, tryCatch.getHandler().getIndex());
            }
        }
        return graphBuilder.build();
    }
View Full Code Here

Examples of org.teavm.common.GraphBuilder

public final class VariableUsageGraphBuilder {
    private VariableUsageGraphBuilder() {
    }

    public static Graph build(Program program) {
        GraphBuilder builder = new GraphBuilder(program.variableCount());
        InstructionAnalyzer analyzer = new InstructionAnalyzer(builder);
        for (int i = 0; i < program.basicBlockCount(); ++i) {
            BasicBlock block = program.basicBlockAt(i);
            for (Instruction insn : block.getInstructions()) {
                insn.acceptVisitor(analyzer);
            }
            for (Phi phi : block.getPhis()) {
                for (Incoming incoming : phi.getIncomings()) {
                    builder.addEdge(incoming.getValue().getIndex(), phi.getReceiver().getIndex());
                }
            }
        }
        return builder.build();
    }
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.