BindParam that binds a given value into a new attribute.
Base class for Bind parameters.
This class creates a BindParam from an input value
A trait that indicates what the newly bound attribute name should be.
This decorator class adds a ternary operator to a Boolean value
This class adds the setXXX methods to the Calendar class.
This class adds a noTime method the Date class, in order to get at Date object starting at 00:00
BindParam that computes a new attribute value based on the current attribute value.
BindParam that computes an optional new attribute value based on the current attribute value.
BindParam that computes an optional new attribute value based on the current attribute value.
BindParam using a function to calculate its value
This class add a case insensitive get to a List of Pairs of String, as if it was a Map
A case class that wraps attribute-oriented BindParams to allow prefixing the resulting attribute
Add utility methods to Lists
Constant BindParam always returning the same value
Constant BindParam always returning the same value
The TimeSpan class represents an amount of time.
class building TimeSpans given an amount (len) and a method specify the time unit
o != arg0
is the same as !(o == (arg0))
.
o != arg0
is the same as !(o == (arg0))
.
the object to compare against this object for dis-equality.
false
if the receiver object is equivalent to the argument; true
otherwise.
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)
.
the object to compare against this object for equality.
true
if the receiver object is equivalent to the argument; false
otherwise.
o == arg0
is the same as o.equals(arg0)
.
o == arg0
is the same as o.equals(arg0)
.
the object to compare against this object for equality.
true
if the receiver object is equivalent to the argument; false
otherwise.
A helpful Boolean extractor
A helpful Int extractor
A helpful Int extractor
A helpful Long extractor
BindParam that binds a given value into a new attribute.
transforms a Box into a Text node
BindParam using a function to calculate its value.
BindParam that computes an optional new attribute value based on the current attribute value.
BindParam that computes an optional new attribute value based on the current attribute value.
The TimeSpan object provides class represents an amount of time.
This operator transforms its arguments into a List
This operator transforms its arguments into a List
the list of arguments passed as varargs
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
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
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
Given a URL and a Lift function String, append the function even if the URL has query params and a #
Given a URL and a Lift function String, append the function even if the URL has query params and a #
Append parameters to a URL
Append parameters to a URL
the url to append the params to
the parameters (name/value) to append to the URL
the url with the parameters appended
Given a list of query parameters, append them to the URL taking into account # and if there are any other query parameters
Given a list of query parameters, append them to the URL taking into account # and if there are any other query parameters
A helper that will convert the String to a Boolean if it's t, true, yes, 1, f, false, no, or 0
A helper that will convert the String to a Boolean if it's t, true, yes, 1, f, false, no, or 0
Safely convert the specified String to an Int.
Safely convert the specified String to an Int.
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.
the receiver object.
Safely convert the specified String to an Int.
Safely convert the specified String to an Int.
Convert any object to an "equivalent" Long depending on its value
Convert any object to an "equivalent" Long depending on its value
Safely convert the specified String to a Long.
Safely convert the specified String to a Long.
decode a String in Base 64
decode a String in Base 64
encode a Byte array in Base 64
encode a Byte array in Base 64
encode a Byte array in Base 64 in a way that's safe for use in URLs
encode a Byte array in Base 64 in a way that's safe for use in URLs
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
)
map of name/nodes to replace
nodes containing lift:bind nodes
the NodeSeq that results from the specified transforms
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
the namespace of tags to bind
a box containing the function to use as the default transform for tags in the specified namespace that do not have bindings specified.
a box containing the function to use as the default transform for unrecognized attributes in bound elements.
the NodeSeq in which to find elements to be bound.
the list of BindParam bindings to be applied
the NodeSeq that results from the specified transforms
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
the namespace of tags to bind
a box containing the function to use as the default transform for tags in the specified namespace that do not have bindings specified.
a box containing the function to use as the default transform for unrecognized attributes in bound elements.
the NodeSeq in which to find elements to be bound.
the list of BindParam bindings to be applied
the NodeSeq that results from the specified transforms
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)
the namespace of tags to bind
the NodeSeq in which to find elements to be bound.
the list of BindParam bindings to be applied
the NodeSeq that results from the specified transforms
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)
the NodeSeq that results from the specified transforms
Allows an implicit transform from a Boolean to a Boolean2, allowing expressions such as:(1 == 2) ? "a" | "b"
(This expression will return "b")
Allows an implicit transform from a Boolean to a Boolean2, allowing expressions such as:(1 == 2) ? "a" | "b"
(This expression will return "b")
the predicate to be tested by the ternary operator.
a date from a string using the internet format. Return the Epoch date if the parse is unsuccesfull
the time taken to evaluate f in millis and the result
true if the method is public and has no parameters
Use StringHelpers.camelify
Use StringHelpers.camelifyMethod
Turns a string of format "foo_bar" into camel case "FooBar"
Turns a string of format "foo_bar" into camel case "FooBar"
Functional code courtesy of Jamie Webb (j@jmawebb.cjb.net) 2006/11/28
the String to CamelCase
the CamelCased string
Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names.
Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names.
the String to CamelCase
the CamelCased string
Capitalize every "word" in the string.
Capitalize every "word" in the string. A word is either separated by spaces or underscores.
string to capify
the capified string
Faster than roboSplit.
Faster than roboSplit... this method splits Strings at a given character
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.
the prefix (e.g., "choose")
the tag to choose (e.g., "stuff")
the node sequence to search for the specified element
the first matching node sequence
Check that the method 'name' is callable for class 'clz'
Check that the method 'name' is callable for class 'clz'
the class supposed to own the method
name of the method to test
true if the method exists on the class and is callable
Remove all the characters from a string exception a-z, A-Z, 0-9, and '_'
Remove all the characters from a string exception a-z, A-Z, 0-9, and '_'
the cleaned string and an empty string if the input is null
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.
a copy of the receiver object.
Add commas before the last 3 characters
Add commas before the last 3 characters
the string with commas
Is the clz an instance of (assignable from) any of the classes in the list
Is the clz an instance of (assignable from) any of the classes in the list
the class to test
the list of classes to match against
true if clz is assignable from any of the matching classes
Given a map of HTTP properties, return true if the "Content-type" value in the map is either "text/html" or "application/xhtml+xml"
Given a map of HTTP properties, return true if the "Content-type" value in the map is either "text/html" or "application/xhtml+xml"
Map which may contain a key named Content-Type
true if there is a pair ("Content-Type", "text/html") or ("Content-Type", "application/xhtml+xml")
Create a function (the 'invoker') which will trigger any public, parameterless method That function will throw the cause exception if the method can't be invoked
Create a function (the 'invoker') which will trigger any public, parameterless method That function will throw the cause exception if the method can't be invoked
instance whose method must be invoked
Empty if instance is null or Full(invoker)
promote a String to a ToCssBindPromotor
the current year
a standard format for the date yyyy/MM/dd
the day of month corresponding to the input date (1 based)
the current Day as a Date object
use today instead
the number of millis corresponding to 'in' days
the number of days since epoch
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
Compute the deltas between two sequences of a given type.
Compute the deltas between two sequences of a given type. Apply the function based on the differences between the two lists. The resulting List of commands will be returned. The algorithm used to calculate the diffs is not very efficient and can degrade to O(n2), so it's not great for large collections. Internally the Seq[T] are converted to a List[T]. Finally, it's highly recommended that T be immutable and does proper equals testing (e.g., a case class).
Compute the deltas between two sequences of a given type.
Compute the deltas between two sequences of a given type. Apply the function based on the differences between the two lists. The resulting List of commands will be returned.
Executes by-name function f and then closes the Cloaseables parameters
Executes by-name function f and then closes the Cloaseables parameters
Test for null and return either the given String if not null or the empty String.
Test for null and return either the given String if not null or the empty String.
Encode the string to be including in JavaScript, replacing '\' or '\\' or non-ASCII characters by their unicode value
Encode the string to be including in JavaScript, replacing '\' or '\\' or non-ASCII characters by their unicode value
the encoded string inserted into quotes
Ensure that the first Element has the specified ID
Ensure that the first Element has the specified ID
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
Convert a java.
Convert a java.util.Enumeration to a List[T]
Convert a java.
Convert a java.util.Enumeration to a List[String] using the toString method on each element
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
).
the object to compare against this object for reference equality.
true
if the argument is a reference to the receiver object; false
otherwise.
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)
).
the object to compare against this object for equality.
true
if the receiver object is equivalent to the argument; false
otherwise.
Create the unicode value of a character
Create the unicode value of a character
character
the unicode value as a string starting by \\u
Within a NodeSeq, find the first elem and run it through the function.
Within a NodeSeq, find the first elem and run it through the function. Return the resulting NodeSeq
Execute the specified OS command and return the output of that command in a Full Box if the command succeeds, or a Failure if an error occurs.
Execute the specified OS command and return the output of that command in a Full Box if the command succeeds, or a Failure if an error occurs.
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 finalize
and non-local returns and exceptions, are all platform dependent.
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
Find a class given a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary
Find a class given a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary
a Box, either containing the found class or an Empty can.
Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.
Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.
a Box, either containing the found class or an Empty can.
Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.
Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.
a Box, either containing the found class or an Empty can.
General method to in find a class according to its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.
General method to in find a class according to its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').
a Box, either containing the found class or an Empty can.
General method to in find a class according to its name, a list of possible packages, a list of functions modifying the given name create a target name to look for (e.
General method to in find a class according to its name, a list of possible packages, a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').
a Box, either containing the found class or an Empty can.
Find the elements of the specified NodeSeq that match the specified predicate and concatenate them into a resulting NodeSeq.
Find the elements of the specified NodeSeq that match the specified predicate and concatenate them into a resulting NodeSeq.
- the NodeSeq to search for elements matching the predicate
- the predicate to match elements with
the NodeSeq resulting from concatenation of the matched elements.
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
Given an id value, find the Elem with the specified id
Given an id value, find the Elem with the specified id
Map the specified function over the elements of the specified NodeSeq and return the concatenated result.
Map the specified function over the elements of the specified NodeSeq and return the concatenated result. This is essentially a container-type-transforming flatMap operation.
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.
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
If the specified Elem has an attribute named 'id', return it, otherwise construct a new Elem with a randomly generated id attribute and return the pair
If the specified Elem has an attribute named 'id', return it, otherwise construct a new Elem with a randomly generated id attribute and return the pair
the element to test & add 'id' to
the new element and the id
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
Find a class given its type, a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary
Find a class given its type, a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary
a Box, either containing the found class or an Empty can.
Find a class given its type, its name and a list of packages, turning underscored names to CamelCase if necessary.
Find a class given its type, its name and a list of packages, turning underscored names to CamelCase if necessary.
a Box, either containing the found class or an Empty can.
General method to in find a class according to its type, its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.
General method to in find a class according to its type, its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').
a Box, either containing the found class or an Empty can.
Returns the first application of f to an element of in that results in a Full can.
Returns the first application of f to an element of in that results in a Full can. If f applied to an element of in results in an Empty can, then f will be applied to the rest of the elements of in until a Full can results. If the list runs out then an Empty can is returned.
a list of elements to which f can be applied
a Box containing the first Full can or Empty if f never returns a Full can
Returns a Full can with the first element x of the list in for which f(x) evaluates to true.
Returns a Full can with the first element x of the list in for which f(x) evaluates to true. If f(x) evaluates to false for every x, then an Empty can is returned.
a list of elements to which f can be applied
a function that can be applied to elements of in
a Box containing the found element (or Empty if not found)
today's date formatted as yyyy/MM/dd
now's time formatted as HH:mm zzz
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.
a representation that corresponds to the dynamic class of the receiver object.
create a SHA hash from a String
create a SHA hash from a String
create a SHA hash from a Byte array
create a SHA hash from a Byte array
create a SHA-256 hash from a String
create a SHA-256 hash from a String
create a SHA-256 hash from a Byte array
create a SHA-256 hash from a Byte array
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.
the hash code value for the object.
create a SHA hash from a String
create a SHA hash from a String
Return the first element of a List or a default value if the list is empty
Return the first element of a List or a default value if the list is empty
create an hex encoded SHA hash from a Byte array
create an hex encoded SHA hash from a Byte array
create an hex encoded SHA-256 hash from a Byte array
create an hex encoded SHA-256 hash from a Byte array
encode a Byte array as hexadecimal characters
encode a Byte array as hexadecimal characters
the formatted time for a given Date
a standard format HH:mm:ss
the number of millis corresponding to 'in' hours
Create a new instance of a class
Create a new instance of a class
a Full can with the instance or a Failure if the instance can't be created
Ensure that all the appropriate fields are in the header.
Ensure that all the appropriate fields are in the header.
transforms an int to a TimeSpan object.
transforms an int to a TimeSpan object. Usage: 3000 returns a TimeSpan of 3000L millis
transforms an int to a TimeSpanBuilder object.
transforms an int to a TimeSpanBuilder object. Usage: 3.seconds returns a TimeSpan of 3000L millis
a formatter for internet dates (RFC822/1123) including: the day of week, the month, day of month, time and time zone
Invoke a controller method (parameterless, public) on a class
Invoke a controller method (parameterless, public) on a class
the class owning the method
the result of the method invocation or throws the root exception causing an error
Invoke the given method for the given class, with some parameters and their types Tries the method name, then the method as a CamelCased name and the method as a camelCased name The class is not instanciated if the method is static, otherwise the passed instance is used
Invoke the given method for the given class, with some parameters and their types Tries the method name, then the method as a CamelCased name and the method as a camelCased name The class is not instanciated if the method is static, otherwise the passed instance is used
class whose method should be invoked
instance of the class who method should be invoked, if the method is not static
method to invoke
parameters to pass to the method
list of types of the parameters
a Box containing the value returned by the method
Invoke the given method for the given class, with some parameters.
Invoke the given method for the given class, with some parameters. Tries the method name, then the method as a CamelCased name and the method as a camelCased name The class is not instanciated if the method is static, otherwise the passed instance is used
class whose method should be invoked
instance of the class who method should be invoked, if the method is not static
method to invoke
parameters to pass to the method
a Box containing the value returned by the method
Invoke the given method for the given class, with no params.
Invoke the given method for the given class, with no params. The class is not instanciated if the method is static, otherwise the passed instance is used
class whose method should be invoked
instance of the class who method should be invoked, if the method is not static
method to invoke
a Box containing the value returned by the method
Compare two arrays of Byte for byte equality.
Compare two arrays of Byte for byte equality.
true if two Byte arrays contain the same bytes
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.
true
if the receiver object is an instance of erasure of type T0
; false
otherwise.
The list of known suffixes used to split the URI into path parts and suffixes.
The list of known suffixes used to split the URI into path parts and suffixes.
Creates a List of Strings from a List[String] and a String
Creates a List of Strings from a List[String] and a String
Creates a List of Strings from two Strings
Creates a List of Strings from two Strings
Return a list containing the element f if the expression is true
Return a list containing the element f if the expression is true
a SuperString with more available methods such as roboSplit or commafy
adds the ciGet method to a List of Pairs of Strings
adds the ciGet method to a List of Pairs of Strings
Call f and log the string returned together with the time taken in millis.
Call f and log the string returned together with the time taken in millis.
the second result from f
Log a message with the time taken in millis to do something and return the result
Log a message with the time taken in millis to do something and return the result
the result
transforms a long to a TimeSpan object.
transforms a long to a TimeSpan object. Usage: 3000L returns a TimeSpan of 3000L millis
transforms a long to a TimeSpanBuilder object.
transforms a long to a TimeSpanBuilder object. Usage: 3L.seconds returns a TimeSpan of 3000L millis
create a MD5 digest from a String
create a MD5 digest from a String
create a MD5 digest from a Byte array
create a MD5 digest from a Byte array
the current number of millis: System.currentTimeMillis
the number of days since epoch converted from millis
the number of millis corresponding to 'in' minutes
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.
where to put the attributes
where to take the attributes from
'out' element with attributes from 'in'
the month corresponding to today (0 based, relative to UTC)
the current System.nanoTime()
o.ne(arg0)
is the same as !(o.eq(arg0))
.
o.ne(arg0)
is the same as !(o.eq(arg0))
.
the object to compare against this object for reference dis-equality.
false
if the argument is not a reference to the receiver object; true
otherwise.
Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)
Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)
Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)
Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)
Get a monotonically increasing number that's guaranteed to be unique for the current session
Get a monotonically increasing number that's guaranteed to be unique for the current session
Return true if the xml doesn't contain an <html> tag
Return true if the xml doesn't contain an <html> tag
an Empty can if the node seq is empty and a full can with the NodeSeq text otherwise
Compare two arrays of Byte for byte equality.
Compare two arrays of Byte for byte equality.
true if two Byte arrays don't contain the same bytes
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.
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.
the date object for now
the current time as an internet date
Transform a pair (name: String, value: Any) to an unprefixed XML attribute name="value"
Transform a pair (name: String, value: Any) to an unprefixed XML attribute name="value"
Take a list of name/value parse and turn them into a URL query string
Take a list of name/value parse and turn them into a URL query string
the name/value pairs
a valid query string
a date from a string using the internet format. Return the Epoch date if the parse is unsuccesfull
Parse a string and return the Long value of that string.
Parse a string and return the Long value of that string.
The string can start with '-' if it is a negative number or '+' for a positive number
the Long value of the input String
Given a list, return all the permutations of the list.
Given a list, return all the permutations of the list.
-- the list
all the permutations of the list
Given a list, return all the permutations including the removal of items (does not return a Nil list unless in is Nil).
Given a list, return all the permutations including the removal of items (does not return a Nil list unless in is Nil).
the list to permute
all the permutations of the list including sublists, sorted in longest to shortest
promote a partial function such that we can invoke the guard method to wrap the guarded partial function with a guard
promote a partial function such that we can invoke the guard method to wrap the guarded partial function with a guard
Bind parameters to XML.
Bind parameters to XML.
XML with lift:bind elements
data to bind
use the bind function instead
Replaces the value found in a string surrounded by <%= .
Replaces the value found in a string surrounded by <%= ... %> by a replacement according to the value found in the subst Map.
Throws an exception if no correspondance can be found.
string where replacements should be done
map of [regular expression with groups, replacement]
return a random int modulo a number
return a random int modulo a number
return a random Long modulo a number
return a random Long modulo a number
Create a random string of a given size.
Create a random string of a given size. 5 bits of randomness per character
size of the string to create. Must be a positive integer.
the generated string
Read an entire file into an Array[Byte]
Read an entire file into an Array[Byte]
Read all data from a stream into an Array[Byte]
Read all data from a stream into an Array[Byte]
Read all data to the end of the specified Reader and concatenate the resulting data into a string.
Read all data to the end of the specified Reader and concatenate the resulting data into a string.
Replace the element with the id that matches with the replacement nodeseq.
Replace the element with the id that matches with the replacement nodeseq.
Split a string according to a separator
Split a string according to a separator
a regexp to use with the String::split method
a list of trimmed parts whose length is > 0
Given an incoming list, return a set of lists that is the original list rotated through all its positions
Given an incoming list, return a set of lists that is the original list rotated through all its positions
the list to rotate
all the rotations of the list
the number of millis corresponding to 'in' seconds
Compare two byte arrays in a way that does not vary if the arrays are determined to be not equal early (test every byte.
Compare two byte arrays in a way that does not vary if the arrays are determined to be not equal early (test every byte... avoids timing attackes
Compare two strings in a way that does not vary if the strings are determined to be not equal early (test every byte.
Compare two strings in a way that does not vary if the strings are determined to be not equal early (test every byte... avoids timing attackes
return true only 'percent' times when asked repeatedly.
return true only 'percent' times when asked repeatedly. This function is used in the Skittr example to get a random set of users
percentage as a double number <= 1.0
Turn a string of format "FooBar" into snake case "foo_bar"
Turn a string of format "FooBar" into snake case "foo_bar"
Note: snakify is not reversible, ie. in general the following will _not_ be true:
s == camelify(snakify(s))
the underscored string
Split a string in 2 parts at the first place where a separator is found
Split a string in 2 parts at the first place where a separator is found
a List containing a pair of the 2 trimmed parts
Split a String at the Hash sign, run the function on the non-# side and then append the hash side
Split a String at the Hash sign, run the function on the non-# side and then append the hash side
Split a string separated by a point or by a column in 2 parts.
Split a string separated by a point or by a column in 2 parts. Uses default values if only one is found or if no parts are found
string to split
default value for the first part if no split can be done
default value for the second part if one or less parts can be found
a pair containing the first and second parts
Splits a string of the form <name1=value1, name2=value2, .
Splits a string of the form <name1=value1, name2=value2, ... > and unquotes the quoted values. The result is a Map[String, String]
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"
use -> instead
promote a String to a ToCssBindPromotor
a SuperString with more available methods such as roboSplit or commafy
Remove all the <head> tags, just leaving the child tags
Remove all the <head> tags, just leaving the child tags
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"
use -> instead
Find three of many templates from the children
Find three of many templates from the children
Find two of many templates from the children
Find two of many templates from the children
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.
alias for new Date(millis)
alias for new Date(millis)
a format for the time which includes the TimeZone: HH:mm zzz
the current time as a Date object
use now instead
Convert any object to an "equivalent" Boolean depending on its value
Convert any object to an "equivalent" Boolean depending on its value
Convert any InputStream to a ByteArrayInputStream
Convert any InputStream to a ByteArrayInputStream
implicit def used to add the setXXX methods to the Calendar class
implicit def used to add the setXXX methods to the Calendar class
a Full(date) or a failure if the input couldn't be translated to date (or Empty if the input is null)
implicit def used to add the noTime method to the Date class
implicit def used to add the noTime method to the Date class
Transform a general Map to a nutable HashMap
Transform a general Map to a nutable HashMap
Convert any object to an "equivalent" Int depending on its value
Convert any object to an "equivalent" Int depending on its value
a date formatted with the internet format (from a number of millis)
a date formatted with the internet format
Convert any object to an "equivalent" Long depending on its value
Convert any object to an "equivalent" Long depending on its value
Implicit transformation from a Boolean expression to an OptionalCons object so that an element can be added to a list if the expression is true
Implicit transformation from a Boolean expression to an OptionalCons object so that an element can be added to a list if the expression is true
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
a string representation of the object.
Add utility methods to Lists
the Calendar object for today (the TimeZone is the local TimeZone). Its time is 00:00:00.000
Wraps a "try" block around the function f.
Wraps a "try" block around the function f. Takes only one Class of exception to ignore
- a single exception classes to ignore. A thrown exception will be ignored if it is assignable from this class.
- the block of code to evaluate @return
Wraps a "try" block around the function f
Wraps a "try" block around the function f
- a list of exception classes to ignore. A thrown exception will be ignored if it is assignable from one of the exception classes in the list
- the block of code to evaluate @return
Wraps a "try" block around the function f and trigger a callback function if an exception is thrown
Wraps a "try" block around the function f and trigger a callback function if an exception is thrown
- an optional callback function that will use the thrown exception as a parameter
- the block of code to evaluate @return
Wraps a "try" block around the function f
Wraps a "try" block around the function f
- the block of code to evaluate @return
Wraps a "try" block around the function f.
Wraps a "try" block around the function f. If f throws an exception that is in the domain of the handler PF, the handler will be invoked on the exception. Otherwise the exception is wrapped into a Failure.
- A partial function that handles exceptions
- the block of code to evaluate @return
net.liftweb.common.Failure
Wraps a "try" block around the function f.
Wraps a "try" block around the function f. If f throws an exception with its class in the 'ignore' list or if 'ignore' is null or an empty list, ignore the exception and return None.
- a list of exception classes to ignore. A thrown exception will be ignored if it is assignable from one of the exception classes in the list
- an optional callback function that will use the thrown exception as a parameter
- the block of code to evaluate @return
Use StringHelpers.snakify
If str is surrounded by quotes it return the content between the quotes
If str is surrounded by quotes it return the content between the quotes
URL decode the string.
URL decode the string.
This is a pass-through to Java's URL decode with UTF-8
URL encode the string.
URL encode the string.
This is a pass-through to Java's URL encode with UTF-8
The UTC TimeZone
The UTC TimeZone
the number of millis corresponding to 'in' weeks
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.
use bind instead
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.
a Full Box containing the value of the attribute if found; Empty otherwise
the year corresponding to today (relative to UTC)
The Helpers object provides a lot of utility functions: