net.liftweb.util

BindHelpers

trait BindHelpers extends AnyRef

Helpers assocated with bindings

go to: companion
linear super types: AnyRef, Any
known subclasses: Helpers, BindHelpers, CometActor, StatefulComet, CometListener, CometListenee, CometActorJ, CometActorJWithCometListener, AsyncRenderComet
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. BindHelpers
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All
Impl.
  1. Concrete
  2. Abstract

Type Members

  1. class AttrBindParam extends BindParam with BindWithAttr

    BindParam that binds a given value into a new attribute.

  2. trait BindParam extends AnyRef

    Base class for Bind parameters.

  3. class BindParamAssoc extends AnyRef

    This class creates a BindParam from an input value

  4. trait BindWithAttr extends AnyRef

    A trait that indicates what the newly bound attribute name should be.

  5. class BooleanBindParam extends (String, Boolean) with BindParam

    attributes: final
  6. class BoxBindParam extends (String, Box[NodeSeq]) with BindParam

    attributes: final
  7. class FuncAttrBindParam extends BindParam with BindWithAttr

    BindParam that computes a new attribute value based on the current attribute value.

  8. class FuncAttrBoxBindParam extends BindParam with BindWithAttr

    BindParam that computes an optional new attribute value based on the current attribute value.

  9. class FuncAttrOptionBindParam extends BindParam with BindWithAttr

    BindParam that computes an optional new attribute value based on the current attribute value.

  10. class FuncBindParam extends (String, (NodeSeq) ⇒ NodeSeq) with BindParam

    BindParam using a function to calculate its value

  11. class IntBindParam extends (String, Int) with BindParam

    attributes: final
  12. class LongBindParam extends (String, Long) with BindParam

    attributes: final
  13. class OptionBindParam extends (String, Option[NodeSeq]) with BindParam

    attributes: final
  14. case class PrefixedBindWithAttr (prefix: String, binding: BindParam with BindWithAttr) extends BindParam with BindWithAttr with Product

    A case class that wraps attribute-oriented BindParams to allow prefixing the resulting attribute

  15. class SuperArrowAssoc extends AnyRef

  16. class SymbolBindParam extends (String, Symbol) with BindParam

    attributes: final
  17. class TheBindParam extends (String, NodeSeq) with BindParam

    Constant BindParam always returning the same value

  18. class TheBindableBindParam [T <: Bindable] extends (String, T) with BindParam

    attributes: final
  19. class TheStrBindParam extends (String, String) with BindParam

    Constant BindParam always returning the same value

Value Members

  1. def != (arg0: AnyRef) : Boolean

    attributes: final
    definition classes: AnyRef
  2. def != (arg0: Any) : Boolean

    o != arg0 is the same as !(o == (arg0)).

    o != arg0 is the same as !(o == (arg0)).

    arg0

    the object to compare against this object for dis-equality.

    returns

    false if the receiver object is equivalent to the argument; true otherwise.

    attributes: final
    definition classes: Any
  3. def ## () : Int

    attributes: final
    definition classes: AnyRef → Any
  4. def $asInstanceOf [T0] () : T0

    attributes: final
    definition classes: AnyRef
  5. def $isInstanceOf [T0] () : Boolean

    attributes: final
    definition classes: AnyRef
  6. def == (arg0: AnyRef) : Boolean

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: AnyRef
  7. def == (arg0: Any) : Boolean

    o == arg0 is the same as o.equals(arg0).

    o == arg0 is the same as o.equals(arg0).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: Any
  8. object AttrBindParam extends AnyRef

    BindParam that binds a given value into a new attribute.

  9. object BindParamAssoc extends AnyRef

    transforms a Box into a Text node

  10. object BooleanBindParam extends AnyRef

  11. object BoxBindParam extends AnyRef

  12. object FuncAttrBindParam extends AnyRef

    BindParam using a function to calculate its value.

  13. object FuncAttrBoxBindParam extends AnyRef

    BindParam that computes an optional new attribute value based on the current attribute value.

  14. object FuncAttrOptionBindParam extends AnyRef

    BindParam that computes an optional new attribute value based on the current attribute value.

  15. object FuncBindParam extends AnyRef

  16. object IntBindParam extends AnyRef

  17. object LongBindParam extends AnyRef

  18. object OptionBindParam extends AnyRef

  19. object SymbolBindParam extends AnyRef

  20. object TheBindParam extends AnyRef

  21. object TheBindableBindParam extends AnyRef

  22. object TheStrBindParam extends AnyRef

  23. def addAttributes (in: NodeSeq, attributes: MetaData) : NodeSeq

    takes a NodeSeq and applies all the attributes to all the Elems at the top level of the NodeSeq.

    takes a NodeSeq and applies all the attributes to all the Elems at the top level of the NodeSeq. The id attribute is applied to the first-found Elem only

  24. def addCssClass (cssClass: String, elem: Elem) : Elem

    Adds a css class to the existing class tag of an Elem or create the class attribute

    Adds a css class to the existing class tag of an Elem or create the class attribute

  25. def addCssClass (cssClass: Box[String], elem: Elem) : Elem

    Adds a css class to the existing class tag of an Elem or create the class attribute

    Adds a css class to the existing class tag of an Elem or create the class attribute

  26. def asInstanceOf [T0] : T0

    This method is used to cast the receiver object to be of type T0.

    This method is used to cast the receiver object to be of type T0.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expressionList(1).asInstanceOf[List[String]] will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    the receiver object.

    attributes: final
    definition classes: Any
  27. def bind (vals: Map[String, NodeSeq], xml: NodeSeq) : NodeSeq

    Replace the content of lift:bind nodes with the corresponding nodes found in a map, according to the value of the "name" attribute.

    Replace the content of lift:bind nodes with the corresponding nodes found in a map, according to the value of the "name" attribute.

    Usage:

      bind(Map("a" ->

    ), <lift:bind name

    )

    vals

    map of name/nodes to replace

    xml

    nodes containing lift:bind nodes

    returns

    the NodeSeq that results from the specified transforms

  28. def bind (namespace: String, nodeFailureXform: Box[(NodeSeq) ⇒ NodeSeq], paramFailureXform: Box[(PrefixedAttribute) ⇒ MetaData], preserveScope: Boolean, xml: NodeSeq, params: BindParam*) : NodeSeq

    Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.

    Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.

    For example:

      bind("user",
           Full(xhtml: NodeSeq => Text("Default Value")),
           Empty,
           <user:hello>replace this</user:hello><user:dflt>replace with default</user:dflt>,
           "hello" ->

    )

    will return

    Default Value

    namespace

    the namespace of tags to bind

    nodeFailureXform

    a box containing the function to use as the default transform for tags in the specified namespace that do not have bindings specified.

    paramFailureXform

    a box containing the function to use as the default transform for unrecognized attributes in bound elements.

    xml

    the NodeSeq in which to find elements to be bound.

    params

    the list of BindParam bindings to be applied

    returns

    the NodeSeq that results from the specified transforms

  29. def bind (namespace: String, nodeFailureXform: Box[(NodeSeq) ⇒ NodeSeq], paramFailureXform: Box[(PrefixedAttribute) ⇒ MetaData], xml: NodeSeq, params: BindParam*) : NodeSeq

    Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.

    Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.

    For example:

      bind("user",
           Full(xhtml: NodeSeq => Text("Default Value")),
           Empty,
           <user:hello>replace this</user:hello><user:dflt>replace with default</user:dflt>,
           "hello" ->

    )

    will return

    Default Value

    namespace

    the namespace of tags to bind

    nodeFailureXform

    a box containing the function to use as the default transform for tags in the specified namespace that do not have bindings specified.

    paramFailureXform

    a box containing the function to use as the default transform for unrecognized attributes in bound elements.

    xml

    the NodeSeq in which to find elements to be bound.

    params

    the list of BindParam bindings to be applied

    returns

    the NodeSeq that results from the specified transforms

  30. def bind (namespace: String, xml: NodeSeq, params: BindParam*) : NodeSeq

    Bind a set of values to parameters and attributes in a block of XML.

    Bind a set of values to parameters and attributes in a block of XML.

    For example:

      bind("user", <user:hello>replace this</user:hello>, "hello" ->

    )

    will return

    namespace

    the namespace of tags to bind

    xml

    the NodeSeq in which to find elements to be bound.

    params

    the list of BindParam bindings to be applied

    returns

    the NodeSeq that results from the specified transforms

  31. def bindlist (listvals: List[Map[String, NodeSeq]], xml: NodeSeq) : Box[NodeSeq]

    Bind a list of name/xml maps to a block of XML containing lift:bind nodes (see the bind(Map, NodeSeq) function)

    Bind a list of name/xml maps to a block of XML containing lift:bind nodes (see the bind(Map, NodeSeq) function)

    returns

    the NodeSeq that results from the specified transforms

  32. def chooseTemplate (prefix: String, tag: String, xhtml: NodeSeq) : NodeSeq

    Finds and returns one of many templates from the children based upon the namespace and tag name: for example, for prefix "choose" and tag name "stuff" this would return the contents of the first tag <choose:stuff> ... </choose:stuff>in the specified NodeSeq.

    Finds and returns one of many templates from the children based upon the namespace and tag name: for example, for prefix "choose" and tag name "stuff" this would return the contents of the first tag <choose:stuff> ... </choose:stuff>in the specified NodeSeq.

    prefix

    the prefix (e.g., "choose")

    tag

    the tag to choose (e.g., "stuff")

    xhtml

    the node sequence to search for the specified element

    returns

    the first matching node sequence

  33. def clone () : AnyRef

    This method creates and returns a copy of the receiver object.

    This method creates and returns a copy of the receiver object.

    The default implementation of the clone method is platform dependent.

    returns

    a copy of the receiver object.

    attributes: protected
    definition classes: AnyRef
  34. implicit def cssSelectorToCssBindPromoter (sel: CssSelector) : ToCssBindPromoter

    promote a String to a ToCssBindPromotor

    promote a String to a ToCssBindPromotor

    attributes: implicit
  35. def deepEnsureUniqueId (in: NodeSeq) : NodeSeq

    For a list of NodeSeq, ensure that the the id of the root Elems are unique.

    For a list of NodeSeq, ensure that the the id of the root Elems are unique. If there's a duplicate, that Elem will be returned without an id

  36. def ensureId (ns: NodeSeq, id: String) : NodeSeq

    Ensure that the first Element has the specified ID

    Ensure that the first Element has the specified ID

  37. def ensureUniqueId (in: Seq[NodeSeq]) : Seq[NodeSeq]

    For a list of NodeSeq, ensure that the the id of the root Elems are unique.

    For a list of NodeSeq, ensure that the the id of the root Elems are unique. If there's a duplicate, that Elem will be returned without an id

  38. def eq (arg0: AnyRef) : Boolean

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    The eq method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on non-null instances of AnyRef: * It is reflexive: for any non-null instance x of type AnyRef, x.eq(x) returns true. * It is symmetric: for any non-null instances x and y of type AnyRef, x.eq(y) returns true if and only if y.eq(x) returns true. * It is transitive: for any non-null instances x, y, and z of type AnyRef if x.eq(y) returns true and y.eq(z) returns true, then x.eq(z) returns true.

    Additionally, the eq method has three other properties. * It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of x.eq(y) consistently returns true or consistently returns false. * For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false. * null.eq(null) returns true.

    When overriding the equals or hashCode methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2), they should be equal to each other (o1 == o2) and they should hash to the same value (o1.hashCode == o2.hashCode).

    arg0

    the object to compare against this object for reference equality.

    returns

    true if the argument is a reference to the receiver object; false otherwise.

    attributes: final
    definition classes: AnyRef
  39. def equals (arg0: Any) : Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]: * It is reflexive: for any instance x of type Any, x.equals(x) should return true. * It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true. * It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same scala.Int (o1.hashCode.equals(o2.hashCode)).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef → Any
  40. def errorDiv (body: NodeSeq) : Box[NodeSeq]

  41. def finalize () : Unit

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    The details of when and if the finalize method are invoked, as well as the interaction between finalizeand non-local returns and exceptions, are all platform dependent.

    attributes: protected
    definition classes: AnyRef
  42. def findBox [T] (nodes: Seq[Node])(f: (Elem) ⇒ Box[T]) : Box[T]

    Given a NodeSeq and a function that returns a Box[T], return the first value found in which the function evaluates to Full

    Given a NodeSeq and a function that returns a Box[T], return the first value found in which the function evaluates to Full

  43. def findId (ns: NodeSeq) : Box[String]

    Finds the first Element in the NodeSeq (or any children) that has an ID attribute

    Finds the first Element in the NodeSeq (or any children) that has an ID attribute

  44. def findId (nodes: Seq[Node], id: String) : Option[Elem]

    Given an id value, find the Elem with the specified id

    Given an id value, find the Elem with the specified id

  45. def findNode (in: Elem, nodes: NodeSeq) : Box[Elem]

    Finds and returns the first node in the specified NodeSeq and its children with the same label and prefix as the specified element.

    Finds and returns the first node in the specified NodeSeq and its children with the same label and prefix as the specified element.

  46. def findOption [T] (nodes: Seq[Node])(f: (Elem) ⇒ Option[T]) : Option[T]

    Given a NodeSeq and a function that returns an Option[T], return the first value found in which the function evaluates to Some

    Given a NodeSeq and a function that returns an Option[T], return the first value found in which the function evaluates to Some

  47. def findOrCreateId (f: (String) ⇒ (NodeSeq) ⇒ NodeSeq) : (NodeSeq) ⇒ NodeSeq

    Find the first Elem in the NodeSeq.

    Find the first Elem in the NodeSeq. If it has an id attribute, then call the function, f, with that id. If the first Elem does not have an id attribute, create an id attribute and pass that id attribute to the function

  48. def getClass () : java.lang.Class[_]

    Returns a representation that corresponds to the dynamic class of the receiver object.

    Returns a representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

    a representation that corresponds to the dynamic class of the receiver object.

    attributes: final
    definition classes: AnyRef
  49. def hashCode () : Int

    Returns a hash code value for the object.

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    returns

    the hash code value for the object.

    definition classes: AnyRef → Any
  50. def isInstanceOf [T0] : Boolean

    This method is used to test whether the dynamic type of the receiver object is T0.

    This method is used to test whether the dynamic type of the receiver object is T0.

    Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will return true. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    true if the receiver object is an instance of erasure of type T0; false otherwise.

    attributes: final
    definition classes: Any
  51. def mixinAttributes (out: Elem)(in: NodeSeq) : NodeSeq

    Takes attributes from the first node of 'in' (if any) and mixes them into 'out'.

    Takes attributes from the first node of 'in' (if any) and mixes them into 'out'. Curried form can be used to produce a NodeSeq => NodeSeq for bind.

    out

    where to put the attributes

    in

    where to take the attributes from

    returns

    'out' element with attributes from 'in'

  52. def ne (arg0: AnyRef) : Boolean

    o.ne(arg0) is the same as !(o.eq(arg0)).

    o.ne(arg0) is the same as !(o.eq(arg0)).

    arg0

    the object to compare against this object for reference dis-equality.

    returns

    false if the argument is not a reference to the receiver object; true otherwise.

    attributes: final
    definition classes: AnyRef
  53. def notify () : Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Wakes up a single thread that is waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef
  54. def notifyAll () : Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

    Wakes up all threads that are waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef
  55. def processBind (around: NodeSeq, atWhat: Map[String, NodeSeq]) : NodeSeq

    Bind parameters to XML.

    Bind parameters to XML.

    around

    XML with lift:bind elements

    atWhat

    data to bind

      deprecated:
    1. use the bind function instead

  56. def replaceIdNode (in: NodeSeq, id: String, replacement: NodeSeq) : NodeSeq

    Replace the element with the id that matches with the replacement nodeseq.

    Replace the element with the id that matches with the replacement nodeseq.

  57. implicit def strToBPAssoc (in: String) : BindParamAssoc

    transforms a String to a BindParamAssoc object which can be associated to a BindParam object using the --> operator.

    transforms a String to a BindParamAssoc object which can be associated to a BindParam object using the --> operator.

    Usage: "David" --> "name"

    attributes: implicit
      deprecated:
    1. use -> instead

  58. implicit def strToCssBindPromoter (str: String) : ToCssBindPromoter

    promote a String to a ToCssBindPromotor

    promote a String to a ToCssBindPromotor

    attributes: implicit
  59. implicit def strToSuperArrowAssoc (in: String) : SuperArrowAssoc

    attributes: implicit
  60. def stripHead (in: NodeSeq) : NodeSeq

    Remove all the <head> tags, just leaving the child tags

    Remove all the <head> tags, just leaving the child tags

  61. implicit def symToBPAssoc (in: Symbol) : BindParamAssoc

    transforms a Symbol to a BindParamAssoc object which can be associated to a BindParam object using the --> operator.

    transforms a Symbol to a BindParamAssoc object which can be associated to a BindParam object using the --> operator.

    Usage: 'David --> "name"

    attributes: implicit
      deprecated:
    1. use -> instead

  62. def synchronized [T0] (arg0: T0) : T0

    attributes: final
    definition classes: AnyRef
  63. def template (xhtml: NodeSeq, prefix: String, tag1: String, tag2: String, tag3: String) : Box[(NodeSeq, NodeSeq, NodeSeq)]

    Find three of many templates from the children

    Find three of many templates from the children

  64. def template (xhtml: NodeSeq, prefix: String, tag1: String, tag2: String) : Box[(NodeSeq, NodeSeq)]

    Find two of many templates from the children

    Find two of many templates from the children

  65. def template (xhtml: NodeSeq, prefix: String, tag: String) : Box[NodeSeq]

    Similar to chooseTemplate, this returns the contents of the element in a Full Box if found or an Empty Box otherwise.

    Similar to chooseTemplate, this returns the contents of the element in a Full Box if found or an Empty Box otherwise.

  66. def toString () : String

    Returns a string representation of the object.

    Returns a string representation of the object.

    The default representation is platform dependent.

    returns

    a string representation of the object.

    definition classes: AnyRef → Any
  67. def wait () : Unit

    attributes: final
    definition classes: AnyRef
  68. def wait (arg0: Long, arg1: Int) : Unit

    attributes: final
    definition classes: AnyRef
  69. def wait (arg0: Long) : Unit

    attributes: final
    definition classes: AnyRef
  70. def xbind (namespace: String, xml: NodeSeq)(transform: PartialFunction[String, (NodeSeq) ⇒ NodeSeq]) : NodeSeq

    Experimental extension to bind which passes in an additional "parameter" from the XHTML to the transform function, which can be used to format the returned NodeSeq.

    Experimental extension to bind which passes in an additional "parameter" from the XHTML to the transform function, which can be used to format the returned NodeSeq.

      deprecated:
    1. use bind instead

  71. def xmlParam (in: NodeSeq, param: String) : Box[String]

    Finds the named attribute in specified XML element and returns a Full Box containing the value of the attribute if found.

    Finds the named attribute in specified XML element and returns a Full Box containing the value of the attribute if found. Empty otherwise.

    returns

    a Full Box containing the value of the attribute if found; Empty otherwise

Inherited from AnyRef

Inherited from Any