当前位置: 首页>>代码示例>>Java>>正文


Java XAttributable类代码示例

本文整理汇总了Java中org.deckfour.xes.model.XAttributable的典型用法代码示例。如果您正苦于以下问题:Java XAttributable类的具体用法?Java XAttributable怎么用?Java XAttributable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XAttributable类属于org.deckfour.xes.model包,在下文中一共展示了XAttributable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decorateElement

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * This method can be used to decorate an {@link XAttributable} element
 * (such as {@link XLog}, {@link XTrace}, and {@link XEvent}) with a string
 * value
 * 
 * @param element the element to decorate
 * @param attributeName the attribute name
 * @param value the attribute value
 * @param extensionName the extension name
 */
public static void decorateElement(XAttributable element, String attributeName, String value, String extensionName) {
	if (element == null) {
		return;
	}
	XAttributeLiteral attribute = xesFactory.createAttributeLiteral(attributeName, value, xesExtensionManager.getByName(extensionName));
	XAttributeMap attributes = element.getAttributes();
	if (attributes == null || attributes.isEmpty()) {
		attributes = xesFactory.createAttributeMap();
	}
	attributes.put(attributeName, attribute);
	element.setAttributes(attributes);
}
 
开发者ID:delas,项目名称:plg,代码行数:23,代码来源:XLogHelper.java

示例2: setTimestamp

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * This method sets the value of the attribute <tt>time:timestamp</tt>
 * for the given attributable element
 * 
 * @param element the element to update
 * @param date the new value of the <tt>time:timestamp</tt> attribute
 */
public static void setTimestamp(XAttributable element, Date date) {
	XAttributeMap am = element.getAttributes();
	am.remove(XTimeExtension.KEY_TIMESTAMP);
	element.setAttributes(am);
	
	decorateElement(element, XTimeExtension.KEY_TIMESTAMP, date);
}
 
开发者ID:delas,项目名称:plg,代码行数:15,代码来源:XLogHelper.java

示例3: registerAttributes

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Registers all attributes of a given attributable, i.e.
 * model type hierarchy element, in the given attribute info registry.
 * 
 * @param attributeInfo Attribute info registry to use for registration.
 * @param attributable Attributable whose attributes to register.
 */
protected void registerAttributes(XAttributeInfoImpl attributeInfo, XAttributable attributable) {
	if (attributable.hasAttributes()) {
		for(XAttribute attribute : attributable.getAttributes().values()) {
			// register attribute in appropriate map
			attributeInfo.register(attribute);
			// register meta-attributes globally
			registerAttributes(metaAttributeInfo, attribute);
		}			
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:18,代码来源:XLogInfoImpl.java

示例4: extractID

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Retrieves the id of a log data hierarchy element, if set by this
 * extension's id attribute.
 * 
 * @param element
 *            Log hierarchy element to extract name from.
 * @return The requested element id.
 */
public XID extractID(XAttributable element) {
	XAttribute attribute = element.getAttributes().get(KEY_ID);
	if (attribute == null) {
		return null;
	} else {
		return ((XAttributeID) attribute).getValue();
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:17,代码来源:XIdentityExtension.java

示例5: extractModelReferences

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Retrieves the list of model references which describe a log element
 * (archive, log, trace, event, attribute).
 * 
 * @param target
 *            Any log element (i.e., archive, log, trace, event, or
 *            attribute) to be queried.
 * @return The list of model references, as a list of strings, referred to
 *         by this element.
 */
public List<String> extractModelReferences(XAttributable target) {
	ArrayList<String> modelReferences = new ArrayList<String>();
	XAttributeLiteral modelReferenceAttribute = (XAttributeLiteral) target
			.getAttributes().get(KEY_MODELREFERENCE);
	if (modelReferenceAttribute != null) {
		String refString = modelReferenceAttribute.getValue().trim();
		for (String reference : refString.split("\\s")) {
			modelReferences.add(reference.trim());
		}
	}
	return modelReferences;
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:23,代码来源:XSemanticExtension.java

示例6: assignModelReferences

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Assigns to a log element (i.e., archive, log, trace, event, or attribute)
 * a list of model references.
 * 
 * @param target
 *            Any log element (i.e., archive, log, trace, event, or
 *            attribute) to be assigned references to.
 * @param modelReferences
 *            The list of model references, as a list of strings, referred
 *            to by this element.
 */
public void assignModelReferences(XAttributable target,
		List<String> modelReferences) {
	StringBuilder sb = new StringBuilder();
	for (String ref : modelReferences) {
		sb.append(ref);
		sb.append(" ");
	}
	if (sb.toString().trim().length() > 0) {
		XAttributeLiteral attr = (XAttributeLiteral) ATTR_MODELREFERENCE
				.clone();
		attr.setValue(sb.toString().trim());
		target.getAttributes().put(KEY_MODELREFERENCE, attr);
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:26,代码来源:XSemanticExtension.java

示例7: assignModelReferenceUris

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Assigns to a log element (i.e., archive, log, trace, event, or attribute)
 * a list of model references.
 * 
 * @param target
 *            Any log element (i.e., archive, log, trace, event, or
 *            attribute) to be assigned references to.
 * @param modelReferenceURIs
 *            The list of model references, as a list of URIs, referred to
 *            by this element.
 */
public void assignModelReferenceUris(XAttributable target,
		List<URI> modelReferenceURIs) {
	StringBuilder sb = new StringBuilder();
	for (URI ref : modelReferenceURIs) {
		sb.append(ref.toString());
		sb.append(" ");
	}
	if (sb.toString().trim().length() > 0) {
		XAttributeLiteral attr = (XAttributeLiteral) ATTR_MODELREFERENCE
				.clone();
		attr.setValue(sb.toString().trim());
		target.getAttributes().put(KEY_MODELREFERENCE, attr);
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:26,代码来源:XSemanticExtension.java

示例8: extractTotalPrivate

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
private Double extractTotalPrivate(XAttributable element) {
	XAttribute attribute = element.getAttributes().get(KEY_TOTAL);
	if (attribute == null) {
		return null;
	} else {
		return ((XAttributeContinuous) attribute).getValue();
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:9,代码来源:XCostExtension.java

示例9: assignTotalPrivate

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
private void assignTotalPrivate(XAttributable element, Double total) {
	if (total != null && total > 0.0) {
		XAttributeContinuous attr = (XAttributeContinuous) ATTR_TOTAL
				.clone();
		attr.setValue(total);
		element.getAttributes().put(KEY_TOTAL, attr);
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:9,代码来源:XCostExtension.java

示例10: extractCurrencyPrivate

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
private String extractCurrencyPrivate(XAttributable element) {
	XAttribute attribute = element.getAttributes().get(KEY_CURRENCY);
	if (attribute == null) {
		return null;
	} else {
		return ((XAttributeLiteral) attribute).getValue();
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:9,代码来源:XCostExtension.java

示例11: assignCurrencyPrivate

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
private void assignCurrencyPrivate(XAttributable element, String currency) {
	if (currency != null && currency.trim().length() > 0) {
		XAttributeLiteral attr = (XAttributeLiteral) ATTR_CURRENCY.clone();
		attr.setValue(currency);
		element.getAttributes().put(KEY_CURRENCY, attr);
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:8,代码来源:XCostExtension.java

示例12: extractName

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Retrieves the name of a log data hierarchy element, if set by this
 * extension's name attribute.
 * 
 * @param element
 *            Log hierarchy element to extract name from.
 * @return The requested element name.
 */
public String extractName(XAttributable element) {
	XAttribute attribute = element.getAttributes().get(KEY_NAME);
	if (attribute == null) {
		return null;
	} else {
		return ((XAttributeLiteral) attribute).getValue();
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:17,代码来源:XConceptExtension.java

示例13: assignNestedValuesPrivate

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
private void assignNestedValuesPrivate(XAttributable element,
		List<String> keys, Type value) {
	if (keys.isEmpty()) {
		/*
		 * Key list is empty. Assign amount here if attribute. Else skip.
		 */
		if (element instanceof XAttribute) {
			assignValue((XAttribute) element, value);
		}
	} else {
		/*
		 * Key list not empty yet. Step down to the next attribute.
		 */
		String key = keys.get(0);
		List<String> keysTail = keys.subList(1, keys.size());
		XAttribute attr;
		if (element.getAttributes().containsKey(key)) {
			/*
			 * Attribute with given key already exists. Use it.
			 */
			attr = element.getAttributes().get(key);
		} else {
			/*
			 * Attribute with given key does not exist yet.
			 */
			attr = XFactoryRegistry.instance().currentDefault()
					.createAttributeLiteral(key, "", null);
			element.getAttributes().put(key, attr);
			/*
			 * Now it does.
			 */
		}
		/*
		 * Step down.
		 */
		assignNestedValuesPrivate(attr, keysTail, value);
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:39,代码来源:XAbstractNestedAttributeSupport.java

示例14: addModelReferences

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
private void addModelReferences(Attributes attrs, XAttributable subject) {
	String refs = attrs.getValue("modelReference");
	if (refs != null) {
		XAttributeLiteral attribute = (XAttributeLiteral)XSemanticExtension.ATTR_MODELREFERENCE.clone();
		attribute.setValue(refs);
		subject.getAttributes().put(attribute.getKey(), attribute);
	} 
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:9,代码来源:XMxmlParser.java

示例15: XesXmlHandler

import org.deckfour.xes.model.XAttributable; //导入依赖的package包/类
/**
 * Creates a new handler instance.
 */
public XesXmlHandler() {
	log = null;
	trace = null;
	event = null;
	attributeStack = new Stack<XAttribute>();
	attributableStack = new Stack<XAttributable>();
	extensions = new HashSet<XExtension>();
	globals = null;
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:13,代码来源:XesXmlParser.java


注:本文中的org.deckfour.xes.model.XAttributable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。