public class BooleanDBField extends DBField implements boolean_field
BooleanDBField is a subclass of DBField for the storage and
handling of boolean fields in the DBStore on the Ganymede
server.
The Ganymede client talks to BooleanDBFields through the boolean_field RMI
interface.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
falseStr |
static java.lang.String |
trueStr |
(package private) static TranslationService |
ts
TranslationService object for handling string localization in the
Ganymede server.
|
fieldcode, fieldCount, owner, valueBOOLEAN, DATE, FIELDOPTIONS, FIRSTFIELD, FLOAT, INVID, IP, LASTFIELD, NUMERIC, PASSWORD, PERMISSIONMATRIX, STRING| Constructor and Description |
|---|
BooleanDBField(DBObject owner,
BooleanDBField field)
Copy constructor.
|
BooleanDBField(DBObject owner,
boolean value,
DBObjectBaseField definition)
Scalar value constructor.
|
BooleanDBField(DBObject owner,
java.io.DataInput in,
DBObjectBaseField definition)
Receive constructor.
|
BooleanDBField(DBObject owner,
DBObjectBaseField definition)
No-value constructor.
|
BooleanDBField(DBObject owner,
java.util.Vector values,
DBObjectBaseField definition)
Vector value constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
(package private) void |
emit(java.io.DataOutput out)
This method is responsible for writing out the contents of
this field to an binary output stream.
|
(package private) void |
emitXML(XMLDumpContext xmlOut)
This method is used when the database is being dumped, to write
out this field to disk.
|
java.lang.String |
falseLabel()
Returns the false label if this field is defined to have the true/false
values associated with labels.
|
java.lang.String |
getDiffString(DBField orig)
Returns a String representing the change in value between this
field and orig.
|
java.lang.String |
getEncodingString()
The normal boolean getValueString() encoding is adequate.
|
java.lang.String |
getValueString()
This method returns a text encoded value for this BooleanDBField
without checking permissions.
|
boolean |
isDefined()
Returns true if this field has a value associated
with it, or false if it is an unfilled 'placeholder'.
|
boolean |
labeled()
Returns true if this field is defined to have the true/false
values associated with labels.
|
(package private) void |
receive(java.io.DataInput in,
DBObjectBaseField definition)
This method is responsible for reading in the contents of
this field from an binary input stream.
|
java.lang.String |
trueLabel()
Returns the true label if this field is defined to have the true/false
values associated with labels.
|
boolean |
value() |
boolean |
value(int index) |
ReturnVal |
verifyNewValue(java.lang.Object o)
Overridable method to verify that an object submitted to this
field has an appropriate value.
|
boolean |
verifyTypeMatch(java.lang.Object o)
Overridable method to determine whether an
Object submitted to this field is of an appropriate
type.
|
addElement, addElement, addElement, addElementLocal, addElements, addElements, addElements, addElements, addElementsLocal, addElementsLocal, checkpoint, cleanup, compareTo, containsElement, containsElement, containsElementLocal, copyField, copyFieldTo, createTypedField, deleteAllElements, deleteElement, deleteElement, deleteElement, deleteElement, deleteElement, deleteElement, deleteElementLocal, deleteElementLocal, deleteElements, deleteElements, deleteElements, deleteElementsLocal, equals, getComment, getConflictDialog, getCopy, getDBSession, getDuplicateValueDialog, getDuplicateValuesDialog, getElement, getElementLocal, getFieldDef, getFieldDef, getFieldDef, getFieldInfo, getFieldTemplate, getGSession, getID, getMaxArraySize, getName, getNameSpace, getObject, getObjTypeID, getOwner, getSession, getType, getTypeDesc, getValue, getValueLocal, getValues, getValuesLocal, getVectorDiff, getVectVal, getXMLName, hasChanged, hasChanged, hashCode, indexOfValue, isBuiltIn, isEditable, isEditable, isEditInPlace, isVector, isVisible, key, key, mark, mark, matches, matches, readField, rescanThisField, rollback, setElement, setElement, setElement, setElementLocal, setUndefined, setValue, setValue, setValue, setValueLocal, setValueLocal, size, toString, unmark, unmark, validateContents, verifyBasicConstraints, verifyReadPermission, verifyReadPermission, verifyWritePermissionfinalize, getClass, notify, notifyAll, wait, wait, waitaddElement, addElements, containsElement, deleteAllElements, deleteElement, deleteElement, deleteElements, getComment, getElement, getFieldInfo, getFieldTemplate, getID, getName, getType, getTypeDesc, getValue, getValues, isBuiltIn, isEditable, isEditInPlace, isVector, isVisible, setElement, setValue, sizestatic final TranslationService ts
public static final java.lang.String trueStr
public static final java.lang.String falseStr
BooleanDBField(DBObject owner, java.io.DataInput in, DBObjectBaseField definition) throws java.io.IOException
java.io.IOExceptionBooleanDBField(DBObject owner, DBObjectBaseField definition)
No-value constructor. Allows the construction of a
'non-initialized' field, for use where the DBObjectBase definition
indicates that a given field may be present, but for which no
value has been stored in the DBStore.
Used to provide the client a template for 'creating' this field if so desired.
public BooleanDBField(DBObject owner, BooleanDBField field)
public BooleanDBField(DBObject owner, boolean value, DBObjectBaseField definition)
public BooleanDBField(DBObject owner, java.util.Vector values, DBObjectBaseField definition)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionvoid emit(java.io.DataOutput out)
throws java.io.IOException
DBFieldThis method is responsible for writing out the contents of this field to an binary output stream. It is used in writing fields to the ganymede.db file and to the journal file.
This method only writes out the value contents of this field.
The DBObject
emit()
method is responsible for writing out the field identifier information
ahead of the field's contents.
void receive(java.io.DataInput in,
DBObjectBaseField definition)
throws java.io.IOException
DBFieldThis method is responsible for reading in the contents of this field from an binary input stream. It is used in reading fields from the ganymede.db file and from the journal file.
The code that calls receive() on this field is responsible for having read enough of the binary input stream's context to place the read cursor at the point in the file immediately after the field's id and type information has been read.
void emitXML(XMLDumpContext xmlOut) throws java.io.IOException
This method is used when the database is being dumped, to write out this field to disk.
public boolean isDefined()
public boolean value()
public boolean value(int index)
public java.lang.String getValueString()
This method returns a text encoded value for this BooleanDBField without checking permissions.
This method avoids checking permissions because it is used on
the server side only and because it is involved in the getLabel() logic
for DBObject.
If this method checked permissions and the getPerm() method failed for some reason and tried to report the failure using object.getLabel(), as it does at present, the server could get into an infinite loop.
getValueString in class DBFieldpublic java.lang.String getEncodingString()
getEncodingString in class DBFielddb_fieldpublic java.lang.String getDiffString(DBField orig)
Returns a String representing the change in value between this field and orig. This String is intended for logging and email, not for any sort of programmatic activity. The format of the generated string is not defined, but is intended to be suitable for inclusion in a log entry and in an email message.
If there is no change in the field, null will be returned.
getDiffString in class DBFieldpublic boolean labeled()
labeled in interface boolean_fieldboolean_fieldpublic java.lang.String trueLabel()
trueLabel in interface boolean_fieldboolean_fieldpublic java.lang.String falseLabel()
falseLabel in interface boolean_fieldboolean_fieldpublic boolean verifyTypeMatch(java.lang.Object o)
DBFieldverifyTypeMatch in class DBFieldpublic ReturnVal verifyNewValue(java.lang.Object o)
DBFieldOverridable method to verify that an object submitted to this field has an appropriate value.
This method is intended to make the final go/no go decision about whether a given value is appropriate to be placed in this field, by whatever means (vector add, vector replacement, scalar replacement).
This method is expected to call the
DBEditObject.verifyNewValue(arlut.csd.ganymede.server.DBField,java.lang.Object)
method on DBEditObject in order to allow custom
plugin classes to deny any given value that the plugin might not
care for, for whatever reason. Otherwise, the go/no-go decision
will be made based on the checks performed by
verifyBasicConstraints.
The ReturnVal that is returned may have transformedValue set, in which case the code that calls this verifyNewValue() method should consider transformedValue as replacing the 'o' parameter as the value that verifyNewValue wants to be put into this field. This usage of transformedValue is for canonicalizing input data.
verifyNewValue in class DBField