本文整理汇总了Java中org.hawk.core.model.IHawkClass.getPackageNSURI方法的典型用法代码示例。如果您正苦于以下问题:Java IHawkClass.getPackageNSURI方法的具体用法?Java IHawkClass.getPackageNSURI怎么用?Java IHawkClass.getPackageNSURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hawk.core.model.IHawkClass
的用法示例。
在下文中一共展示了IHawkClass.getPackageNSURI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEClassNode
import org.hawk.core.model.IHawkClass; //导入方法依赖的package包/类
public IGraphNode getEClassNode(IGraphDatabase graph, IHawkClassifier e) throws Exception {
IHawkClass eClass = null;
if (e instanceof IHawkClass)
eClass = ((IHawkClass) e);
else
System.err.println("getEClassNode called on a non-class classifier:\n" + e);
IGraphNode classnode = hashedEClasses.get(eClass);
if (classnode == null) {
final String packageNSURI = eClass.getPackageNSURI();
IGraphNode ePackageNode = null;
try {
ePackageNode = graph.getMetamodelIndex().get("id", packageNSURI).getSingle();
} catch (NoSuchElementException ex) {
throw new Exception(String.format(
"Metamodel %s does not have a Node associated with it in the store, please make sure it has been inserted",
packageNSURI));
} catch (Exception e2) {
LOGGER.error("Error while finding metamodel node", e2);
}
for (IGraphEdge r : ePackageNode.getEdges()) {
final IGraphNode otherNode = r.getStartNode();
if (otherNode.equals(ePackageNode)) {
continue;
}
final Object id = otherNode.getProperty(IModelIndexer.IDENTIFIER_PROPERTY);
if (id.equals(eClass.getName())) {
classnode = otherNode;
break;
}
}
if (classnode != null) {
hashedEClasses.put(eClass, classnode);
} else {
throw new Exception(String.format(
"eClass: %s (%s) does not have a Node associated with it in the store, please make sure the metamodel %s has been inserted",
eClass.getName(), eClass.getUri(), packageNSURI));
}
// typeCache properties
Hashtable<String, Object> properties = new Hashtable<>();
for (String s : classnode.getPropertyKeys()) {
Object prop = classnode.getProperty(s);
if (prop instanceof String[])
properties.put(s, prop);
}
hashedEClassProperties.put(classnode, properties);
}
return classnode;
}
示例2: eClassFullNSURI
import org.hawk.core.model.IHawkClass; //导入方法依赖的package包/类
public String eClassFullNSURI(IHawkClass e) {
return e.getPackageNSURI() + "/" + e.getName();
}
示例3: getEObjectId
import org.hawk.core.model.IHawkClass; //导入方法依赖的package包/类
/**
*
* @param eClass
* @return the URI ID of an eClass
*/
public String getEObjectId(IHawkClass eClass) {
return eClass.getPackageNSURI() + "/" + eClass.getName();
}