package commands
- Alphabetic
- By Inheritance
- commands
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
AsyncCommandExecutor
[T <: Command, S] extends AsyncExecutor[T, S]
A command executor that doesn't block while executing the command
A command executor that doesn't block while executing the command
- T
The type of command to handle
- S
The success result type
- abstract class AsyncExecutor [T <: Command, S] extends CommandExecutor[T, Future[ModelValidation[S]]]
-
class
AsyncModelExecutor
[T <: Command, S] extends AsyncExecutor[T, S]
A command executor that can potentially block while executing the command, uses a model as input value for the handler function.
A command executor that can potentially block while executing the command, uses a model as input value for the handler function. This command requires an implicit conversion from command to model to be in scope ie.: by defining it in the companion object of the command.
- T
The type of model
- S
The success result type
- class BasicFieldDescriptor [T] extends FieldDescriptor[T]
- sealed trait Binding extends AnyRef
- type BindingAction = () ⇒ Any
- class BindingException extends ScalatraException
-
trait
BindingImplicits
extends DefaultImplicitConversions with BindingValidatorImplicits
Commonly-used field implementations factory.
- trait BindingSyntax extends BindingValidatorImplicits
- type BindingValidator[T] = (String) ⇒ Validator[T]
- trait BindingValidatorImplicits extends AnyRef
-
class
BlockingCommandExecutor
[T <: Command, S] extends BlockingExecutor[T, S]
A command executor that can potentially block while executing the command
A command executor that can potentially block while executing the command
- T
The type of command to handle
- S
The success result type
- abstract class BlockingExecutor [T <: Command, S] extends CommandExecutor[T, ModelValidation[S]]
-
class
BlockingModelExecutor
[T <: Command, S] extends BlockingExecutor[T, S]
A command executor that can potentially block while executing the command, uses a model as input value for the handler function.
A command executor that can potentially block while executing the command, uses a model as input value for the handler function. This command requires an implicit conversion from command to model to be in scope ie.: by defining it in the companion object of the command.
- T
The type of model
- S
The success result type
- class BoundFieldDescriptor [S, T] extends DataboundFieldDescriptor[S, T]
-
trait
Command
extends BindingSyntax with ParamsValueReaderProperties
Trait that identifies a Command object, i.e.
Trait that identifies a Command object, i.e. a Scala class instance which fields are bound to external parameters taken from Scalatra' params object.
An usage example can be seen below:
class PersonForm extends Command { import Command._ val name = bind[String]("f_name") val surname = bind[String]("f_surname") val age = bind[Int]("f_age") val registeredOn = bind[Date]("f_reg_date" -> "yyyyMMdd") }
In the example above, class field name will be bound, at runtime, with a parameter named f_name and so on. The binding is typed and for every registered type
T
(see org.scalatra.util.conversion.DefaultImplicitConversions for a list of all availables) an automatic conversion(String) => T
will take place during binding phase.After that binding has been performed (i.e. after that org.scalatra.commands.Command#bindTo() has been called) on a specific instance, it is possible retrieve field values as scalaz.Validation, i.e.:
val form = new PersonForm form.doBinding(params) val registrationDate = form.registeredOn.value.getOrElse(new Date())
- Version
0.1
-
abstract
class
CommandExecutor
[T <: Command, S] extends AnyRef
A typeclass for executing commands.
A typeclass for executing commands. This allows for picking an executor based on the return type of the method that is used to handle the command.
- T
The command type
- S
The result type of executing the command
- Annotations
- @implicitNotFound( ... )
- trait CommandExecutors extends AnyRef
-
trait
CommandSupport
extends ParamsValueReaderProperties with CommandExecutors
Support for org.scalatra.commands.Command binding and validation.
- trait DataboundFieldDescriptor [S, T] extends FieldDescriptor[T]
- trait DateParser extends AnyRef
- class DefVal [T] extends AnyRef
- class Field [A] extends AnyRef
- trait FieldDescriptor [T] extends AnyRef
- type FieldValidation[T] = Validation[ValidationError, T]
- trait JacksonJsonParsing extends CommandSupport with JacksonJsonValueReaderProperty
- trait JsonBindingImplicits extends BindingImplicits with JsonImplicitConversions
- trait JsonCommand extends Command with JsonTypeConverterFactories
- trait JsonTypeConverterFactories extends JsonBindingImplicits
- class JsonTypeConverterFactoriesImports extends JsonTypeConverterFactories
- trait JsonTypeConverterFactory [T] extends TypeConverterFactory[T] with JsonBindingImplicits
- type ModelValidation[T] = Validation[NonEmptyList[ValidationError], T]
- trait NativeJsonParsing extends CommandSupport with NativeJsonValueReaderProperty
- trait ParamsOnlyCommand extends TypeConverterFactories with Command
- trait ParamsOnlyCommandSupport extends CommandSupport
- trait TypeConverterFactories extends BindingImplicits
- trait TypeConverterFactory [T] extends BindingImplicits
- class ValidatedBoundFieldDescriptor [S, T] extends ValidatedFieldDescriptor[S, T]
- trait ValidatedFieldDescriptor [S, T] extends DataboundFieldDescriptor[S, T]
- type Validator[T] = (FieldValidation[T]) ⇒ FieldValidation[T]
-
trait
CommandHandler
extends AnyRef
- Annotations
- @deprecated
- Deprecated
(Since version 2.2.1) This approach is not fully type-safe. The compiler can't enforce that the handle method returns a
S
. Please use the>>
orapply
method on a command.
-
abstract
class
ModelCommand
[T] extends Command
- Annotations
- @deprecated
- Deprecated
(Since version 2.2.1) This was meant for usage with the
org.scalatra.commands.CommandHandler
, but that approach is not fully compiler verified. Look at using theexecute
method on a command instead.
Value Members
- object Binding
- object BindingImplicits extends BindingImplicits
- object BindingSyntax extends BindingSyntax
- object BindingValidators
- object BoundFieldDescriptor
- object CommandExecutors extends CommandExecutors
- object DefVal
- object FieldDescriptor
- object JodaDateFormats extends DateParser
- object TypeConverterFactories extends TypeConverterFactories
- object ValueSource extends Enumeration