|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.poem.transaction.Transactioned org.melati.poem.JdbcPersistent org.melati.poem.generated.ValueInfoBase org.melati.poem.ValueInfo org.melati.poem.generated.SettingBase org.melati.poem.Setting
public class Setting
A setting, analageous to a Property.
NOTE While the underlying value is held as a String that is converted to any type.
Melati POEM generated, modified definition of
a Persistent
Setting
object.
Description: A configurable setting for the application.
Field summary for SQL table Setting
| ||
---|---|---|
Name | Type | Description |
id | Integer | The Table Row Object ID |
name | String | A code name for this setting |
value | String | The value of this setting |
Nested Class Summary | |
---|---|
static class |
Setting.SettingTypeMismatchException
Thrown when a Setting 's type does not match the type required. |
static class |
Setting.SettingValidationException
Thrown when a Setting value fails validation. |
Field Summary |
---|
Fields inherited from class org.melati.poem.generated.SettingBase |
---|
id, name, value |
Fields inherited from class org.melati.poem.generated.ValueInfoBase |
---|
description, displayname, height, nullable, precision, rangelimit_string, rangelow_string, renderinfo, scale, size, typefactory, usereditable, width |
Fields inherited from class org.melati.poem.transaction.Transactioned |
---|
valid |
Constructor Summary | |
---|---|
Setting()
Constructor for a Persistent Setting object. |
|
Setting(Integer typefactory,
String name,
String value,
String displayname,
String description)
Constructor with reasonable defaults for a String setting Use SettingTable.create to persist this. |
Method Summary | |
---|---|
Boolean |
getBooleanCooked()
|
Object |
getCooked()
|
Integer |
getIntegerCooked()
|
Object |
getRaw()
|
String |
getStringCooked()
|
Field |
getValueField()
Override the normal field attributes for the Value field, use the attribute values set in this setting. |
void |
postEdit(boolean creating)
Slight overkill, force recreation of value field attributes even if it is the value that has been changed. |
void |
setRaw(Object raw)
Set from a raw value; checking that the value is of the correct type first. |
void |
setValue(String value)
Check that value is of correct type before setting. |
Methods inherited from class org.melati.poem.generated.SettingBase |
---|
getId_unsafe, getId, getIdField, getName_unsafe, getName, getNameField, getPoemDatabaseTables, getSettingTable, getValue_unsafe, getValue, setId_unsafe, setId, setId, setName_unsafe, setName, setValue_unsafe |
Methods inherited from class org.melati.poem.ValueInfo |
---|
fieldAttributesRenamedAs, getRangelimit_stringField, getRangelow_stringField, getType, setRangelimit_string, setRangelow_string, toTypeParameter |
Methods inherited from class org.melati.poem.transaction.Transactioned |
---|
markValid, reset, setTransactionPool, transactionPool, unSee |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Setting()
Persistent
Setting
object.
Description: A configurable setting for the application.
public Setting(Integer typefactory, String name, String value, String displayname, String description)
typefactory
- name
- value
- displayname
- description
- Method Detail |
---|
public void setValue(String value)
Value
value, with checking, for this
Setting
Persistent
.
Field description:
The value of this setting
setValue
in class SettingBase
value
- a validated int
SettingBase.setValue(java.lang.String)
public void setRaw(Object raw)
raw
- the raw to setpublic Object getRaw()
public Object getCooked()
public Integer getIntegerCooked()
public String getStringCooked()
public Boolean getBooleanCooked()
public Field getValueField()
getValueField
in class SettingBase
SettingBase.getValueField()
public void postEdit(boolean creating)
Unlike Persistent.postModify()
and Persistent.postInsert()
this
is not called during write down but can be called by
applications after individual field edits by the user
have been reflected in the instance.
It can be be overridden to enforce data model constraints such as validity of columns relative to other columns. These will be enforced when the admin system is used.
This is a higher level method than Persistent.postModify()
so is less likely to lead to infinite recursion or other
such problems.
Sorry for the lack of signature consistency with the lower level methods but I got tired of having to call my own application specific common method.
postEdit
in interface Persistent
postEdit
in class JdbcPersistent
creating
- Are we in the process of creating a new record?JdbcPersistent.postEdit(boolean)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |