當前位置: 首頁>>代碼示例>>Java>>正文


Java IHawkClass.getPackageNSURI方法代碼示例

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

}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:58,代碼來源:TypeCache.java

示例2: eClassFullNSURI

import org.hawk.core.model.IHawkClass; //導入方法依賴的package包/類
public String eClassFullNSURI(IHawkClass e) {
	return e.getPackageNSURI() + "/" + e.getName();
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:4,代碼來源:MetamodelUtils.java

示例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();
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:9,代碼來源:GraphMetaModelResourceInjector.java


注:本文中的org.hawk.core.model.IHawkClass.getPackageNSURI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。