本文整理了Java中com.syncleus.ferma.WrappedFramedGraph.frameElement()
方法的一些代码示例,展示了WrappedFramedGraph.frameElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WrappedFramedGraph.frameElement()
方法的具体详情如下:
包路径:com.syncleus.ferma.WrappedFramedGraph
类名称:WrappedFramedGraph
方法名:frameElement
暂无
代码示例来源:origin: windup/windup
public String upToThirdDot(final GraphContext context, final Vertex v)
{
JavaClassFileModel javaModel = context.getFramed().frameElement(v, JavaClassFileModel.class);
String pkgName = javaModel.getPackageName();
int upToThirdDot = StringUtils.ordinalIndexOf(pkgName, ".", 3);
return StringUtils.substring(pkgName, 0, upToThirdDot);
}
}
代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api
public String upToThirdDot(final GraphContext context, final Vertex v)
{
JavaClassFileModel javaModel = context.getFramed().frameElement(v, JavaClassFileModel.class);
String pkgName = javaModel.getPackageName();
int upToThirdDot = StringUtils.ordinalIndexOf(pkgName, ".", 3);
return StringUtils.substring(pkgName, 0, upToThirdDot);
}
}
代码示例来源:origin: org.jboss.windup.graph/windup-graph-api
@Override
public T frame(Vertex vertex)
{
return getGraphContext().getFramed().frameElement(vertex, this.getType());
}
代码示例来源:origin: windup/windup
@Override
public T frame(Vertex vertex)
{
return getGraphContext().getFramed().frameElement(vertex, this.getType());
}
代码示例来源:origin: windup/windup
private String groupByProjectModelFunction(final GraphContext context, final Vertex vertex)
{
JavaSourceFileModel javaModel = context.getFramed().frameElement(vertex, JavaSourceFileModel.class);
// String that identifies 3 properties - projectModel + packageName + className that must be the same for vertices
ProjectModel projectModel = javaModel.getProjectModel();
String projectModelID = projectModel == null ? "" : projectModel.getId().toString();
String packageName = javaModel.getPackageName() == null ? "" : javaModel.getPackageName();
return projectModelID + "_" + packageName + "_" + javaModel.getFileName();
}
代码示例来源:origin: org.jboss.windup.reporting/windup-reporting-impl
TechnologyUsageStatisticsModel stat = graphContext.getFramed().frameElement(vStat, TechnologyUsageStatisticsModel.class);
代码示例来源:origin: windup/windup
/**
* Adds the specified type to this frame, and returns a new object that implements this type.
*/
public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
{
Vertex vertex = frame.getElement();
graphContext.getGraphTypeManager().addTypeToElement(type, vertex);
return graphContext.getFramed().frameElement(vertex, type);
}
代码示例来源:origin: windup/windup
/**
* Removes the specified type from the frame.
*/
public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
{
Vertex vertex = frame.getElement();
graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex);
return graphContext.getFramed().frameElement(vertex, WindupVertexFrame.class);
}
代码示例来源:origin: org.jboss.windup.graph/windup-graph-api
/**
* Adds the specified type to this frame, and returns a new object that implements this type.
*/
public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
{
Vertex vertex = frame.getElement();
graphContext.getGraphTypeManager().addTypeToElement(type, vertex);
return graphContext.getFramed().frameElement(vertex, type);
}
代码示例来源:origin: org.jboss.windup.graph/windup-graph-api
/**
* Removes the specified type from the frame.
*/
public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
{
Vertex vertex = frame.getElement();
graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex);
return graphContext.getFramed().frameElement(vertex, WindupVertexFrame.class);
}
代码示例来源:origin: windup/windup
TechnologyUsageStatisticsModel stat = graphContext.getFramed().frameElement(vStat, TechnologyUsageStatisticsModel.class);
代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api
private String groupByProjectModelFunction(final GraphContext context, final Vertex vertex)
{
JavaSourceFileModel javaModel = context.getFramed().frameElement(vertex, JavaSourceFileModel.class);
// String that identifies 3 properties - projectModel + packageName + className that must be the same for vertices
ProjectModel projectModel = javaModel.getProjectModel();
String projectModelID = projectModel == null ? "" : projectModel.getId().toString();
String packageName = javaModel.getPackageName() == null ? "" : javaModel.getPackageName();
return projectModelID + "_" + packageName + "_" + javaModel.getFileName();
}
代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-ee
@SuppressWarnings("unchecked")
public <T> List<T> findByClass(GraphContext graphContext, String edgeLabel, JavaClassModel javaClassModel, Class<T> typeClass)
{
List<T> result = new ArrayList<>();
graphContext.getGraph().traversal().V()
.has(JavaClassModel.QUALIFIED_NAME, javaClassModel.getQualifiedName())
.has(WindupFrame.TYPE_PROP, JavaClassModel.TYPE)
.in(edgeLabel)
.toList()
.forEach(v -> {
T frame = graphContext.getFramed().frameElement(v, typeClass);
result.add(frame);
});
return result;
}
代码示例来源:origin: windup/windup
@SuppressWarnings("unchecked")
public <T> List<T> findByClass(GraphContext graphContext, String edgeLabel, JavaClassModel javaClassModel, Class<T> typeClass)
{
List<T> result = new ArrayList<>();
graphContext.getGraph().traversal().V()
.has(JavaClassModel.QUALIFIED_NAME, javaClassModel.getQualifiedName())
.has(WindupFrame.TYPE_PROP, JavaClassModel.TYPE)
.in(edgeLabel)
.toList()
.forEach(v -> {
T frame = graphContext.getFramed().frameElement(v, typeClass);
result.add(frame);
});
return result;
}
代码示例来源:origin: org.jboss.windup.graph/windup-graph-api
@SuppressWarnings("unchecked")
public static <T extends WindupVertexFrame> T refresh(GraphContext context, T frame)
{
Vertex v = context.getGraph().traversal().V((Long)frame.getId()).next();
return (T) context.getFramed().frameElement(v, WindupVertexFrame.class);
}
代码示例来源:origin: windup/windup
@SuppressWarnings("unchecked")
public static <T extends WindupVertexFrame> T refresh(GraphContext context, T frame)
{
Vertex v = context.getGraph().traversal().V((Long)frame.getId()).next();
return (T) context.getFramed().frameElement(v, WindupVertexFrame.class);
}
代码示例来源:origin: windup/windup
public MavenProjectModel getMavenConfigurationFromResource(XmlFileModel resource)
{
Iterator<Vertex> v = new GraphTraversalSource(this.getGraphContext().getGraph())
.V(resource)
.in("xmlFacet").as("facet")
.has(WindupVertexFrame.TYPE_PROP, GraphTypeManager.getTypeValue(this.getType()))
.select("facet");
if (v.hasNext())
{
return getGraphContext().getFramed().frameElement(v.next(), this.getType());
}
return null;
}
代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api
public MavenProjectModel getMavenConfigurationFromResource(XmlFileModel resource)
{
Iterator<Vertex> v = new GraphTraversalSource(this.getGraphContext().getGraph())
.V(resource)
.in("xmlFacet").as("facet")
.has(WindupVertexFrame.TYPE_PROP, GraphTypeManager.getTypeValue(this.getType()))
.select("facet");
if (v.hasNext())
{
return getGraphContext().getFramed().frameElement(v.next(), this.getType());
}
return null;
}
代码示例来源:origin: windup/windup
/**
* Return an {@link Iterable} containing all {@link TechnologyTagModel}s that are directly associated with the provided {@link FileModel}.
*/
public Iterable<TechnologyTagModel> findTechnologyTagsForFile(FileModel fileModel)
{
GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(fileModel.getElement());
pipeline.in(TechnologyTagModel.TECH_TAG_TO_FILE_MODEL).has(WindupVertexFrame.TYPE_PROP, TechnologyTagModel.TYPE);
Comparator<TechnologyTagModel> comparator = new DefaultTechnologyTagComparator();
pipeline.order().by((a, b) -> {
TechnologyTagModel aModel = getGraphContext().getFramed().frameElement(a, TechnologyTagModel.class);
TechnologyTagModel bModel = getGraphContext().getFramed().frameElement(b, TechnologyTagModel.class);
return comparator.compare(aModel, bModel);
});
return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), TechnologyTagModel.class);
}
代码示例来源:origin: org.jboss.windup.reporting/windup-reporting-api
/**
* Return an {@link Iterable} containing all {@link TechnologyTagModel}s that are directly associated with the provided {@link FileModel}.
*/
public Iterable<TechnologyTagModel> findTechnologyTagsForFile(FileModel fileModel)
{
GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(fileModel.getElement());
pipeline.in(TechnologyTagModel.TECH_TAG_TO_FILE_MODEL).has(WindupVertexFrame.TYPE_PROP, TechnologyTagModel.TYPE);
Comparator<TechnologyTagModel> comparator = new DefaultTechnologyTagComparator();
pipeline.order().by((a, b) -> {
TechnologyTagModel aModel = getGraphContext().getFramed().frameElement(a, TechnologyTagModel.class);
TechnologyTagModel bModel = getGraphContext().getFramed().frameElement(b, TechnologyTagModel.class);
return comparator.compare(aModel, bModel);
});
return new FramedVertexIterable<>(getGraphContext().getFramed(), pipeline.toList(), TechnologyTagModel.class);
}
内容来源于网络,如有侵权,请联系作者删除!