|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.core.Proc
org.basex.core.Command
org.basex.core.cmd.ACreate
org.basex.core.cmd.CreateDB
public final class CreateDB
Evaluates the 'create db' command and creates a new database.
Field Summary |
---|
Fields inherited from class org.basex.core.Command |
---|
args, context, in, mprop, out, perf, prop |
Fields inherited from class org.basex.core.Proc |
---|
listen, updating |
Constructor Summary | |
---|---|
CreateDB(java.lang.String name)
Default constructor. |
|
CreateDB(java.lang.String name,
java.lang.String input)
Constructor, specifying an initial database input. |
Method Summary | |
---|---|
void |
build(CmdBuilder 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. |
void |
databases(LockResult lr)
Adds the names of the databases that may be touched by the process. |
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. |
Methods inherited from class org.basex.core.cmd.ACreate |
---|
create, drop, newData, sourceToIO, stoppable, supportsProg |
Methods inherited from class org.basex.core.Command |
---|
close, databases, error, execute, execute, getOption, getOption, info, info, result, run, run, setInput, setInput, toString, updated, updating |
Methods inherited from class org.basex.core.Proc |
---|
abort, checkStop, det, detail, listen, proc, prog, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CreateDB(java.lang.String name)
Command.setInput(InputStream)
.
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)Method Detail |
---|
public void setParser(Parser p)
p
- input parserprotected boolean run()
Command
run
in class Command
public void databases(LockResult lr)
Proc
databases
in class ACreate
lr
- Container for lock result to pass aroundpublic static Data create(java.lang.String name, Parser parser, Context ctx) throws java.io.IOException
name
- name of the databaseparser
- input parserctx
- database context
java.io.IOException
- I/O exceptionpublic static MemData mainMem(Parser parser, Context ctx) throws java.io.IOException
parser
- input parserctx
- database context
java.io.IOException
- I/O exceptionpublic static MemData mainMem(IO source, Context ctx) throws java.io.IOException
source
- document sourcectx
- database context
java.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 context
java.io.IOException
- I/O exceptionpublic void build(CmdBuilder cb)
Command
build
in class Command
cb
- command builder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |