本文整理汇总了Java中org.deckfour.xes.model.XAttributable.setAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java XAttributable.setAttributes方法的具体用法?Java XAttributable.setAttributes怎么用?Java XAttributable.setAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.deckfour.xes.model.XAttributable
的用法示例。
在下文中一共展示了XAttributable.setAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}