当前位置: 首页>>代码示例>>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;未经允许,请勿转载。