org.inria.ns.reflex.xml
Interface XMLListener

All Known Implementing Classes:
DOMContext, SAXContext, XMLContext

public interface XMLListener

An XMLListener can react when XML nodes are updated.

Author:
Philippe Poulard

Field Summary
static XMLListener DUMMY_LISTENER
          A deaf listener that does nothing.
 
Method Summary
 void attributeAdded(Attr attr)
          Invoked when an attribute has been added to an element.
 void attributeValueUpdated(Attr attr)
          Invoked when an attribute value has been updated.
 void commentUpdated(Comment comment)
          Invoked when a comment has been updated.
 boolean convertSAXToDOM(XMLReader reader)
          Indicates whether SAX events must be converted to a DOM node.
 void nodeAppended(Node childNode)
          Invoked when a node has been appended.
 void processingInstructionUpdated(ProcessingInstruction processingInstruction)
          Invoked when a processing instruction value has been updated.
 void textUpdated(Text text)
          Invoked when a text value has been updated.
 

Field Detail

DUMMY_LISTENER

static final XMLListener DUMMY_LISTENER
A deaf listener that does nothing.

It indicates to convert SAX events to DOM nodes.

Method Detail

attributeAdded

void attributeAdded(Attr attr)
Invoked when an attribute has been added to an element.

Parameters:
attr - The added attribute.

nodeAppended

void nodeAppended(Node childNode)
Invoked when a node has been appended.

Parameters:
childNode - The node appended.

convertSAXToDOM

boolean convertSAXToDOM(XMLReader reader)
                        throws ExecutionException,
                               SAXException
Indicates whether SAX events must be converted to a DOM node.

The DOM conversion is on the responsibility of the caller.

If no conversion have to be applied, this listener should process the reader itself.

Parameters:
reader - The reader that this listener can process in an other manner than converting it to a DOM node.
Returns:
true if the reader must be converted to a DOM node by the caller, false if the listener must process itself the reader.
Throws:
SAXException - When the input document can't be parsed.
ExecutionException

attributeValueUpdated

void attributeValueUpdated(Attr attr)
Invoked when an attribute value has been updated.

Parameters:
attr - The attribute which value has changed.

commentUpdated

void commentUpdated(Comment comment)
Invoked when a comment has been updated.

Parameters:
comment - The comment which value has changed.

processingInstructionUpdated

void processingInstructionUpdated(ProcessingInstruction processingInstruction)
Invoked when a processing instruction value has been updated.

Parameters:
processingInstruction - The processing instruction which value has changed.

textUpdated

void textUpdated(Text text)
Invoked when a text value has been updated.

Parameters:
text - The text which value has changed.