XML:DB Lexus

org.xmldb.xupdate.lexus.commands
Class CommandConstants

java.lang.Object
  extended by org.xmldb.xupdate.lexus.commands.CommandConstants

public class CommandConstants
extends java.lang.Object

This class represents all XUpdate commands as Integer values. It returns the Integer for the given String and also the Commandobject for the given Integer.

Version:
$Id: CommandConstants.java,v 1.1 2004/05/30 11:57:43 per_nyfelt Exp $
Author:
SMB

Field Summary
static int ATTRIBUTES
           
static int CHARACTERS
           
static int COMMAND_APPEND
           
static int COMMAND_COUNT
           
static int COMMAND_INSERT_AFTER
           
static int COMMAND_INSERT_BEFORE
           
static int COMMAND_REMOVE
           
static int COMMAND_RENAME
           
static int COMMAND_UPDATE
           
static int COMMAND_VARIABLE
           
static int INSTRUCTION_ATTRIBUTE
           
static int INSTRUCTION_CDATA
           
static int INSTRUCTION_COMMENT
           
static int INSTRUCTION_ELEMENT
           
static int INSTRUCTION_PROCESSING_INSTRUCTION
           
static int INSTRUCTION_TEXT
           
static int INSTRUCTION_VALUE_OF
           
static int ROOT_ELEMENT
           
static TempTree tempTree
           
 
Constructor Summary
CommandConstants()
           
 
Method Summary
 CommandObject commandForID(int id)
          Maps the given integer to a COMMAND object.
 int idForString(java.lang.String localName)
          Maps the given String to a Integer value.
 boolean isInsertOperation(int id)
           
 boolean isInstruction(int id)
           
 void setContextNode(org.w3c.dom.Node node)
          Sets the contextNode which is to be updated and initializes the objects for each XUpdate operation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_ELEMENT

public static final int ROOT_ELEMENT
See Also:
Constant Field Values

COMMAND_COUNT

public static final int COMMAND_COUNT
See Also:
Constant Field Values

COMMAND_REMOVE

public static final int COMMAND_REMOVE
See Also:
Constant Field Values

COMMAND_RENAME

public static final int COMMAND_RENAME
See Also:
Constant Field Values

COMMAND_UPDATE

public static final int COMMAND_UPDATE
See Also:
Constant Field Values

COMMAND_VARIABLE

public static final int COMMAND_VARIABLE
See Also:
Constant Field Values

COMMAND_APPEND

public static final int COMMAND_APPEND
See Also:
Constant Field Values

COMMAND_INSERT_BEFORE

public static final int COMMAND_INSERT_BEFORE
See Also:
Constant Field Values

COMMAND_INSERT_AFTER

public static final int COMMAND_INSERT_AFTER
See Also:
Constant Field Values

INSTRUCTION_ELEMENT

public static final int INSTRUCTION_ELEMENT
See Also:
Constant Field Values

INSTRUCTION_ATTRIBUTE

public static final int INSTRUCTION_ATTRIBUTE
See Also:
Constant Field Values

INSTRUCTION_COMMENT

public static final int INSTRUCTION_COMMENT
See Also:
Constant Field Values

INSTRUCTION_TEXT

public static final int INSTRUCTION_TEXT
See Also:
Constant Field Values

INSTRUCTION_CDATA

public static final int INSTRUCTION_CDATA
See Also:
Constant Field Values

INSTRUCTION_PROCESSING_INSTRUCTION

public static final int INSTRUCTION_PROCESSING_INSTRUCTION
See Also:
Constant Field Values

INSTRUCTION_VALUE_OF

public static final int INSTRUCTION_VALUE_OF
See Also:
Constant Field Values

ATTRIBUTES

public static final int ATTRIBUTES
See Also:
Constant Field Values

CHARACTERS

public static final int CHARACTERS
See Also:
Constant Field Values

tempTree

public static TempTree tempTree
Constructor Detail

CommandConstants

public CommandConstants()
Method Detail

idForString

public int idForString(java.lang.String localName)
Maps the given String to a Integer value.

Parameters:
localName - the name of a XUpdate-command.
Returns:
the Integer value for this String. If there is no such XUpdate command, it returns 0.

commandForID

public CommandObject commandForID(int id)
Maps the given integer to a COMMAND object.

Parameters:
id - the ID for a XUpdate command.
Returns:
the object which performs the XUpdate operation. If there is a no such ID or the given ID stands for an instruction it returns null.

setContextNode

public void setContextNode(org.w3c.dom.Node node)
                    throws java.lang.Exception
Sets the contextNode which is to be updated and initializes the objects for each XUpdate operation.

Parameters:
node - the contextNode which is to be updated.
Throws:
java.lang.IllegalArgumentException - if node is null.
java.lang.Exception

isInsertOperation

public boolean isInsertOperation(int id)
Returns:
true if the given id is an insert operation

isInstruction

public boolean isInstruction(int id)
Returns:
true if the given id is an instruction

XML:DB Lexus

Copyright (c) 2002 The XML:DB Initiative All rights reserved