arlut.csd.ganymede
Class xmlfield

java.lang.Object
  |
  +--arlut.csd.ganymede.xmlfield
All Implemented Interfaces:
FieldType

public class xmlfield
extends java.lang.Object
implements FieldType

This class is a data holding structure that is intended to hold object and field data for an XML object element for xmlclient. This class is also responsible for actually registering its data on the server on demand.


Field Summary
(package private) static java.lang.String ADD
          constant string for the add mode
(package private) static java.lang.String ADDIFNOTPRESENT
          constant string for the addIfNotPresent mode
(package private)  java.util.Vector addIfNotPresentValues
           
(package private)  java.util.Vector addValues
           
(package private) static boolean debug
           
(package private) static java.lang.String DELETE
          constant string for the delete mode
(package private)  java.util.Vector delValues
           
(package private)  arlut.csd.ganymede.FieldTemplate fieldDef
          Definition record for this field type
(package private) static java.text.DateFormat[] formatters
          Formatter that we use for generating and parsing date fields
(package private)  arlut.csd.ganymede.xmlobject owner
          The xmlobject that contains us.
(package private)  boolean registered
           
(package private) static java.lang.String SET
          constant string for the set mode
(package private)  java.util.Vector setValues
           
(package private)  java.lang.Object value
           
 
Fields inherited from interface arlut.csd.ganymede.FieldType
BOOLEAN, DATE, FIRSTFIELD, FLOAT, INVID, IP, LASTFIELD, NUMERIC, PASSWORD, PERMISSIONMATRIX, STRING
 
Constructor Summary
xmlfield(arlut.csd.ganymede.xmlobject owner, arlut.csd.Util.XMLElement openElement)
           
 
Method Summary
private  java.util.Vector getExtantInvids(java.util.Vector values)
          This private helper method takes a Vector of xInvid and xmlobject objects (in the embedded object case) and returns a Vector of Invid objects.
private  java.util.Vector getExtantObjects(java.util.Vector values)
          This private helper method takes a Vector of xInvid and xmlobject objects (in the embedded object case) and returns a Vector of xmlobjects that exist on the server.
 java.lang.String getName()
          Returns the non-XML-encoded name of this field.
private  java.util.Vector getNonRegisteredObjects(java.util.Vector values)
          This private helper method takes a Vector of xInvid and xmlobject objects and returns a Vector of xInvids and xmlobjects that could not be resolved on the server.
 java.lang.Boolean parseBoolean(arlut.csd.Util.XMLItem item)
           
 java.util.Date parseDate(arlut.csd.Util.XMLItem item)
           
 java.lang.Double parseFloat(arlut.csd.Util.XMLItem item)
           
 java.lang.String parseIP(arlut.csd.Util.XMLItem item)
           
 java.lang.Integer parseNumeric(arlut.csd.Util.XMLItem item)
           
 java.lang.String parseStringVecItem(arlut.csd.Util.XMLItem item)
           
private  void processVectorElements(arlut.csd.Util.XMLElement openElement)
          This method is called to process a set of values for the various kinds of vector fields.
 arlut.csd.ganymede.ReturnVal registerOnServer()
          This method is responsible for propagating this field's data values to the server.
private  void skipToEndField(java.lang.String elementName)
          This private helper method works through the XML file until the close element tag that terminates this field definition is found.
 java.lang.String toString()
          Debug diagnostics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

static final boolean debug
See Also:
Constant Field Values

formatters

static java.text.DateFormat[] formatters

Formatter that we use for generating and parsing date fields


ADDIFNOTPRESENT

static final java.lang.String ADDIFNOTPRESENT

constant string for the addIfNotPresent mode

See Also:
Constant Field Values

ADD

static final java.lang.String ADD

constant string for the add mode

See Also:
Constant Field Values

SET

static final java.lang.String SET

constant string for the set mode

See Also:
Constant Field Values

DELETE

static final java.lang.String DELETE

constant string for the delete mode

See Also:
Constant Field Values

fieldDef

arlut.csd.ganymede.FieldTemplate fieldDef

Definition record for this field type


owner

arlut.csd.ganymede.xmlobject owner

The xmlobject that contains us.


value

java.lang.Object value

setValues

java.util.Vector setValues

delValues

java.util.Vector delValues

addValues

java.util.Vector addValues

addIfNotPresentValues

java.util.Vector addIfNotPresentValues

registered

boolean registered
Constructor Detail

xmlfield

public xmlfield(arlut.csd.ganymede.xmlobject owner,
                arlut.csd.Util.XMLElement openElement)
         throws org.xml.sax.SAXException
Method Detail

processVectorElements

private void processVectorElements(arlut.csd.Util.XMLElement openElement)
                            throws org.xml.sax.SAXException

This method is called to process a set of values for the various kinds of vector fields. This method consumes all XMLItems up to and including the field termination item.

org.xml.sax.SAXException

skipToEndField

private void skipToEndField(java.lang.String elementName)
                     throws org.xml.sax.SAXException

This private helper method works through the XML file until the close element tag that terminates this field definition is found.

org.xml.sax.SAXException

parseBoolean

public java.lang.Boolean parseBoolean(arlut.csd.Util.XMLItem item)
                               throws org.xml.sax.SAXException
org.xml.sax.SAXException

parseNumeric

public java.lang.Integer parseNumeric(arlut.csd.Util.XMLItem item)
                               throws org.xml.sax.SAXException
org.xml.sax.SAXException

parseDate

public java.util.Date parseDate(arlut.csd.Util.XMLItem item)
                         throws org.xml.sax.SAXException
org.xml.sax.SAXException

parseStringVecItem

public java.lang.String parseStringVecItem(arlut.csd.Util.XMLItem item)
                                    throws org.xml.sax.SAXException
org.xml.sax.SAXException

parseIP

public java.lang.String parseIP(arlut.csd.Util.XMLItem item)
                         throws org.xml.sax.SAXException
org.xml.sax.SAXException

parseFloat

public java.lang.Double parseFloat(arlut.csd.Util.XMLItem item)
                            throws org.xml.sax.SAXException
org.xml.sax.SAXException

registerOnServer

public arlut.csd.ganymede.ReturnVal registerOnServer()

This method is responsible for propagating this field's data values to the server.

Returns a ReturnVal indicating the result of the server operation. This result may be null on success, or it may be an encoded success or failure message in the normal arlut.csd.ganymede.ReturnVal way.

This method will throw an exception if the xmlobject that contains this xmlfield has not established a remote db_object reference to the server through which the editing can be performed.


getExtantInvids

private java.util.Vector getExtantInvids(java.util.Vector values)

This private helper method takes a Vector of xInvid and xmlobject objects (in the embedded object case) and returns a Vector of Invid objects. If any xmlobjects in the input Vector did not map to pre-existing objects on the server, then no invid will be returned for those elements, and as a result, the returned vector may be smaller than the input.


getExtantObjects

private java.util.Vector getExtantObjects(java.util.Vector values)

This private helper method takes a Vector of xInvid and xmlobject objects (in the embedded object case) and returns a Vector of xmlobjects that exist on the server. Any xInvid objects in the input Vector, along with any xmlobject objects which do not correspond to pre-existing objects on the server will be omitted from the returned vector.


getNonRegisteredObjects

private java.util.Vector getNonRegisteredObjects(java.util.Vector values)

This private helper method takes a Vector of xInvid and xmlobject objects and returns a Vector of xInvids and xmlobjects that could not be resolved on the server.


getName

public java.lang.String getName()

Returns the non-XML-encoded name of this field.


toString

public java.lang.String toString()

Debug diagnostics

Overrides:
toString in class java.lang.Object