com.syncleus.ferma.WrappedFramedGraph.addFramedVertex()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中com.syncleus.ferma.WrappedFramedGraph.addFramedVertex()方法的一些代码示例,展示了WrappedFramedGraph.addFramedVertex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WrappedFramedGraph.addFramedVertex()方法的具体详情如下:
包路径:com.syncleus.ferma.WrappedFramedGraph
类名称:WrappedFramedGraph
方法名:addFramedVertex

WrappedFramedGraph.addFramedVertex介绍

暂无

代码示例

代码示例来源:origin: Syncleus/Ferma

  1. /**
  2. * Add new isolated vertex to the graph.
  3. *
  4. * @param <T>
  5. * The type used to frame the element.
  6. * @param kind
  7. * The kind of the vertex
  8. * @return The framed vertex
  9. *
  10. */
  11. default <T> T addVertex(Class<T> kind) {
  12. return getGraph().addFramedVertex(kind);
  13. }

代码示例来源:origin: com.syncleus.ferma/ferma

  1. /**
  2. * Add new isolated vertex to the graph.
  3. *
  4. * @param <T>
  5. * The type used to frame the element.
  6. * @param kind
  7. * The kind of the vertex
  8. * @return The framed vertex
  9. *
  10. */
  11. default <T> T addVertex(Class<T> kind) {
  12. return getGraph().addFramedVertex(kind);
  13. }

代码示例来源:origin: windup/windup

  1. /**
  2. * Create a new instance of the given {@link WindupVertexFrame} type. The ID is generated by the underlying graph database.
  3. */
  4. @Override
  5. public T create()
  6. {
  7. return ExecutionStatistics.performBenchmarked("GraphService.create", () -> context.getFramed().addFramedVertex(type));
  8. }

代码示例来源:origin: org.jboss.windup.graph/windup-graph-api

  1. /**
  2. * Create a new instance of the given {@link WindupVertexFrame} type. The ID is generated by the underlying graph database.
  3. */
  4. @Override
  5. public T create()
  6. {
  7. return ExecutionStatistics.performBenchmarked("GraphService.create", () -> context.getFramed().addFramedVertex(type));
  8. }

代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api

  1. public void perform(GraphRewrite event, EvaluationContext context) {
  2. if (!isPerformMavenization(event.getGraphContext()))
  3. return;
  4. GlobalBomModel bom = event.getGraphContext().getFramed().addFramedVertex(GlobalBomModel.class);
  5. ArchiveCoordinateModel jbossParent = event.getGraphContext().getFramed().addFramedVertex(ArchiveCoordinateModel.class);
  6. copyTo(JBOSS_PARENT, jbossParent);
  7. bom.setParent(jbossParent);
  8. }
  9. })

代码示例来源:origin: windup/windup

  1. public void perform(GraphRewrite event, EvaluationContext context) {
  2. if (!isPerformMavenization(event.getGraphContext()))
  3. return;
  4. GlobalBomModel bom = event.getGraphContext().getFramed().addFramedVertex(GlobalBomModel.class);
  5. ArchiveCoordinateModel jbossParent = event.getGraphContext().getFramed().addFramedVertex(ArchiveCoordinateModel.class);
  6. copyTo(JBOSS_PARENT, jbossParent);
  7. bom.setParent(jbossParent);
  8. }
  9. })

代码示例来源:origin: windup/windup

  1. public NamespaceMetaModel createNamespaceSchemaLocation(String namespaceURI, String schemaLocation)
  2. {
  3. Iterable<? extends NamespaceMetaModel> results = getGraphContext().getQuery(NamespaceMetaModel.class)
  4. .traverse(g -> g.has("namespaceURI", namespaceURI).has("schemaLocation", schemaLocation))
  5. .toList(NamespaceMetaModel.class);
  6. if (results.iterator().hasNext())
  7. {
  8. return results.iterator().next();
  9. }
  10. // otherwise, create it.
  11. NamespaceMetaModel meta = getGraphContext().getFramed().addFramedVertex(NamespaceMetaModel.class);
  12. meta.setSchemaLocation(schemaLocation);
  13. meta.setURI(namespaceURI);
  14. return meta;
  15. }

代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api

  1. public JavaMethodModel addJavaMethod(JavaClassModel jcm, String methodName, JavaClassModel[] params)
  2. {
  3. ExecutionStatistics.get().begin("JavaClassService.addJavaMethod(jcm, methodName, params)");
  4. JavaMethodModel javaMethodModel = getGraphContext().getFramed().addFramedVertex(JavaMethodModel.class);
  5. javaMethodModel.setMethodName(methodName);
  6. for (int i = 0; i < params.length; i++)
  7. {
  8. JavaClassModel param = params[i];
  9. JavaParameterModel paramModel = getGraphContext().getFramed().addFramedVertex(JavaParameterModel.class);
  10. paramModel.setJavaType(param);
  11. paramModel.setPosition(i);
  12. javaMethodModel.addMethodParameter(paramModel);
  13. }
  14. jcm.addJavaMethod(javaMethodModel);
  15. ExecutionStatistics.get().end("JavaClassService.addJavaMethod(jcm, methodName, params)");
  16. return javaMethodModel;
  17. }

代码示例来源:origin: windup/windup

  1. public JavaMethodModel addJavaMethod(JavaClassModel jcm, String methodName, JavaClassModel[] params)
  2. {
  3. ExecutionStatistics.get().begin("JavaClassService.addJavaMethod(jcm, methodName, params)");
  4. JavaMethodModel javaMethodModel = getGraphContext().getFramed().addFramedVertex(JavaMethodModel.class);
  5. javaMethodModel.setMethodName(methodName);
  6. for (int i = 0; i < params.length; i++)
  7. {
  8. JavaClassModel param = params[i];
  9. JavaParameterModel paramModel = getGraphContext().getFramed().addFramedVertex(JavaParameterModel.class);
  10. paramModel.setJavaType(param);
  11. paramModel.setPosition(i);
  12. javaMethodModel.addMethodParameter(paramModel);
  13. }
  14. jcm.addJavaMethod(javaMethodModel);
  15. ExecutionStatistics.get().end("JavaClassService.addJavaMethod(jcm, methodName, params)");
  16. return javaMethodModel;
  17. }

代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api

  1. private ApplicationReportModel createAboutWindup(GraphContext context, ProjectModel projectModel)
  2. {
  3. ApplicationReportService applicationReportService = new ApplicationReportService(context);
  4. ApplicationReportModel applicationReportModel = applicationReportService.create();
  5. applicationReportModel.setReportPriority(10000);
  6. applicationReportModel.setReportName(REPORT_NAME);
  7. applicationReportModel.setDescription(REPORT_DESCRIPTION);
  8. applicationReportModel.setReportIconClass("fa fa-question-circle");
  9. applicationReportModel.setMainApplicationReport(false);
  10. applicationReportModel.setDisplayInApplicationReportIndex(true);
  11. if (projectModel == null)
  12. applicationReportModel.setDisplayInGlobalApplicationIndex(true);
  13. else
  14. applicationReportModel.setProjectModel(projectModel);
  15. applicationReportModel.setTemplatePath(TEMPLATE_APPLICATION_REPORT);
  16. applicationReportModel.setTemplateType(TemplateType.FREEMARKER);
  17. Map<String, WindupVertexFrame> related = new HashMap<>();
  18. AboutWindupModel aboutWindupModel = context.getFramed().addFramedVertex(AboutWindupModel.class);
  19. aboutWindupModel.setWindupRuntimeVersion(addon.getId().getVersion().toString());
  20. related.put("windupAbout", aboutWindupModel);
  21. applicationReportModel.setRelatedResource(related);
  22. // Set the filename for the report
  23. ReportService reportService = new ReportService(context);
  24. String filename = projectModel == null ? "about_global" : "about_" + projectModel.getName();
  25. reportService.setUniqueFilename(applicationReportModel, filename, "html");
  26. return applicationReportModel;
  27. }

代码示例来源:origin: windup/windup

  1. private ApplicationReportModel createAboutWindup(GraphContext context, ProjectModel projectModel)
  2. {
  3. ApplicationReportService applicationReportService = new ApplicationReportService(context);
  4. ApplicationReportModel applicationReportModel = applicationReportService.create();
  5. applicationReportModel.setReportPriority(10000);
  6. applicationReportModel.setReportName(REPORT_NAME);
  7. applicationReportModel.setDescription(REPORT_DESCRIPTION);
  8. applicationReportModel.setReportIconClass("fa fa-question-circle");
  9. applicationReportModel.setMainApplicationReport(false);
  10. applicationReportModel.setDisplayInApplicationReportIndex(true);
  11. if (projectModel == null)
  12. applicationReportModel.setDisplayInGlobalApplicationIndex(true);
  13. else
  14. applicationReportModel.setProjectModel(projectModel);
  15. applicationReportModel.setTemplatePath(TEMPLATE_APPLICATION_REPORT);
  16. applicationReportModel.setTemplateType(TemplateType.FREEMARKER);
  17. Map<String, WindupVertexFrame> related = new HashMap<>();
  18. AboutWindupModel aboutWindupModel = context.getFramed().addFramedVertex(AboutWindupModel.class);
  19. aboutWindupModel.setWindupRuntimeVersion(addon.getId().getVersion().toString());
  20. related.put("windupAbout", aboutWindupModel);
  21. applicationReportModel.setRelatedResource(related);
  22. // Set the filename for the report
  23. ReportService reportService = new ReportService(context);
  24. String filename = projectModel == null ? "about_global" : "about_" + projectModel.getName();
  25. reportService.setUniqueFilename(applicationReportModel, filename, "html");
  26. return applicationReportModel;
  27. }

代码示例来源:origin: windup/windup

  1. DoctypeMetaModel meta = event.getGraphContext().getFramed().addFramedVertex(DoctypeMetaModel.class);
  2. meta.addXmlResource(xmlResourceModel);
  3. meta.setBaseURI(docType.getBaseURI());

相关文章