|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.inria.ns.reflex.processor.xcl.xml.XMLContext
org.inria.ns.reflex.xml.sax.SAXContext
public class SAXContext
A SAXContext maintains a single DOM branch and sometimes few other nodes ; when a terminal event is fired, its counterpart node is pruned from the branch.
Events are fired as soon as a content is added to an element, except if the content is a whitespace. This allow elements to add/update/remove attributes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.xcl.xml.XMLContext |
---|
XMLContext.Guard |
Field Summary |
---|
Fields inherited from interface org.inria.ns.reflex.xml.XMLListener |
---|
DUMMY_LISTENER |
Constructor Summary | |
---|---|
SAXContext(XMLContext.Guard guard,
SAXFilter filter,
DataSet dataSet)
Create a new SAX context. |
Method Summary | |
---|---|
void |
addXML(Object xml)
Add an XML object to this context (the current node or a list of node). |
boolean |
convertSAXToDOM(XMLReader reader)
Fire SAX events from the given reader. |
static void |
generateEvent(Object item,
SAXFilter filter,
DataSet dataSet)
Generate events while processing an item of the content. |
void |
nodeAppended(Node childNode)
Flush some previously stored events according to the node type. |
void |
setNode(Node node)
Set the current node of this context. |
void |
textUpdated(Text text)
Flush the events if the text is not blank. |
Methods inherited from class org.inria.ns.reflex.processor.xcl.xml.XMLContext |
---|
add, add, addAll, addAll, attributeAdded, attributeValueUpdated, clear, commentUpdated, contains, containsAll, equals, get, getNode, getRootNode, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, newXMLContext, processingInstructionUpdated, remove, remove, removeAll, retainAll, set, setAttributeAsContext, setContainerAsContext, size, subList, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.inria.ns.reflex.xml.XMLListener |
---|
attributeAdded, attributeValueUpdated, commentUpdated, processingInstructionUpdated |
Constructor Detail |
---|
public SAXContext(XMLContext.Guard guard, SAXFilter filter, DataSet dataSet)
guard
- A guard that protects the creation of this context.filter
- The target filterdataSet
- The data set to use.XMLContext.newXMLContext(DataSet)
Method Detail |
---|
public void addXML(Object xml)
If it is a DOM node, it is also set as the current node of this context.
xml
- The content to add (attribute, element, etc).XMLContext.addXML(java.lang.Object)
public void setNode(Node node)
setNode
in class XMLContext
node
- The node.public static void generateEvent(Object item, SAXFilter filter, DataSet dataSet) throws SAXException, ExecutionException
item
- The item to process.
filter
- The consumer of the events.dataSet
- The data set in use when running the content.
SAXException
- When a SAX error occurs.
ExecutionException
- When the content can't be performed.public void nodeAppended(Node childNode)
nodeAppended
in interface XMLListener
childNode
- The child node appended.XMLListener.nodeAppended(org.w3c.dom.Node)
public boolean convertSAXToDOM(XMLReader reader) throws ExecutionException, SAXException
convertSAXToDOM
in interface XMLListener
reader
- The XML source.
false
: the caller must not convert SAX events to DOM nodes.
SAXException
ExecutionException
XMLListener.convertSAXToDOM(org.xml.sax.XMLReader)
public void textUpdated(Text text)
textUpdated
in interface XMLListener
text
- The text to flush.XMLListener.textUpdated(org.w3c.dom.Text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |