org.maverickdbms.basic
Class DefaultResolver

java.lang.Object
  extended byorg.maverickdbms.basic.DefaultResolver
All Implemented Interfaces:
Program, Resolver, Variable

public class DefaultResolver
extends java.lang.Object
implements Program, Resolver

Default resolver implemenation. Just trys classpath to find programs


Field Summary
 
Fields inherited from interface org.maverickdbms.basic.Resolver
DEFAULT_REGISTER_FILE_OPENS, DEFAULT_REGISTER_RESOLVER, PROP_REGISTER_FILE_OPENS, PROP_REGISTER_RESOLVER
 
Constructor Summary
DefaultResolver()
           
 
Method Summary
 void createFile(ConstantString type, ConstantString name, int flags, ConstantString[] fields)
          Create the specified file.
 void deleteList(ConstantString name, mvString status)
          Removes the specified list.
 void dropFile(ConstantString type, ConstantString name)
          Removes the specified file.
 Resolver getNextResolver()
          Gets the next resolver in the chain
 Program resolveCommand(ConstantString command)
          Resolve the specified command
 ConstantString resolveFile(Program program, mvString var, ConstantString type, ConstantString name, int flags, mvString status)
          Find and open the specified file.
 ConstantString resolveList(mvString var, mvString count, ConstantString name, mvString status)
          Resolve the specified list
 Program resolveProgram(ConstantString name)
          Resolve the specified program
 ConstantString run(Session session, mvString[] args)
           
 void setNextResolver(Resolver next)
          Sets the next resolver in the chain
 void writeList(ConstantString var, ConstantString record, mvString status)
          Write the specified item as a list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResolver

public DefaultResolver()
Method Detail

createFile

public void createFile(ConstantString type,
                       ConstantString name,
                       int flags,
                       ConstantString[] fields)
                throws mvException
Description copied from interface: Resolver
Create the specified file.

Specified by:
createFile in interface Resolver
Parameters:
type - the type of the file.
name - the name of the file
flags - optional flags
fields - extra arguments needed for file creation
Throws:
mvException

deleteList

public void deleteList(ConstantString name,
                       mvString status)
                throws mvException
Description copied from interface: Resolver
Removes the specified list.

Specified by:
deleteList in interface Resolver
Parameters:
name - the list to remove.
status - the status variable to set on success
Throws:
mvException

dropFile

public void dropFile(ConstantString type,
                     ConstantString name)
              throws mvException
Description copied from interface: Resolver
Removes the specified file.

Specified by:
dropFile in interface Resolver
Parameters:
type - the type of the file.
name - the name of the file.
Throws:
mvException

getNextResolver

public Resolver getNextResolver()
Description copied from interface: Resolver
Gets the next resolver in the chain

Specified by:
getNextResolver in interface Resolver
Returns:
the next resolver or null

resolveFile

public ConstantString resolveFile(Program program,
                                  mvString var,
                                  ConstantString type,
                                  ConstantString name,
                                  int flags,
                                  mvString status)
                           throws mvException
Description copied from interface: Resolver
Find and open the specified file.

Specified by:
resolveFile in interface Resolver
Parameters:
program - the program opening the specified file
type - the type of file to open
name - the name of the file to open
flags - any optional flags
status - the status variable to set on success
Throws:
mvException

resolveCommand

public Program resolveCommand(ConstantString command)
                       throws mvException
Description copied from interface: Resolver
Resolve the specified command

Specified by:
resolveCommand in interface Resolver
Parameters:
command - the command to parse
Returns:
the program representing the parsed command
Throws:
mvException

resolveList

public ConstantString resolveList(mvString var,
                                  mvString count,
                                  ConstantString name,
                                  mvString status)
                           throws mvException
Description copied from interface: Resolver
Resolve the specified list

Specified by:
resolveList in interface Resolver
Parameters:
var - the variable to contain the resulting list
count - the number of elements in the list
name - the name of the list
status - the status variable to set on success
Returns:
whether the list was successfully resolved
Throws:
mvException

resolveProgram

public Program resolveProgram(ConstantString name)
                       throws mvException
Description copied from interface: Resolver
Resolve the specified program

Specified by:
resolveProgram in interface Resolver
Parameters:
name - the name of the program
Returns:
the program
Throws:
mvException

run

public ConstantString run(Session session,
                          mvString[] args)
Specified by:
run in interface Program

setNextResolver

public void setNextResolver(Resolver next)
Description copied from interface: Resolver
Sets the next resolver in the chain

Specified by:
setNextResolver in interface Resolver
Parameters:
next - the next resolver

writeList

public void writeList(ConstantString var,
                      ConstantString record,
                      mvString status)
               throws mvException
Description copied from interface: Resolver
Write the specified item as a list

Specified by:
writeList in interface Resolver
Parameters:
var - the item to write
record - the name to store the list under
status - the status variable to set on success
Throws:
mvException