org.exist
Class Indexer
java.lang.Object
java.util.Observable
org.exist.Indexer
- All Implemented Interfaces:
- ContentHandler, ErrorHandler, LexicalHandler
public class Indexer
- extends Observable
- implements ContentHandler, LexicalHandler, ErrorHandler
Parses a given input document via SAX, stores it to
the database and handles index-creation.
- Author:
- wolf
Constructor Summary |
Indexer(DBBroker broker,
Txn transaction)
Create a new parser using the given database broker and
user to store the document. |
Indexer(DBBroker broker,
Txn transaction,
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(String namespace,
String name,
String qname)
|
void |
endEntity(String name)
|
void |
endPrefixMapping(String prefix)
|
void |
error(SAXParseException e)
|
void |
fatalError(SAXParseException e)
|
int |
getDocSize()
|
DocumentImpl |
getDocument()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
processingInstruction(String target,
String data)
|
void |
setDocument(DocumentImpl doc,
CollectionConfiguration collectionConfig)
Prepare the indexer for parsing a new document. |
void |
setDocumentLocator(Locator locator)
|
void |
setDocumentObject(DocumentImpl doc)
Set the document object to be used by this Indexer. |
void |
setValidating(boolean validate)
|
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String systemId)
|
void |
startElement(String namespace,
String name,
String qname,
Attributes attributes)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
void |
warning(SAXParseException e)
|
ATTR_ID_TYPE
public static final String ATTR_ID_TYPE
- See Also:
- Constant Field Values
ATTR_IDREF_TYPE
public static final String ATTR_IDREF_TYPE
- See Also:
- Constant Field Values
ATTR_IDREFS_TYPE
public static final String ATTR_IDREFS_TYPE
- See Also:
- Constant Field Values
CONFIGURATION_ELEMENT_NAME
public static final String CONFIGURATION_ELEMENT_NAME
- See Also:
- Constant Field Values
CONFIGURATION_INDEX_ELEMENT_NAME
public static final String CONFIGURATION_INDEX_ELEMENT_NAME
- See Also:
- Constant Field Values
SUPPRESS_WHITESPACE_ATTRIBUTE
public static final String SUPPRESS_WHITESPACE_ATTRIBUTE
- See Also:
- Constant Field Values
PRESERVE_WS_MIXED_CONTENT_ATTRIBUTE
public static final String PRESERVE_WS_MIXED_CONTENT_ATTRIBUTE
- See Also:
- Constant Field Values
PROPERTY_INDEXER_CONFIG
public static final String PROPERTY_INDEXER_CONFIG
- See Also:
- Constant Field Values
PROPERTY_SUPPRESS_WHITESPACE
public static final String PROPERTY_SUPPRESS_WHITESPACE
- See Also:
- Constant Field Values
PROPERTY_PRESERVE_WS_MIXED_CONTENT
public static final String PROPERTY_PRESERVE_WS_MIXED_CONTENT
- See Also:
- Constant Field Values
Indexer
public Indexer(DBBroker broker,
Txn transaction)
throws EXistException
- Create a new parser using the given database broker and
user to store the document.
- Parameters:
broker
-
- Throws:
EXistException
Indexer
public Indexer(DBBroker broker,
Txn transaction,
boolean priv)
throws EXistException
- Create a new parser using the given database broker and
user to store the document.
- Parameters:
broker
- The database broker to use.transaction
- The transaction to use for indexingpriv
- used by the security manager to
indicate that it needs privileged
access to the db.
- Throws:
EXistException
setValidating
public void setValidating(boolean validate)
setDocument
public void setDocument(DocumentImpl doc,
CollectionConfiguration collectionConfig)
- Prepare the indexer for parsing a new document. This will
reset the internal state of the Indexer object.
- Parameters:
doc
-
setDocumentObject
public void setDocumentObject(DocumentImpl doc)
- Set the document object to be used by this Indexer. This
method doesn't reset the internal state.
- Parameters:
doc
-
getDocument
public DocumentImpl getDocument()
getDocSize
public int getDocSize()
characters
public void characters(char[] ch,
int start,
int length)
- Specified by:
characters
in interface ContentHandler
comment
public void comment(char[] ch,
int start,
int length)
- Specified by:
comment
in interface LexicalHandler
endCDATA
public void endCDATA()
- Specified by:
endCDATA
in interface LexicalHandler
endDTD
public void endDTD()
- Specified by:
endDTD
in interface LexicalHandler
endDocument
public void endDocument()
- Specified by:
endDocument
in interface ContentHandler
endElement
public void endElement(String namespace,
String name,
String qname)
- Specified by:
endElement
in interface ContentHandler
endEntity
public void endEntity(String name)
- Specified by:
endEntity
in interface LexicalHandler
endPrefixMapping
public void endPrefixMapping(String prefix)
- Specified by:
endPrefixMapping
in interface ContentHandler
error
public void error(SAXParseException e)
throws SAXException
- Specified by:
error
in interface ErrorHandler
- Throws:
SAXException
fatalError
public void fatalError(SAXParseException e)
throws SAXException
- Specified by:
fatalError
in interface ErrorHandler
- Throws:
SAXException
ignorableWhitespace
public void ignorableWhitespace(char[] ch,
int start,
int length)
- Specified by:
ignorableWhitespace
in interface ContentHandler
processingInstruction
public void processingInstruction(String target,
String data)
- Specified by:
processingInstruction
in interface ContentHandler
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interface ContentHandler
skippedEntity
public void skippedEntity(String name)
- Specified by:
skippedEntity
in interface ContentHandler
startCDATA
public void startCDATA()
- Specified by:
startCDATA
in interface LexicalHandler
startDTD
public void startDTD(String name,
String publicId,
String systemId)
- Specified by:
startDTD
in interface LexicalHandler
startDocument
public void startDocument()
- Specified by:
startDocument
in interface ContentHandler
startElement
public void startElement(String namespace,
String name,
String qname,
Attributes attributes)
throws SAXException
- Specified by:
startElement
in interface ContentHandler
- Throws:
SAXException
startEntity
public void startEntity(String name)
- Specified by:
startEntity
in interface LexicalHandler
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
- Specified by:
startPrefixMapping
in interface ContentHandler
warning
public void warning(SAXParseException e)
throws SAXException
- Specified by:
warning
in interface ErrorHandler
- Throws:
SAXException
Copyright (C) Wolfgang Meier. All rights reserved.