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

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

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

WrappedFramedGraph.frameElement介绍

暂无

代码示例

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

  1. public String upToThirdDot(final GraphContext context, final Vertex v)
  2. {
  3. JavaClassFileModel javaModel = context.getFramed().frameElement(v, JavaClassFileModel.class);
  4. String pkgName = javaModel.getPackageName();
  5. int upToThirdDot = StringUtils.ordinalIndexOf(pkgName, ".", 3);
  6. return StringUtils.substring(pkgName, 0, upToThirdDot);
  7. }
  8. }

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

  1. public String upToThirdDot(final GraphContext context, final Vertex v)
  2. {
  3. JavaClassFileModel javaModel = context.getFramed().frameElement(v, JavaClassFileModel.class);
  4. String pkgName = javaModel.getPackageName();
  5. int upToThirdDot = StringUtils.ordinalIndexOf(pkgName, ".", 3);
  6. return StringUtils.substring(pkgName, 0, upToThirdDot);
  7. }
  8. }

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

  1. @Override
  2. public T frame(Vertex vertex)
  3. {
  4. return getGraphContext().getFramed().frameElement(vertex, this.getType());
  5. }

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

  1. @Override
  2. public T frame(Vertex vertex)
  3. {
  4. return getGraphContext().getFramed().frameElement(vertex, this.getType());
  5. }

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

  1. private String groupByProjectModelFunction(final GraphContext context, final Vertex vertex)
  2. {
  3. JavaSourceFileModel javaModel = context.getFramed().frameElement(vertex, JavaSourceFileModel.class);
  4. // String that identifies 3 properties - projectModel + packageName + className that must be the same for vertices
  5. ProjectModel projectModel = javaModel.getProjectModel();
  6. String projectModelID = projectModel == null ? "" : projectModel.getId().toString();
  7. String packageName = javaModel.getPackageName() == null ? "" : javaModel.getPackageName();
  8. return projectModelID + "_" + packageName + "_" + javaModel.getFileName();
  9. }

