本文整理匯總了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();
}