Exception thrown if a ping can't be scheduled.
Abstract a request or a session scoped variable.
A common function-like interface for accessing information about
attributes, based on the two core findAttr
and
convert
methods.
A common function-like interface for accessing information about
attributes, based on the two core findAttr
and
convert
methods.
Extenders can be fairly flexible. The value of an attribute is
specified by the extender as type Info
. Possibly-missing
attributes are returned in type Holder, which should be
parametrizable. For example, you could create an AttrHelper that
deals in String attribute values (type Info = String
)
and returns Option
s in cases where the attribute may not
be found.
Note that you can invoke an AttrHelper
with conversion
functions to turn an Info
into an arbitrary type.
A sample implementation:
case class HtmlAttributes(in: Elem) extends AttrHelper[Box] { type Info = String def findAttr(key: String): Option[Info] = { in.attribute(key).map(_.text) } def findAttr(prefix: String, key: String): Option[Info] = { in.attribute(prefix, key).map(_.text) } def convert[T](in: Option[T]): Box[T] = Box(in) }
The helper above takes a scala Elem
and provides a
series of ways to access the values of its elements. For example:
val attributes = HtmlAttributes(elem) attributes("class") // class attribute as String, Empty if absent attributes("lift", "bind") // as above with lift:bind attribute attributes("class", "nothing") // class attribute, "nothing" if absent attributes("lift", "bind", "nothing") // as above with lift:bind attribute attributes("class", _.split(" ")) // class attribute as array, Empty if absent attributes("lift", "bind", _.split(" ")) // as above with lift:bind attribute attributes("class", _.split(" "), Array()) // class attribute as array, Array() if absent attributes("lift", "bind", _.split(" "), Array()) // as above with lift:bind attribute
A trait that defines an Automatic Resource Manager.
A trait that defines an Automatic Resource Manager. The ARM
allocates a resource (connection to a DB, etc.) when the exec
method is invoked and releases the resource before the exec method terminates
the type of resource allocated
Generics on the JVM have an issues with Type Erasure.
Generics on the JVM have an issues with Type Erasure. Basically, Generic types (e.g., Function1[String, Int] and Function1[Double, Bool]) look like the same type to the JVM so that methods cannot be overloaded with generic types. This "marker" trait is used as a work-around to the issue. The marker is implicitly passed as a parameter to some overloaded methods. If you see this as an implicit parameter to an overloaded method, just ignore it.
This trait adds functionality to Scala standard types
This trait is used to identify an object that is representable as a
NodeSeq
.
The implementation for a Box[NodeSeq => Node] Iterable Const
Represents a unifying class that can resolve an asynchronous container.
Represents a unifying class that can resolve an asynchronous container. For
example, a Future[String]
can be resolved by a
CanResolveAsync[Future[String], String]
.
Provides one method, resolveAsync
, that takes the async container and
a function to run when the container resolves.
A wiring Cell.
A wiring Cell. A Cell can be a ValueCell which holds a value which can be set (and thus update the dependencies), a FuncCell (a cell that is a function that depends on other cells), or a DynamicCell which has a value that updates each time the cell is accessed.
ClassHelpers provide several functions to instantiate a Class object given the class name and one or more package names
This CssBind will clear all nodes marked with the class clearable.
This CssBind will clear all nodes marked with the class clearable. Designers can mark extra nodes in markup with class="clearable" and this Bind will make them go away
The CombParserHelpers trait provides parser combinators helpers.
A base field that also has a confirm method
Control helpers provide alternate ways to catch exceptions and ignore them as necessary
An abstract implementation of CssBind.
An abstract implementation of CssBind. You can instantiate this class and create a custom calculate method
Bridge from Java-land to Scala
This trait is both a NodeSeq => NodeSeq and has the ability to chain CssSel instances so that they can be applied en masse to incoming NodeSeq and do the transformation.
Utility for prefixing root-relative url
s in CSS with a given prefix.
Utility for prefixing root-relative url
s in CSS with a given prefix.
Typically used to prefix root-relative CSS url
s with the application
context path.
After creating the prefixer with the prefix you want to apply to
root-relative paths, call fixCss
with a CSS string to return a fixed CSS
string.
A simple fixed-point currency representation
This exception is thrown if an operation is attempted on two currency values where currency symbols do not match.
Implement this trait to specify a set of rules to parse and format dates
Provide information about the deltas between two lists
Something that depends on the values of other cells
A cell that changes value on each access.
A cell that changes value on each access. This kind of cell could be used to access an external resource. Warning the function may be accessed many times during a single wiring recalculation, so it's best to use this as a front to a value that's memoized for some duration.
A class that does lazy evaluation
Convert the field into other representations
Associate a FieldIdentifier with a NodeSeq
Defines the association of this reference with a markup tag ID
A utility that supports parsing of HTML5 file.
A utility that supports parsing of HTML5 file. The Parser hooks up nu.validator.htmlparser to
Caches templates in a LRU map
A trait that does basic dependency injection.
A trait that has some helpful implicit conversions from Iterable[NodeSeq], Seq[String], Box[String], and Option[String]
Impersonates a JSON command
A simple Read-through cache.
A simple Read-through cache.
An example of using it with a ProtoUser subclass:
object UserCache extends KeyedCache[Long, User](100, Full(0.75f), (id: Long) => User.find(By(User.id, id)))
LRU Cache wrapping org.apache.commons.collections.map.LRUMap
LZ encapsulates a lazy value.
The superclass for all Lift flow of control exceptions
Kinda like a JavaBean property.
Kinda like a JavaBean property. It's something that can be set and retrieved
The ListHelpers trait provides useful functions which can be applied to Lists.
This trait defines the principle contract for function objects that wrap the processing of HTTP requests by Lift while utilizing the preestablished request-local scope.
This trait implmenets the mail sending.
This trait implmenets the mail sending. You can create subclasses of this class/trait and implement your own mailer functionality
In addition to an Injector, you can have a Maker which will make a given type.
In addition to an Injector, you can have a Maker which will make a given type. The important thing about a Maker is that it's intended to be used as part of a factory that can vend an instance without the vaguaries of whether the given class has registered a with the injector.
An implementation where you can define the stack of makers.
A MonadicCondition allows building boolean expressions of the form (a(0) && a(1) && ..
A MonadicCondition allows building boolean expressions of the form (a(0) && a(1) && .. && a(n)), where a(k) is a boolean expression, and collecting the computation failures to a list of messages.
Example: val isTooYoung = true; val isTooBad = false; val isTooStupid = true; val exp = (!isTooYoung ~ "too young") && (!isTooBad ~ "too bad") && (!isTooStupid ~ "too stupid") println(exp match { case False(msgs) => msgs mkString("Test failed because it is '", "' and '", "'.") case _ => "success" })
This class is the base implementation of the NamedPartialFunction trait.
This trait is used to represent a PartialFunction with additional associated metadata, a name that allows the NamedPartialFunction to be looked up dynamically.
The implementation for a NodeSeq => NodeSeq Iterable Const
The implementation for a NodeSeq Iterable Const
The implementation for a Option[NodeSeq => Node] Iterable Const
Extends the Markup Parser to do the right thing (tm) with PCData blocks
This class adds higher-order functions and lazy evaluation for pattern matching on top of the standard Java regular expressions library.
A field that can be displayed but not edited
The new list does not contain the item.
The new list does not contain the item. Remove it from the list
Holds information about a response
RestoringWeakReference
contains a scala.ref.WeakReference
that,
after it has been nulled out, uses a restorer function to restore the
value.
RestoringWeakReference
contains a scala.ref.WeakReference
that,
after it has been nulled out, uses a restorer function to restore the
value. This can be used for data that can afford to be evicted by
the garbage collector, but will be needed later. One good example is
Lift form callbacks, which may need the value of an object, but where
you don't necessarily want to be retaining the object indefinitely
while someone is on a page in the face of GC contention.
You can use RestoringWeakReference
in a couple of basic ways:
val ref = RestoringWeakReference(() => User.find(id))
In this situation, the RestoringWeakReference
will immediately call
the passed function to provide the starting value for the reference,
and then the same function will be used if the reference is evicted.
val ref = RestoringWeakReference(starter, () => User.find(id))
Here, starter is an Option[User]
and User.find
returns an
Option[User]
. The first parameter will be used to initialize the
weak reference, while the function will be used to restore the value
if the reference is evicted.
val baseRef = new WeakReference(starter) val ref = new RestoringWeakReference(baseRef, () => User.find(id))
If you already have a WeakReference
instance, you can instantiate
RestoringWeakReference
directly and pass that reference as the
starting value, as well.
In all these cases, you use ref.value
to get a hold of the value.
That function will return the value if it is available, and, if not,
it will restore the WeakReference and then return the value.
The Schedule object schedules an actor to be ping-ed with a given message after a specified delay.
The Schedule object schedules an actor to be ping-ed with a given message after a specified delay. If you need recurrent scheduled pings you will need to reschedule.
The schedule methods return a ScheduledFuture object which can be cancelled if necessary
The SecurityHelpers trait provides functions to:
The SecurityHelpers trait provides functions to:
Sequence of Bindable iterable const
A collection of Cells og a given type
Sequence of String iterable const
A value that can be set
A field that can be set
An implementation of Injector that has an implementation
A Map that holds the values as SoftReference-s.
A Map that holds the values as SoftReference-s. It also applies a LRU policy for the cache entries.
Value and metadata for a field
An inplementation of SourceFieldInfo
An inplementation of SourceFieldInfo
the type
the value
the metadata
Metadata about a specific field
A trait that allows an object to tell you about itself rather than using reflection
A StackableMaker allows DynamicVar functionality by supply a Maker or function that will vend an instance during any sub-call on the stack and then restore the implementation.
A StackableMaker allows DynamicVar functionality by supply a Maker or function that will vend an instance during any sub-call on the stack and then restore the implementation. This is value for testing.
Utility methods for manipulating strings.
This trait marks something that can be promoted into a String.
This trait marks something that can be promoted into a String. The companion object has helpful conversions from Int, Symbol, Long, and Boolean
A class that allows chaining "foo" / "bar" / "baz"
The SuperString class adds functionalities to the String class
This is a decorator for a ThreadLocal variable that provides convenience methods to transform the variable to a Box and execute functions in a "scope" wherein the variable may hold a different value.
A thread-local lazy value that provides a means to evaluate a function in a lazily-evaluated scope.
The TimeHelpers trait provide functions to create TimeSpans (an object representing duration in milliseconds), to manage date formats or general utility functions (get the date for today, get year/month/day number,...)
TODO: Is this something that can be converted to a JavaScript Command
A ValueCell holds a value that can be mutated.
A Vendor is a Maker that also guarantees that it will return a value
A bridge from Java to Scala
The companion object that does the implicit vending of AvoidTypeErasureIssues1
This object adds functionality to Scala standard types.
Converts a NodeSeq of a particular format into a ResourceBundle.
Converts a NodeSeq of a particular format into
a ResourceBundle. Basically, each of the second-level
nodes that contain the attribute "name" the name becomes an
entry in the resulting resource bundle. It is possible
to localize each of the entries with the lang and country
attributes which will be compared against the incoming
Locale. If the default attribute is true, then that entry
is used if no others match. Note that language is weighted
more heavily than country.
If the node
is a Text or PCData node, it will be returned as a String.
Otherwise, it will be returned as a NodeSeq.
This CssBind will clear all nodes marked with the class clearable.
This CssBind will clear all nodes marked with the class clearable. Designers can mark extra nodes in markup with class="clearable" and this Bind will make them go away
Replaces the nodes with an Empty NodeSeq.
Replaces the nodes with an Empty NodeSeq. Useful for removing unused nodes
Parse a subset of CSS into the appropriate selector objects
A default implementation of DateTimeConverter that uses (Time)Helpers
Companion object for FatLaxy.
The companion object for FuncCell (function cells)
This object provides functions to setup the head section of html documents.
The Helpers object provides a lot of utility functions:
The Helpers object provides a lot of utility functions:
Utilities for simplifying use of named HTML symbols.
Companion module for InMemoryCache
The companion object that does the helpful promotion of common collection types into an IterableConst, e.g.
The companion object that does the helpful promotion of common collection types into an IterableConst, e.g. Iterable[NodeSeq], Seq[String], Box[String], and Option[String]
A helpful extractor to take the JValue sent from the client-side JSON stuff and make some sense of it.
Calculate the edit distance between words
Sometimes, you want to do pattern matching against a lazy value.
Sometimes, you want to do pattern matching against a lazy value. Why? Because, there may be parts of the pattern that must be evaluated first and if they evaluate successfully, you then want to test another part of the pattern. Thus, the LZ pattern match.
Function object that can be used in Logger.setup
Function object that can be used in Logger.setup
Tries to determine which logging backend is available and configures it by using either defaults or a mode-dependent configuration file.
To provide your own configuration, add either a log4j.props file or log4j.xml file to your classpath. If using logback, name it logback.xml
If you want to provide a configuration file for a subset of your application or for a specific environment, Lift expects configuration files to be named in a manner relating to the context in which they are being used. The standard name format is:
modeName.hostName.userName.filename.extension
with hostName and userName being optional, and modeName being one of 'test', 'staging', 'production', 'pilot', 'profile', or 'default. Thus, if you name your log4j config file 'default.log4j.xml' or 'default.log4j.props' it will be picked up correctly.
Utilities for sending email.
Holds the implicit conversions from/to MonadicCondition
A cache that caches nothing
A passthrough function that does not change the nodes
Configuration management utilities.
Configuration management utilities.
If you want to provide a configuration file for a subset of your application or for a specific environment, Lift expects configuration files to be named in a manner relating to the context in which they are being used. The standard name format is:
$modeName.$userName.$hostName.$props examples: dpp.yak.props test.dpp.yak.props production.moose.props staging.dpp.props test.default.props default.props
with hostName
and userName
being optional, and modeName
being one of
"test", "staging", "production", "pilot", "profile", or "default".
The standard Lift properties file extension is "props".
A regular expressions helper library RE("foo") =~ "A string" -or- "A string" =~: RE("foo") -or- "A String".substring(RE("Str")) ("A B cat D" =~: RE("([A-Z])")).capture // List(A,B,D)
Manage the current "safety" state of the stack
Used for type-safe pattern matching of an Any and returns a Seq[Node]
The Schedule object schedules an actor to be ping-ed with a given message after a specified delay.
The Schedule object schedules an actor to be ping-ed with a given message after a specified delay. If you need recurrent scheduled pings you will need to reschedule.
The schedule methods return a ScheduledFuture object which can be cancelled if necessary
Send to the actor that we scheduled for recurrent ping
Companion module that has the role of monitoring garbage collected references and remove the orphaned keys from the cache.
Companion module that has the role of monitoring garbage collected references and remove the orphaned keys from the cache. The monitor is started by calling initialize function and terminated by calling shutDown. It monitors all SoftReferenceCache instances in the context of the same classloader. It can also be used as a factory for obtaining new instances of SoftReferenceCache class
The TimeHelpers object extends the TimeHelpers.
The TimeHelpers object extends the TimeHelpers. It can be imported to access all of the trait functions.
Send by the scheduled actor to sign off from recurrent scheduling
Parser a VCard entry such as
Parser a VCard entry such as
BEGIN:VCARD VERSION:2.1 N:Gump;Forrest FN:Forrest Gump ORG:Bubba Gump Shrimp Co. TITLE:Shrimp Man TEL;WORK;VOICE:(111) 555-1212 TEL;HOME;VOICE:(404) 555-1212 ADR;WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America END:VCARD
The companion object that has a helpful constructor
A companion to the Vendor trait
Promote to an IterableConst when implicits won't do it for you
Promote to an IterableConst when implicits won't do it for you
the type of the parameter
the thing that can be promoted to an IterableConst
the implicit function that takes T and makes it an IterableConst
an IterableConst
Wrap a function and make sure it's a NodeSeq => NodeSeq.
Wrap a function and make sure it's a NodeSeq => NodeSeq. Much easier than explicitly casting the first parameter
the function
a NodeSeq => NodeSeq
The util package object