代码示例来源:origin: org.jboss.windup.reporting/windup-reporting-impl

  1. TechnologyUsageStatisticsModel stat = graphContext.getFramed().frameElement(vStat, TechnologyUsageStatisticsModel.class);

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

  1. /**
  2. * Adds the specified type to this frame, and returns a new object that implements this type.
  3. */
  4. public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
  5. {
  6. Vertex vertex = frame.getElement();
  7. graphContext.getGraphTypeManager().addTypeToElement(type, vertex);
  8. return graphContext.getFramed().frameElement(vertex, type);
  9. }

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

  1. /**
  2. * Removes the specified type from the frame.
  3. */
  4. public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
  5. {
  6. Vertex vertex = frame.getElement();
  7. graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex);
  8. return graphContext.getFramed().frameElement(vertex, WindupVertexFrame.class);
  9. }

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

  1. /**
  2. * Adds the specified type to this frame, and returns a new object that implements this type.
  3. */
  4. public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
  5. {
  6. Vertex vertex = frame.getElement();
  7. graphContext.getGraphTypeManager().addTypeToElement(type, vertex);
  8. return graphContext.getFramed().frameElement(vertex, type);
  9. }

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

  1. /**
  2. * Removes the specified type from the frame.
  3. */
  4. public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
  5. {
  6. Vertex vertex = frame.getElement();
  7. graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex);
  8. return graphContext.getFramed().frameElement(vertex, WindupVertexFrame.class);
  9. }

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

  1. TechnologyUsageStatisticsModel stat = graphContext.getFramed().frameElement(vStat, TechnologyUsageStatisticsModel.class);

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

  1. private String groupByProjectModelFunction(final GraphContext context, final Vertex vertex)
  2. {
  3. JavaSourceFileModel javaModel = context.getFramed().frameElement(vertex, JavaSourceFileModel.class);
  4. // String that identifies 3 properties - projectModel + packageName + className that must be the same for vertices
  5. ProjectModel projectModel = javaModel.getProjectModel();
  6. String projectModelID = projectModel == null ? "" : projectModel.getId().toString();
  7. String packageName = javaModel.getPackageName() == null ? "" : javaModel.getPackageName();
  8. return projectModelID + "_" + packageName + "_" + javaModel.getFileName();
  9. }

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

  1. @SuppressWarnings("unchecked")
  2. public <T> List<T> findByClass(GraphContext graphContext, String edgeLabel, JavaClassModel javaClassModel, Class<T> typeClass)
  3. {
  4. List<T> result = new ArrayList<>();
  5. graphContext.getGraph().traversal().V()
  6. .has(JavaClassModel.QUALIFIED_NAME, javaClassModel.getQualifiedName())
  7. .has(WindupFrame.TYPE_PROP, JavaClassModel.TYPE)
  8. .in(edgeLabel)
  9. .toList()
  10. .forEach(v -> {
  11. T frame = graphContext.getFramed().frameElement(v, typeClass);
  12. result.add(frame);
  13. });
  14. return result;
  15. }

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

  1. @SuppressWarnings("unchecked")
  2. public <T> List<T> findByClass(GraphContext graphContext, String edgeLabel, JavaClassModel javaClassModel, Class<T> typeClass)
  3. {
  4. List<T> result = new ArrayList<>();
  5. graphContext.getGraph().traversal().V()
  6. .has(JavaClassModel.QUALIFIED_NAME, javaClassModel.getQualifiedName())
  7. .has(WindupFrame.TYPE_PROP, JavaClassModel.TYPE)
  8. .in(edgeLabel)
  9. .toList()
  10. .forEach(v -> {
  11. T frame = graphContext.getFramed().frameElement(v, typeClass);
  12. result.add(frame);
  13. });
  14. return result;
  15. }

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

  1. @SuppressWarnings("unchecked")
  2. public static <T extends WindupVertexFrame> T refresh(GraphContext context, T frame)
  3. {
  4. Vertex v = context.getGraph().traversal().V((Long)frame.getId()).next();
  5. return (T) context.getFramed().frameElement(v, WindupVertexFrame.class);
  6. }

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

  1. @SuppressWarnings("unchecked")
  2. public static <T extends WindupVertexFrame> T refresh(GraphContext context, T frame)
  3. {
  4. Vertex v = context.getGraph().traversal().V((Long)frame.getId()).next();
  5. return (T) context.getFramed().frameElement(v, WindupVertexFrame.class);
  6. }

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

  1. public MavenProjectModel getMavenConfigurationFromResource(XmlFileModel resource)
  2. {
  3. Iterator<Vertex> v = new GraphTraversalSource(this.getGraphContext().getGraph())
  4. .V(resource)
  5. .in("xmlFacet").as("facet")
  6. .has(WindupVertexFrame.TYPE_PROP, GraphTypeManager.getTypeValue(this.getType()))
  7. .select("facet");
  8. if (v.hasNext())
  9. {
  10. return getGraphContext().getFramed().frameElement(v.next(), this.getType());
  11. }
  12. return null;
  13. }

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

  1. public MavenProjectModel getMavenConfigurationFromResource(XmlFileModel resource)
  2. {
  3. Iterator<Vertex> v = new GraphTraversalSource(this.getGraphContext().getGraph())
  4. .V(resource)
  5. .in("xmlFacet").as("facet")
  6. .has(WindupVertexFrame.TYPE_PROP, GraphTypeManager.getTypeValue(this.getType()))
  7. .select("facet");
  8. if (v.hasNext())
  9. {
  10. return getGraphContext().getFramed().frameElement(v.next(), this.getType());
  11. }
  12. return null;
  13. }

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

  1. /**
  2. * Return an {@link Iterable} containing all {@link TechnologyTagModel}s that are directly associated with the provided {@link FileModel}.
  3. */
  4. public Iterable<TechnologyTagModel> findTechnologyTagsForFile(FileModel fileModel)
  5. {
  6. GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(fileModel.getElement());
  7. pipeline.in(TechnologyTagModel.TECH_TAG_TO_FILE_MODEL).has(WindupVertexFrame.TYPE_PROP, TechnologyTagModel.TYPE);
  8. Comparator<TechnologyTagModel> comparator = new DefaultTechnologyTagComparator();
  9. pipeline.order().by((a, b) -> {
  10. TechnologyTagModel aModel = getGraphContext().getFramed().frameElement(a, TechnologyTagModel.class);
  11. TechnologyTagModel bModel = getGraphContext().getFramed().frameElement(b, TechnologyTagModel.class);
  12. return comparator.compare(aModel, bModel);
  13. });
  14. return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), TechnologyTagModel.class);
  15. }

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

  1. /**
  2. * Return an {@link Iterable} containing all {@link TechnologyTagModel}s that are directly associated with the provided {@link FileModel}.
  3. */
  4. public Iterable<TechnologyTagModel> findTechnologyTagsForFile(FileModel fileModel)
  5. {
  6. GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(fileModel.getElement());
  7. pipeline.in(TechnologyTagModel.TECH_TAG_TO_FILE_MODEL).has(WindupVertexFrame.TYPE_PROP, TechnologyTagModel.TYPE);
  8. Comparator<TechnologyTagModel> comparator = new DefaultTechnologyTagComparator();
  9. pipeline.order().by((a, b) -> {
  10. TechnologyTagModel aModel = getGraphContext().getFramed().frameElement(a, TechnologyTagModel.class);
  11. TechnologyTagModel bModel = getGraphContext().getFramed().frameElement(b, TechnologyTagModel.class);
  12. return comparator.compare(aModel, bModel);
  13. });
  14. return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), TechnologyTagModel.class);
  15. }

相关文章