public abstract class Parser extends Proc
Modifier and Type | Field and Description |
---|---|
protected Atts |
atts
Attributes of currently parsed element.
|
protected Atts |
nsp
Namespaces of currently parsed element.
|
protected MainOptions |
options
Main options.
|
IO |
source
Source document or
null . |
Modifier | Constructor and Description |
---|---|
protected |
Parser(IO source,
MainOptions options)
Constructor.
|
protected |
Parser(String source,
MainOptions options)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the parser.
|
static Parser |
emptyParser(MainOptions options)
Returns a parser instance for creating empty databases.
|
String |
info()
Returns parser information.
|
abstract void |
parse(Builder build)
Parses all nodes and sends events to the specified builder.
|
static SingleParser |
singleParser(IO source,
MainOptions options,
String target)
Returns a parser instance, based on the current options.
|
Parser |
target(String path)
Sets the target path.
|
static SAXWrapper |
xmlParser(IO source)
Returns an XML parser instance, using the Java default parser.
|
abort, checkStop, databases, det, detail, listen, proc, prog, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title
public IO source
null
.protected final Atts atts
protected final Atts nsp
protected final MainOptions options
protected Parser(String source, MainOptions options)
source
- document source or null
options
- main optionsprotected Parser(IO source, MainOptions options)
source
- document source or null
options
- main optionspublic abstract void parse(Builder build) throws IOException
build
- database builderIOException
- I/O exceptionpublic void close() throws IOException
IOException
- I/O exceptionpublic String info()
public Parser target(String path)
path
- target pathpublic static Parser emptyParser(MainOptions options)
options
- database optionspublic static SAXWrapper xmlParser(IO source)
source
- input sourcepublic static SingleParser singleParser(IO source, MainOptions options, String target) throws IOException
source
- input sourceoptions
- database optionstarget
- relative path referenceIOException
- I/O exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.