|
Sxml (v.1.0.2) API documentation | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--siena.sxml.AttributeRule
a rule to assign the value of a specific Siena attribute within an
EventMap.
The value of the Siena attribute in an EventMap is
generated by a set of XML elements within an XML document (nodes
is a document tree), selected by an XPath expression. An
AttributeRule defines the XPath expression, the type
of the Siena attribute, and the method by which a single attribute
value is derived from multiple selected nodes.
Example:
EventMap map = new EventMap();
AttributeRule rule = new AttributeRule();
rule.path = "/person/@name";
rule.type = AttributeValue.BYTEARRAY;
rule.multivalue = AttributeRule.SEPARATOR;
rule.separator = ",";
map.putRule("names", rule);
| Field Summary | |
static int |
FIRST_ONLY
the value is derived from the first selected node |
static int |
LAST_ONLY
the value is derived from the last selected node |
int |
multivalue
encoding of values from multiple selected nodes. |
java.lang.String |
path
selects the nodes that will produce the value of this Siena attribute. |
java.lang.String |
separator
separator for encoding multiple values in a single string this value is ignored if multivalue != SEPARATOR. |
static int |
SEPARATOR
the value is derived from all the selected CDATA nodes by concatenation |
int |
type
Siena type identifier. |
static int |
XML
the value is derived from the XML representation of all the selected ELEMENT nodes |
| Constructor Summary | |
AttributeRule()
|
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int FIRST_ONLY
public static final int LAST_ONLY
public static final int SEPARATOR
public static final int XML
public java.lang.String path
public int type
siena.AttributeValue.BYTEARRAY,
siena.AttributeValue.LONG,
siena.AttributeValue.DOUBLE, etc. Please,
consult the Siena Java API documentation for more information.public int multivalue
FIRST_ONLY: the value is that
of the first element;
LAST_ONLY: the value is that
of the last element;
SEPARATOR: the value is
obtained by catenating the value of each selected node,
with a given separator. The given path must select
CDATA nodes.
XML: the value is obtained by
catenating all the XML representation of each node. The
given * path must select Element nodes.
public java.lang.String separator
multivalue != SEPARATOR.| Constructor Detail |
public AttributeRule()
|
Sxml (v.1.0.2) API documentation | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||