|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.dbtools.DBFieldValues
public class DBFieldValues
DBFieldValues
is a container class for field/column values for
a DBRecord.
Constructor Summary | |
---|---|
DBFieldValues(DBRecordKey rcdKey)
Constructor |
|
DBFieldValues(DBRecordKey rcdKey,
DBFieldValues delegate)
Constructor |
Method Summary | |
---|---|
protected java.lang.Object |
_getFieldValue(java.lang.String fldName,
boolean requiredField)
Gets the value for the specified field name |
protected java.lang.Object |
_getFieldValue(java.lang.String fldName,
boolean requiredField,
boolean rtnDft)
Gets the value for the specified field name |
boolean |
_setFieldValue(DBField fld,
java.lang.Object newVal)
Sets the value for the specified field name |
protected boolean |
_setFieldValue(java.lang.String fldName,
boolean requiredField,
java.lang.Object newVal)
Sets the value for the specified field name |
void |
clearFieldValues()
Clears all field values |
void |
clearFieldValues(DBField[] fldList)
Clears field values |
DBField |
getField(java.lang.String fldName)
Gets the DBField for the specified field name |
java.lang.String |
getFieldName(java.lang.String fldName)
Converts the field name to the proper case |
java.lang.Object |
getFieldValue(java.lang.String fldName)
Gets the value for the specified field name |
java.lang.Object |
getFieldValue(java.lang.String fldName,
boolean rtnDft)
Gets the value for the specified field name |
java.lang.String |
getFieldValueAsString(java.lang.String fldName)
Gets the String representation of the field value |
boolean |
getIgnoreInvalidFields()
Gets the state of reporting invalid field names. |
java.lang.String |
getName()
Gets the name of this instance |
java.lang.Object |
getOptionalFieldValue(java.lang.String fldName)
Gets the value for the specified optional field name |
java.lang.Object |
getOptionalFieldValue(java.lang.String fldName,
boolean rtnDft)
Gets the value for the specified optional field name |
java.lang.String |
getUntranslatedTableName()
Gets the table name for this DBFieldValue instance |
boolean |
hasField(java.lang.String fldName)
Returns true if the specified field name exists in this DBFieldValues instance |
boolean |
hasFieldValue(java.lang.String fldName)
Returns true if a value has been set for the specified field name |
static void |
main(java.lang.String[] argv)
|
void |
setAllFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap)
Sets all field values from the specified value map (all fields required) |
void |
setAllFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap,
boolean setPrimaryKey)
Sets all field values from the specified value map (all fields required) |
void |
setAllFieldValues(java.sql.ResultSet rs)
Sets all field values from the specified ResultSet |
void |
setAllFieldValues(java.sql.ResultSet rs,
boolean setPrimaryKey)
Sets all field values from the specified ResultSet |
void |
setAllFieldValues(java.sql.ResultSet rs,
boolean setPrimaryKey,
DBField[] fldList)
Sets all field values from the specified ResultSet |
boolean |
setFieldValue(java.lang.String fldName,
boolean val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
byte[] val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
DateTime val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
double val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
float val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
int val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
long val)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
java.lang.Object newVal)
Sets the value for the specified field name |
boolean |
setFieldValue(java.lang.String fldName,
java.lang.String val)
Sets the value for the specified field name |
void |
setFieldValues(DBFieldValues fldVals,
boolean setPrimaryKey,
boolean requireAllFields)
Sets the specified field values from the specified ResultSet. |
void |
setFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap,
boolean setPrimaryKey,
boolean requireAllFields)
Sets the specified field values from the specified ResultSet. |
void |
setIgnoreInvalidFields(boolean state)
Sets the state for ignoring invalid field names. |
void |
setName(java.lang.String name)
Sets the name of this instance |
boolean |
setOptionalFieldValue(java.lang.String fldName,
boolean val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
byte[] val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
DateTime val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
double val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
float val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
int val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
long val)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
java.lang.Object newVal)
Sets the value for the specified optional field name |
boolean |
setOptionalFieldValue(java.lang.String fldName,
java.lang.String val)
Sets the value for the specified optional field name |
static void |
setValidateFieldValues(boolean validate)
Sets the global state for validating field values |
java.lang.String |
toString()
Gets a string representation of this instance |
static java.lang.String |
toStringValue(java.lang.Object obj)
Converts the specified object to a String representation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DBFieldValues(DBRecordKey rcdKey)
rcdKey
- The DBRecordKey associated with this field value containerpublic DBFieldValues(DBRecordKey rcdKey, DBFieldValues delegate)
rcdKey
- The DBRecordKey associated with this field value containerMethod Detail |
---|
public static void setValidateFieldValues(boolean validate)
validate
- True to validate, false otherwisepublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of this instancepublic void setIgnoreInvalidFields(boolean state)
state
- True to ignore invalid field names, false to emit errors.public boolean getIgnoreInvalidFields()
public java.lang.String getUntranslatedTableName()
public void clearFieldValues()
public void clearFieldValues(DBField[] fldList)
public DBField getField(java.lang.String fldName)
fldName
- The field name of the DBField to return
protected boolean _setFieldValue(java.lang.String fldName, boolean requiredField, java.lang.Object newVal)
fldName
- The field name to setrequiredField
- True to indicate that this field is required (warnings displayed if field is not found)newVal
- The 'Object' value to set for the field
public boolean _setFieldValue(DBField fld, java.lang.Object newVal)
fld
- The DBField to setnewVal
- The 'Object' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, java.lang.Object newVal)
fldName
- The field name to setnewVal
- The 'Object' value to set for the field
public boolean setFieldValue(java.lang.String fldName, java.lang.Object newVal)
fldName
- The field name to setnewVal
- The 'Object' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, java.lang.String val)
fldName
- The field name to setval
- The 'String' value to set for the field
public boolean setFieldValue(java.lang.String fldName, java.lang.String val)
fldName
- The field name to setval
- The 'String' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, int val)
fldName
- The field name to setval
- The 'int' value to set for the field
public boolean setFieldValue(java.lang.String fldName, int val)
fldName
- The field name to setval
- The 'int' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, long val)
fldName
- The field name to setval
- The 'long' value to set for the field
public boolean setFieldValue(java.lang.String fldName, long val)
fldName
- The field name to setval
- The 'long' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, float val)
fldName
- The field name to setval
- The 'float' value to set for the field
public boolean setFieldValue(java.lang.String fldName, float val)
fldName
- The field name to setval
- The 'float' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, double val)
fldName
- The field name to setval
- The 'double' value to set for the field
public boolean setFieldValue(java.lang.String fldName, double val)
fldName
- The field name to setval
- The 'double' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, boolean val)
fldName
- The field name to setval
- The 'boolean' value to set for the field
public boolean setFieldValue(java.lang.String fldName, boolean val)
fldName
- The field name to setval
- The 'boolean' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, byte[] val)
fldName
- The field name to setval
- The 'byte[]' value to set for the field
public boolean setFieldValue(java.lang.String fldName, byte[] val)
fldName
- The field name to setval
- The 'byte[]' value to set for the field
public boolean setOptionalFieldValue(java.lang.String fldName, DateTime val)
fldName
- The field name to setval
- The 'DateTime' value to set for the field
public boolean setFieldValue(java.lang.String fldName, DateTime val)
fldName
- The field name to setval
- The 'boolean' value to set for the field
public void setAllFieldValues(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- The ResultSet from which field values are retrieved
java.sql.SQLException
- If field does not existpublic void setAllFieldValues(java.sql.ResultSet rs, boolean setPrimaryKey) throws java.sql.SQLException
rs
- The ResultSet from which field values are retrievedsetPrimaryKey
- True to set primay key fields
java.sql.SQLException
- If field does not existpublic void setAllFieldValues(java.sql.ResultSet rs, boolean setPrimaryKey, DBField[] fldList) throws java.sql.SQLException
rs
- The ResultSet from which field values are retrievedsetPrimaryKey
- True to set primay key fields
java.sql.SQLException
- If field does not existpublic void setAllFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap) throws DBException
valMap
- The Field==>Value map
DBException
- If field does not existpublic void setAllFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap, boolean setPrimaryKey) throws DBException
valMap
- The Field==>Value mapsetPrimaryKey
- True if key fields should also be set
DBException
- If field does not existpublic void setFieldValues(java.util.Map<java.lang.String,java.lang.String> valMap, boolean setPrimaryKey, boolean requireAllFields) throws DBException
valMap
- The Field==>Value mapsetPrimaryKey
- True if key fields should also be set
DBException
- If field does not existpublic void setFieldValues(DBFieldValues fldVals, boolean setPrimaryKey, boolean requireAllFields) throws DBException
fldVals
- The Field==>Value mapsetPrimaryKey
- True if primary key fields should also be set
DBException
- If field does not existpublic java.lang.String getFieldName(java.lang.String fldName)
fldName
- The case-insensitive field name
public boolean hasField(java.lang.String fldName)
fldName
- The field name to test
public boolean hasFieldValue(java.lang.String fldName)
fldName
- The field name to test for a set value
protected java.lang.Object _getFieldValue(java.lang.String fldName, boolean requiredField)
fldName
- The field name for the value retrievedrequiredField
- True to indicate that this field is required (warnings displayed if field is not found)
protected java.lang.Object _getFieldValue(java.lang.String fldName, boolean requiredField, boolean rtnDft)
fldName
- The field name for the value retrievedrequiredField
- True to indicate that this field is required (warnings displayed if field is not found)rtnDft
- True to return a default value if a value has not been set
public java.lang.Object getOptionalFieldValue(java.lang.String fldName)
fldName
- The field name for the value retrieved
public java.lang.Object getOptionalFieldValue(java.lang.String fldName, boolean rtnDft)
fldName
- The field name for the value retrieved
public java.lang.Object getFieldValue(java.lang.String fldName)
fldName
- The field name for the value retrieved
public java.lang.Object getFieldValue(java.lang.String fldName, boolean rtnDft)
fldName
- The field name for the value retrievedrtnDft
- True to return a default value if a value has not been set
public java.lang.String getFieldValueAsString(java.lang.String fldName)
fldName
- The field name for the value retrieved
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toStringValue(java.lang.Object obj)
obj
- The Object to converts to a String representation
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |