|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deckfour.xes.extension.std.XAbstractNestedAttributeSupport<Type>
public abstract class XAbstractNestedAttributeSupport<Type>
This class offers generic support for extracting and assigning values to and from nested attributes.
Constructor Summary | |
---|---|
XAbstractNestedAttributeSupport()
|
Method Summary | |
---|---|
void |
assignNestedValues(XAttributable element,
Map<List<String>,Type> amounts)
Assigns (to the given event) multiple values given their key lists. |
abstract void |
assignValue(XAttribute element,
Type value)
Abstract method to assign a value to an element. |
void |
assignValues(XAttributable element,
Map<String,Type> values)
Assigns (to the given element) multiple values given their keys. |
Map<List<String>,Type> |
extractNestedValues(XAttributable element)
Retrieves a map containing all values for all descending attributes of an element. |
abstract Type |
extractValue(XAttribute element)
Abstract method to extract a value from an element. |
Map<String,Type> |
extractValues(XAttributable element)
Retrieves a map containing all values for all child attributes of an element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XAbstractNestedAttributeSupport()
Method Detail |
---|
public abstract Type extractValue(XAttribute element)
element
- The element to extract the value from.
public abstract void assignValue(XAttribute element, Type value)
element
- The element to assign the value to.value
- The value to be assigned.public Map<String,Type> extractValues(XAttributable element)
<trace>
<string key="key.1" value="">
<float key="ext:attr" value="val.1"/>
<string key="key.1.1" value="">
<float key="ext:attr" value="val.1.1"/>
</string>
<string key="key.1.2" value="">
<float key="ext:attr" value="val.1.2"/>
</string>
</string>
<string key="key.2" value="">
<float key="ext:attr" value="val.2"/>
</string>
<string key="key.3" value="">
<float key="ext:attr" value="val.3"/>
</string>
</trace>
should result into the following:
[[key.1 val.1] [key.2 val.2] [key.3 val.3]]
element
- Element to retrieve all values for.
public Map<List<String>,Type> extractNestedValues(XAttributable element)
<trace>
<string key="key.1" value="">
<float key="ext:attr" value="val.1"/>
<string key="key.1.1" value="">
<float key="ext:attr" value="val.1.1"/>
</string>
<string key="key.1.2" value="">
<float key="ext:attr" value="val.1.2"/>
</string>
</string>
<string key="key.2" value="">
<float key="ext:attr" value="val.2"/>
</string>
<string key="key.3" value="">
<float key="ext:attr" value="val.3"/>
</string>
</trace>
should result into the following:
[[[key.1] val.1] [[key.1 key.1.1] val.1.1] [[key.1 key.1.2] val.1.2] [[key.2] val.2] [[key.3] val.3]]
element
- Element to retrieve all values for.
public void assignValues(XAttributable element, Map<String,Type> values)
assignValues(event, [[key.1 val.1] [key.2 val.2] [key.3 val.3]])should result into the following XES fragment:
<event>
<string key="key.1" value="">
<float key="ext:attr" value="val.1"/>
</string>
<string key="key.2" value="">
<float key="ext:attr" value="val.2"/>
</string>
<string key="key.3" value="">
<float key="ext:attr" value="val.3"/>
</string>
</event>
event
- Event to assign the values to.amounts
- Mapping from keys to values which are to be assigned.public void assignNestedValues(XAttributable element, Map<List<String>,Type> amounts)
assignNestedValues(event, [[[key.1] val.1] [[key.1 key.1.1] val.1.1] [[key.1 key.1.2] val.1.2] [[key.2] val.2] [[key.3] val.3]])should result into the following XES fragment:
<event>
<string key="key.1" value="">
<float key="ext:attr" value="val.1"/>
<string key="key.1.1" value="">
<float key="ext:attr" value="val.1.1"/>
</string>
<string key="key.1.2" value="">
<float key="ext:attr" value="val.1.2"/>
</string>
</string>
<string key="key.2" value="">
<float key="ext:attr" value="val.2"/>
</string>
<string key="key.3" value="">
<float key="ext:attr" value="val.3"/>
</string>
</event>
element
- Element to assign the values to.amounts
- Mapping from key lists to values which are to be assigned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |