本文整理匯總了Java中com.syncleus.ferma.annotations.GraphElement類的典型用法代碼示例。如果您正苦於以下問題:Java GraphElement類的具體用法?Java GraphElement怎麽用?Java GraphElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GraphElement類屬於com.syncleus.ferma.annotations包,在下文中一共展示了GraphElement類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: forName
import com.syncleus.ferma.annotations.GraphElement; //導入依賴的package包/類
public Class forName(final String className) {
return this.classStringCache.computeIfAbsent(className, (key) -> {
for (String basePath : basePaths) {
Set<Class<?>> graphTypeClasses = new Reflections(basePath).getTypesAnnotatedWith(GraphElement.class);
for (Class<?> clazz : graphTypeClasses) {
if (clazz.getSimpleName().equals(key)) {
return clazz;
}
}
}
throw new IllegalStateException("The class {" + className + "} cannot be found for basePaths {" + Arrays.toString(basePaths) + "}");
});
}
示例2: SimpleReflectionCache
import com.syncleus.ferma.annotations.GraphElement; //導入依賴的package包/類
public SimpleReflectionCache(String... basePaths) {
this();
for (String basePath : basePaths) {
Set<Class<?>> graphTypeClasses = new Reflections(basePath).getTypesAnnotatedWith(GraphElement.class);
for (Class<?> clazz : graphTypeClasses) {
classStringCache.put(clazz.getSimpleName(), clazz);
}
}
}
示例3: ReflectionCache
import com.syncleus.ferma.annotations.GraphElement; //導入依賴的package包/類
public ReflectionCache(final String modelPackage) {
super(modelPackage);
this.hierarchy = constructHierarchy(this.getTypesAnnotatedWith(GraphElement.class));
}
示例4: getGraphElementClasses
import com.syncleus.ferma.annotations.GraphElement; //導入依賴的package包/類
/**
* Return all found graph element classes.
*
* @return
*/
public Set<Class<?>> getGraphElementClasses() {
Set<Class<?>> graphTypeClasses = new Reflections(basePath).getTypesAnnotatedWith(GraphElement.class);
return graphTypeClasses;
}