|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.exist.Parser
Parser parses a given input document via SAX and stores it to the database. It automatically handles index-creation.
Field Summary | |
protected DBBroker |
broker
|
protected XMLString |
charBuf
|
Collection |
collection
|
protected int |
currentLine
|
protected java.lang.StringBuffer |
currentPath
|
protected DocumentImpl |
document
|
protected java.lang.String |
fileName
|
protected java.lang.String |
ignorePrefix
|
protected boolean |
insideDTD
|
protected int |
level
|
protected org.xml.sax.Locator |
locator
|
protected int |
normalize
|
protected org.xml.sax.XMLReader |
parser
|
protected java.util.Stack |
prefixes
|
protected boolean |
privileged
|
protected ProgressIndicator |
progress
|
protected boolean |
replace
|
protected org.apache.xml.resolver.tools.CatalogResolver |
resolver
|
protected org.w3c.dom.Element |
rootNode
|
static int |
SPARSE_IDENTIFIERS
|
protected java.util.Stack |
stack
|
protected User |
user
|
protected boolean |
validate
|
Constructor Summary | |
Parser(DBBroker broker,
User user,
boolean replace)
Create a new parser using the given database broker and user to store the document. |
|
Parser(DBBroker broker,
User user,
boolean replace,
boolean priv)
Create a new parser using the given database broker and user to store the document. |
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(java.lang.String namespace,
java.lang.String name,
java.lang.String qname)
|
void |
endEntity(java.lang.String name)
|
void |
endPrefixMapping(java.lang.String prefix)
|
void |
error(org.xml.sax.SAXParseException e)
|
void |
fatalError(org.xml.sax.SAXParseException e)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
DocumentImpl |
parse(byte[] data,
java.lang.String xmlFileName)
|
DocumentImpl |
parse(Collection coll,
byte[] data,
java.lang.String xmlFileName)
|
DocumentImpl |
parse(Collection collection,
java.io.File file,
java.lang.String xmlFileName)
Parse and store a document, using the given file and collection. |
DocumentImpl |
parse(Collection coll,
org.xml.sax.InputSource is,
java.lang.String fileName)
Parse and store a document using the given input source and collection. |
DocumentImpl |
parse(Collection coll,
org.w3c.dom.Node node,
java.lang.String xmlFileName)
|
DocumentImpl |
parse(Collection coll,
java.lang.String str,
java.lang.String xmlFileName)
Parse and store a document from the given string and collection. |
DocumentImpl |
parse(java.io.File file,
java.lang.String xmlFileName)
Parse and store a document using the given file. |
DocumentImpl |
parse(org.xml.sax.InputSource src)
Parse and store a document using the given input source. |
DocumentImpl |
parse(java.lang.String str,
java.lang.String xmlFileName)
Parse and store a document from the given string. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Try to resolve external entities. |
void |
scan(org.xml.sax.InputSource src)
Prepare for storing the document. |
void |
scan(org.xml.sax.InputSource src,
java.lang.String xmlFileName)
Prepare for storing the document. |
void |
scan(java.io.InputStream inStream,
java.lang.String xmlFileName)
Prepare for storing the document. |
void |
scan(org.w3c.dom.Node node,
java.lang.String xmlFileName)
Prepare for storing the document. |
void |
setBroker(DBBroker broker)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
setOverwrite(boolean overwrite)
|
void |
setUser(User user)
|
void |
skippedEntity(java.lang.String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
startElement(java.lang.String namespace,
java.lang.String name,
java.lang.String qname,
org.xml.sax.Attributes attributes)
|
void |
startEntity(java.lang.String name)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
DocumentImpl |
store(org.xml.sax.InputSource src)
Actually store the document to the database. |
DocumentImpl |
store(org.w3c.dom.Node node)
Actually store the document to the database. |
void |
warning(org.xml.sax.SAXParseException e)
|
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SPARSE_IDENTIFIERS
public Collection collection
protected DBBroker broker
protected XMLString charBuf
protected int currentLine
protected java.lang.StringBuffer currentPath
protected DocumentImpl document
protected java.lang.String fileName
protected boolean insideDTD
protected boolean validate
protected int level
protected org.xml.sax.Locator locator
protected int normalize
protected org.xml.sax.XMLReader parser
protected java.util.Stack prefixes
protected ProgressIndicator progress
protected boolean replace
protected org.apache.xml.resolver.tools.CatalogResolver resolver
protected org.w3c.dom.Element rootNode
protected java.util.Stack stack
protected User user
protected boolean privileged
protected java.lang.String ignorePrefix
Constructor Detail |
public Parser(DBBroker broker, User user, boolean replace) throws EXistException
broker
- user
- user identityreplace
- replace existing documents?
EXistException
public Parser(DBBroker broker, User user, boolean replace, boolean priv) throws EXistException
broker
- user
- user identityreplace
- replace existing documents?
EXistException
Method Detail |
public void setBroker(DBBroker broker)
public void setOverwrite(boolean overwrite)
public void setUser(User user)
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
public void comment(char[] ch, int start, int length)
comment
in interface org.xml.sax.ext.LexicalHandler
public void endCDATA()
endCDATA
in interface org.xml.sax.ext.LexicalHandler
public void endDTD()
endDTD
in interface org.xml.sax.ext.LexicalHandler
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
public void endElement(java.lang.String namespace, java.lang.String name, java.lang.String qname)
endElement
in interface org.xml.sax.ContentHandler
public void endEntity(java.lang.String name)
endEntity
in interface org.xml.sax.ext.LexicalHandler
public void endPrefixMapping(java.lang.String prefix)
endPrefixMapping
in interface org.xml.sax.ContentHandler
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length)
ignorableWhitespace
in interface org.xml.sax.ContentHandler
public DocumentImpl parse(org.xml.sax.InputSource src) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
src
-
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(Collection coll, org.xml.sax.InputSource is, java.lang.String fileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
coll
- is
- fileName
-
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(java.io.File file, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
file
- xmlFileName
-
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(Collection collection, java.io.File file, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
collection
- file
- xmlFileName
-
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(java.lang.String str, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
str
- xmlFileName
-
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(Collection coll, java.lang.String str, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
coll
- str
- xmlFileName
-
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(byte[] data, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(Collection coll, byte[] data, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public DocumentImpl parse(Collection coll, org.w3c.dom.Node node, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public void processingInstruction(java.lang.String target, java.lang.String data)
processingInstruction
in interface org.xml.sax.ContentHandler
public void scan(java.io.InputStream inStream, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
inStream
- InputStreamxmlFileName
- the name of the document
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public void scan(org.xml.sax.InputSource src) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
src
- Description of the Parameter
org.xml.sax.SAXException
- Description of the Exception
java.io.IOException
- Description of the Exception
PermissionDeniedException
- Description of the Exceptionpublic void scan(org.xml.sax.InputSource src, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
src
- InputSourcexmlFileName
- name of the document
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public void scan(org.w3c.dom.Node node, java.lang.String xmlFileName) throws org.xml.sax.SAXException, java.io.IOException, PermissionDeniedException
xmlFileName
- name of the document
org.xml.sax.SAXException
java.io.IOException
PermissionDeniedException
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
public void skippedEntity(java.lang.String name)
skippedEntity
in interface org.xml.sax.ContentHandler
public void startCDATA()
startCDATA
in interface org.xml.sax.ext.LexicalHandler
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
startDTD
in interface org.xml.sax.ext.LexicalHandler
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
public void startElement(java.lang.String namespace, java.lang.String name, java.lang.String qname, org.xml.sax.Attributes attributes)
startElement
in interface org.xml.sax.ContentHandler
public void startEntity(java.lang.String name)
startEntity
in interface org.xml.sax.ext.LexicalHandler
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
startPrefixMapping
in interface org.xml.sax.ContentHandler
public DocumentImpl store(org.xml.sax.InputSource src) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
- Description of the Exception
java.io.IOException
- Description of the Exceptionpublic DocumentImpl store(org.w3c.dom.Node node) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
- Description of the Exception
java.io.IOException
- Description of the Exceptionpublic void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
resolveEntity
in interface org.xml.sax.EntityResolver
org.xml.sax.SAXException
java.io.IOException
EntityResolver.resolveEntity(java.lang.String, java.lang.String)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |