net.liftweb.record.Field

trait Field

trait Field[ThisType, OwnerType <: Record[OwnerType]]

 extends OwnedField[OwnerType]


A simple field that can store and retreive a value of a given type


Source: Field.scala(313)

Direct Known Subclasses

NumericField, DateTimeField, PasswordField, EnumField, StringField, KeyField, BooleanField, BinaryField,

 Fields

asJValue.. abstract def asJValue
Encode the field value into a JValue
JValue OwnedField
asJs.. abstract def asJs
Returns the field's value as a valid JavaScript expression
JsExp OwnedField
asString.. def asString
Convert the field to a String [details]
.. usually of the form "displayName=value"
String OwnedField
asXHtml.. abstract def asXHtml NodeSeq OwnedField
canRead_?.. def canRead_?
Can the value of this field be read without obscuring the result?
Boolean OwnedField
canWrite_?.. def canWrite_? Boolean OwnedField
checkCanRead_?.. def checkCanRead_?
If the owner is not in "safe" mode, check the current environment to see if the field can be read
Boolean OwnedField
checkCanWrite_?.. def checkCanWrite_? Boolean OwnedField
defaultValue.. abstract def defaultValue
The default value of the field when a field has no value set and is optional, or a method that must return a value (e [details]
g. value) is used
MyType OwnedField
defaultValueBox.. def defaultValueBox
The default value of the field when no value is set [details]
Must return a Full Box unless optional_? is true
Box[MyType] OwnedField
dirty_?.. def dirty_? Boolean OwnedField
displayName.. def displayName
The display name of the field (by default, the 'internal' name of the field)
String OwnedField
ignoreField_?.. def ignoreField_?
Should the field be ignored by the OR Mapper?
Boolean OwnedField
label.. def label NodeSeq OwnedField
name.. def name
The text name of this field
String OwnedField
noValueErrorMessage.. def noValueErrorMessage
The error message used when the field value could not be set
String OwnedField
notOptionalErrorMessage.. def notOptionalErrorMessage
The error message used when the field value must be set
String OwnedField
optional_?.. def optional_?
Is the value of this field optional (e [details]
g. NULLable)?
Boolean OwnedField
owner.. abstract def owner
Return the owner of this field
OwnerType OwnedField
safe_?.. final def safe_?
Are we in "safe" mode (i [details]
e., the value of the field can be read or written without any security checks.)
Boolean OwnedField
tabIndex.. def tabIndex Int OwnedField
toForm.. abstract def toForm NodeSeq OwnedField
toXHtml.. def toXHtml
Convert the field value to an XHTML representation
NodeSeq OwnedField
uniqueFieldId.. override def uniqueFieldId Box[String] OwnedField
validateField.. def validateField
Validate this field's setting, returning any errors found
List[FieldError] OwnedField
value.. def value MyType OwnedField
valueBox.. def valueBox Box[MyType] OwnedField

 Methods

!=.. final def !=(arg0 : Any) Boolean Any
!=.. final def !=(arg0 : Object) Boolean AnyRef
==.. final def ==(arg0 : Object) Boolean AnyRef
==.. final def ==(arg0 : Any) Boolean Any
apply.. def apply(in : Box[ThisType]) OwnerType
apply.. def apply(in : ThisType) OwnerType
asInstanceOf.. final def asInstanceOf[T0] T0 Any
asJString.. protected def asJString(encode : (MyType) => String)
Helper for implementing asJValue for a conversion to an encoded JString [details]
param
encode - function to transform the field value into a String
JValue OwnedField
boxNodeFuncToFieldError.. protected implicit def boxNodeFuncToFieldError(in : (Box[MyType]) => Box[Node]) (Box[MyType]) => List[FieldError] OwnedField
boxNodeToFieldError.. protected implicit def boxNodeToFieldError(in : Box[Node]) List[FieldError] OwnedField
clear.. def clear
Clear the value of this field
Unit OwnedField
clone.. protected def clone Object AnyRef
dirty_?.. protected def dirty_?(b : Boolean) Unit OwnedField
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
finalize.. protected def finalize Unit AnyRef
genericSetFromAny.. protected final def genericSetFromAny(in : Any)(implicit m : Manifest[MyType])
Generic implementation of setFromAny that implements exactly what the doc for setFromAny specifies, using a Manifest to check types
Box[MyType] OwnedField
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
ne.. final def ne(arg0 : Object) Boolean AnyRef
nodeToFieldError.. protected implicit def nodeToFieldError(node : Node) List[FieldError] OwnedField
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
obscure.. def obscure(in : MyType) Box[MyType] OwnedField
resetDirty.. def resetDirty Unit OwnedField
runFilters.. def runFilters(in : Box[MyType], filter : List[(Box[MyType]) => Box[MyType]]) Box[MyType] OwnedField
runValidation.. protected def runValidation(in : Box[MyType])
Helper function that does validation of a value by using the validators specified for the field
List[FieldError] OwnedField
set.. def set(in : MyType)
Set the value of the field to the given value [details]
Note: Because setting a field can fail (return non-Full), this method will return defaultValue if the field could not be set.
MyType OwnedField
setBox.. def setBox(in : Box[MyType]) Box[MyType] OwnedField
setFilter.. protected def setFilter
A list of functions that transform the value before it is set [details]
The transformations are also applied before the value is used in a query. Typical applications of this are trimming and/or toLowerCase-ing strings
List[(Box[MyType]) => Box[MyType]] OwnedField
setFromAny.. abstract def setFromAny(in : Any)
Set the value of the field from anything [details]
Implementations of this method should accept at least the following (pattern => valueBox) - value: MyType => setBox(Full(value)) - Some(value: MyType) => setBox(Full(value)) - Full(value: MyType) => setBox(Full(value)) - (value: MyType)::_ => setBox(Full(value)) - s: String => setFromString(s) - Some(s: String) => setFromString(s) - Full(s: String) => setFromString(s) - null|None|Empty => setBox(defaultValueBox) - f: Failure => setBox(f) And usually convert the input to a string and uses setFromString as a last resort. Note that setFromAny should _always_ call setBox, even if the conversion fails. This is so that validation properly notes the error. The method genericSetFromAny implements this guideline.
Box[MyType] OwnedField
setFromJString.. protected def setFromJString(jvalue : JValue)(decode : (String) => Box[MyType])
Helper for implementing setFromJValue for a conversion from an encoded JString [details]
param
decode - function to try and transform a String into a field value
Box[MyType] OwnedField
setFromJValue.. abstract def setFromJValue(jvalue : JValue)
Decode the JValue and set the field to the decoded value [details]
Returns Empty or Failure if the value could not be set
Box[MyType] OwnedField
setFromString.. abstract def setFromString(s : String)
Set the value of the field using some kind of type-specific conversion from a String [details]
By convention, if the field is optional_?, then the empty string should be treated as no-value (Empty). Note that setFromString should _always_ call setBox, even if the conversion fails. This is so that validation properly notes the error.
return
- Full(convertedValue) if the conversion succeeds (the field value will be set by side-effect) Empty or Failure if the conversion does not succeed
Box[MyType] OwnedField
set_!.. protected def set_!(in : Box[MyType]) Box[MyType] OwnedField
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. override def toString String OwnedField
validators.. def validators
Return a list of functions that will be subsequently called for validating this field [details]
Each function takes a field-type parameter and returns a Box[Node]. The field values is valid if all validation functions return an Empty Box
List[Function1] OwnedField
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.