org.exist.xupdate
Class XUpdateProcessor

java.lang.Object
  extended by org.exist.xupdate.XUpdateProcessor
All Implemented Interfaces:
ContentHandler, LexicalHandler

public class XUpdateProcessor
extends Object
implements ContentHandler, LexicalHandler

Main class to pre-process an XUpdate request. XUpdateProcessor will parse the request via SAX and compile it into a set of Modification objects as returned by the parse(org.xml.sax.InputSource) method. The modifications can then be executed via Modification.process(org.exist.storage.txn.Txn).

Author:
Wolfgang Meier

Field Summary
static String APPEND
           
static String ATTRIBUTE
           
static String COMMENT
           
static String ELEMENT
           
static String IF
           
static String INSERT_AFTER
           
static String INSERT_BEFORE
           
static String MODIFICATIONS
           
static String PROCESSING_INSTRUCTION
           
static String REMOVE
           
static String RENAME
           
static String REPLACE
           
static String TEXT
           
static String UPDATE
           
static String VALUE_OF
           
static String VARIABLE
           
static String XUPDATE_NS
           
 
Constructor Summary
XUpdateProcessor(DBBroker broker, DocumentSet docs, AccessContext accessCtx)
          Constructor for XUpdateProcessor.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void comment(char[] ch, int start, int length)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(String namespaceURI, String localName, String qName)
           
 void endEntity(String name)
           
 void endPrefixMapping(String prefix)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 Modification[] parse(InputSource is)
          Parse the input source into a set of modifications.
 void processingInstruction(String target, String data)
           
 void reset()
           
 void setBroker(DBBroker broker)
           
 void setDocumentLocator(Locator locator)
           
 void setDocumentSet(DocumentSet docs)
           
 void skippedEntity(String name)
           
 void startCDATA()
           
 void startDocument()
           
 void startDTD(String name, String publicId, String systemId)
           
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
           
 void startEntity(String name)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODIFICATIONS

public static final String MODIFICATIONS
See Also:
Constant Field Values

INSERT_AFTER

public static final String INSERT_AFTER
See Also:
Constant Field Values

INSERT_BEFORE

public static final String INSERT_BEFORE
See Also:
Constant Field Values

REPLACE

public static final String REPLACE
See Also:
Constant Field Values

RENAME

public static final String RENAME
See Also:
Constant Field Values

REMOVE

public static final String REMOVE
See Also:
Constant Field Values

APPEND

public static final String APPEND
See Also:
Constant Field Values

UPDATE

public static final String UPDATE
See Also:
Constant Field Values

COMMENT

public static final String COMMENT
See Also:
Constant Field Values

PROCESSING_INSTRUCTION

public static final String PROCESSING_INSTRUCTION
See Also:
Constant Field Values

TEXT

public static final String TEXT
See Also:
Constant Field Values

ATTRIBUTE

public static final String ATTRIBUTE
See Also:
Constant Field Values

ELEMENT

public static final String ELEMENT
See Also:
Constant Field Values

VALUE_OF

public static final String VALUE_OF
See Also:
Constant Field Values

VARIABLE

public static final String VARIABLE
See Also:
Constant Field Values

IF

public static final String IF
See Also:
Constant Field Values

XUPDATE_NS

public static final String XUPDATE_NS
See Also:
Constant Field Values
Constructor Detail

XUpdateProcessor

public XUpdateProcessor(DBBroker broker,
                        DocumentSet docs,
                        AccessContext accessCtx)
                 throws ParserConfigurationException
Constructor for XUpdateProcessor.

Throws:
ParserConfigurationException
Method Detail

setBroker

public void setBroker(DBBroker broker)

setDocumentSet

public void setDocumentSet(DocumentSet docs)

parse

public Modification[] parse(InputSource is)
                     throws ParserConfigurationException,
                            IOException,
                            SAXException
Parse the input source into a set of modifications.

Parameters:
is -
Returns:
an array of type Modification
Throws:
ParserConfigurationException
IOException
SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.startDocument()

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.endDocument()

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.endPrefixMapping(java.lang.String)

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.characters(char[], int, int)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Throws:
SAXException
See Also:
ContentHandler.skippedEntity(java.lang.String)

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Specified by:
comment in interface LexicalHandler
Throws:
SAXException

endCDATA

public void endCDATA()
              throws SAXException
Specified by:
endCDATA in interface LexicalHandler
Throws:
SAXException

endDTD

public void endDTD()
            throws SAXException
Specified by:
endDTD in interface LexicalHandler
Throws:
SAXException

endEntity

public void endEntity(String name)
               throws SAXException
Specified by:
endEntity in interface LexicalHandler
Throws:
SAXException

startCDATA

public void startCDATA()
                throws SAXException
Specified by:
startCDATA in interface LexicalHandler
Throws:
SAXException

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
              throws SAXException
Specified by:
startDTD in interface LexicalHandler
Throws:
SAXException

startEntity

public void startEntity(String name)
                 throws SAXException
Specified by:
startEntity in interface LexicalHandler
Throws:
SAXException

reset

public void reset()


Copyright (C) Wolfgang Meier. All rights reserved.