public final class CreateDB extends ACreate
| Constructor and Description |
|---|
CreateDB(java.lang.String name)
Default constructor.
|
CreateDB(java.lang.String name,
java.lang.String input)
Constructor, specifying an initial database input.
|
| Modifier and Type | Method and Description |
|---|---|
void |
build(CommandBuilder cb)
Builds a string representation from the command.
|
static Data |
create(IO source,
boolean single,
Context ctx)
Creates a new database if a valid path was specified.
|
static Data |
create(java.lang.String name,
Parser parser,
Context ctx)
Returns a database instance from the specified parser.
|
static MemData |
mainMem(IO source,
Context ctx)
Returns a main memory database instance for the specified input reference.
|
static MemData |
mainMem(Parser parser,
Context ctx)
Returns a main memory database instance from the specified parser.
|
protected boolean |
run()
Executes the command and serializes the result (internal call).
|
void |
setParser(Parser p)
Attaches a parser.
|
cache, create, drop, newData, stoppable, supportsProgclose, error, execute, execute, getOption, getOption, info, info, result, run, setInput, setInput, toString, updated, updatingpublic CreateDB(java.lang.String name)
name - name of databasepublic CreateDB(java.lang.String name,
java.lang.String input)
name - name of databaseinput - input reference (local/remote file or XML string)public void setParser(Parser p)
p - input parserprotected boolean run()
Commandpublic static Data create(java.lang.String name, Parser parser, Context ctx) throws java.io.IOException
name - name of the databaseparser - input parserctx - database contextjava.io.IOException - I/O exceptionpublic static MemData mainMem(Parser parser, Context ctx) throws java.io.IOException
parser - input parserctx - database contextjava.io.IOException - I/O exceptionpublic static MemData mainMem(IO source, Context ctx) throws java.io.IOException
source - document sourcectx - database contextjava.io.IOException - I/O exceptionpublic static Data create(IO source, boolean single, Context ctx) throws java.io.IOException
source - document sourcesingle - expect single documentctx - database contextjava.io.IOException - I/O exceptionpublic void build(CommandBuilder cb)
Command