|
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.EventMap
defines the mapping of XML data into a Siena notification.
Associates attribute names of a Siena notification to rules (see
AttributeRule
). Once rules are defined for an
EventMap
, that EventMap
can be used to
process XML documents or in-memory document representations to
produce event notifications.
Constructor Summary | |
EventMap()
creates an empty map |
Method Summary | |
void |
attachContent(boolean b)
determines whether this EventMap will make the content of the processed document available to subscribers. |
void |
attachXml()
instructs this EventMap to make the content of the processed document available to subscribers. |
void |
exportRules(java.io.OutputStream os)
saves this map onto an output stream. |
AttributeRule |
getRule(java.lang.String attr_name)
returns the mapping rule associated with the given attribute name |
static java.lang.String |
getXmlText(siena.Notification n)
extracts the XML text from a notification produced by an EventMap |
void |
importRules(java.io.InputStream is)
reads a set of rules from the given input stream. |
void |
importRules(java.lang.String filename)
reads a set of rules from the given input file. |
siena.Notification |
makeNotification(java.io.InputStream is)
processes an XML document to produce a Siena notification |
siena.Notification |
makeNotification(org.w3c.dom.Node root)
processes an XML document to produce a Siena notification |
siena.Notification |
makeNotification(java.lang.String filename)
processes an XML document to produce a Siena notification |
void |
putRule(java.lang.String attr_name,
AttributeRule rule)
adds or overwrites a mapping rule for the given attribute name |
AttributeRule |
removeRule(java.lang.String attr_name)
removes the mapping rule for the given attribute name |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventMap()
Method Detail |
public void attachXml()
public void attachContent(boolean b)
public static java.lang.String getXmlText(siena.Notification n)
EventMap
null
is the source
document was not attached to the notification or if
this notification was not generated by an
EventMap
public void exportRules(java.io.OutputStream os) throws java.io.IOException
importRules(java.io.InputStream)
.public void importRules(java.io.InputStream is) throws RuleParseException, java.io.IOException
<S> | ::= ( <rule> ; ) + |
<rule> | ::= <type> <name>
= <path>
[ <multivalue-spec> ]
|
<type> | ::= int | string
| double | bool |
<name> | ::= valid Siena attribute name
(see Siena.Notification) |
<path> | ::= valid Java/C/C++ string literal |
<multivalue-spec> | ::= first | last
| xml
| separator separator |
<separator> | ::= valid Java/C/C++ string literal |
Anything following a pound sign
(#
) up to the first end of line is a
comment.
Example:
#
# this is a set of Sxml rules
#
string name="/person/@name"; # default multivalue=first
int age="/person/@age" first;
string parents="/person/parents/person/@name" separator ", ";
string job="/person/job" xml;
exportRules(OutputStream)
public void importRules(java.lang.String filename) throws RuleParseException, java.io.IOException
importRules(java.io.InputStream)
public void putRule(java.lang.String attr_name, AttributeRule rule)
public AttributeRule removeRule(java.lang.String attr_name)
public AttributeRule getRule(java.lang.String attr_name)
public siena.Notification makeNotification(java.io.InputStream is) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException, EventMapException
public siena.Notification makeNotification(java.lang.String filename) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException, EventMapException
public siena.Notification makeNotification(org.w3c.dom.Node root) throws javax.xml.transform.TransformerException, EventMapException
|
Sxml (v.1.0.2) API documentation | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |