Package

org.clapper

scalasti

Permalink

package scalasti

Visibility
  1. Public
  2. All

Type Members

  1. trait AttributeRenderer[T] extends AnyRef

    Permalink

    A more Scala-like ST attribute renderer.

    A more Scala-like ST attribute renderer. Objects that implement this trait can be registered as attribute renderers with an STGroupString.

    T

    the type (class) for which the renderer can render values.

  2. class DateRenderer extends AttributeRenderer[Date]

    Permalink

    A Scalasti version of String Template's DateRenderer.

  3. class NumberRenderer extends AttributeRenderer[Number]

    Permalink

    A Scalasti version of String Template's NumberRenderer.

  4. class ST extends AnyRef

    Permalink

    A Scala interface to a StringTemplate ST template.

    A Scala interface to a StringTemplate ST template. objet Note that this interface does not directly expose all the underlying ST methods. In particular, this Scala interface is geared primarily toward reading and rendering external templates, not toward generating templates in code.

    This class cannot be instantiated directly. Instead, use the apply() methods in the companion object.

    Because of the way the ST API instantiates templates, this class cannot easily subclass the real ST class. So, it wraps the underlying string template object and stores it internally. You can retrieve the wrapped template object via the nativeST method. You are free to call methods directly on template, though they will use Java semantics, rather than Scala semantics.

    Note that this class explicitly handles mapping the following types of values in an attribute map:

    • A Scala Seq (which includes lists and array buffers) is mapped to a java.util.List, so it's treated as a multivalued attribute by the underlying ST library.
    • A Scala iterator is also mapped to a java.util.List.
    • Numbers and strings are added as is.
    • Anything else is treated as a regular object and wrapped in a Java Bean. See below.

    Bean Wrapping

    Regular objects are, by default, wrapped in a Java Bean, because the underlying String Template API uses Java Bean semantics to access object fields. Thus, if a template references "foo.bar", StringTemplate will expect that the object associated with the name "foo" has a method called getBar(). To allow Scala objects (and, especially, case class objects) to be used directly, Scalasti automatically generates wrapper Java Beans for them.

    There are cases where you don't want this behavior, however. For instance, it doesn't make much sense with numeric values or strings, so Scalasti deliberately does not wrap those objects. There are other cases where you might not want the automatic Bean-wrapper behavior; see the add method for more details.

  5. trait STErrorListener extends stringtemplate.v4.STErrorListener

    Permalink

    A Scala version of the String Template library's StringTemplateErrorListener class.

  6. class STGroup extends AnyRef

    Permalink

    A Scala wrapper for the String Template library's STGroup class.

    A Scala wrapper for the String Template library's STGroup class. This class provides access to most of the methods on the underlying class, with Scala semantics, where appropriate. This class cannot be instantiated directly; use the apply() methods on the companion object, or create one of the subclasses.

    This class does not expose all of the underlying functions of the actual StringTemplate API. If you need access to the full Java StringTemplate API, you can retrieve the underlying STGroup by calling the nativeGroup method.

  7. class STGroupDir extends STGroup

    Permalink

    STGroupDir wraps the StringTemplate API's STGroupDir class.

    STGroupDir wraps the StringTemplate API's STGroupDir class. An STGroupDir specifies a directory or directory tree full of templates and/or group files, with the files loaded on demand. As a subclass of STGroup, an STGroupDir contains all the methods of the parent class. This class cannot be instantiated directly; use the apply() methods on the companion object.

  8. class STGroupFile extends STGroup

    Permalink

    STGroupFile wraps the StringTemplate API's STGroupFile class.

    STGroupFile wraps the StringTemplate API's STGroupFile class. An STGroupFile object reads a template group from a file. See the StringTemplate API documentation for details. Since STGroupFile a subclass of STGroup, all the methods on the parent class are available on this one. This class cannot be instantiated directly; use the apply() methods on the companion object.

  9. class STGroupString extends STGroup

    Permalink

    STGroupString wraps the StringTemplate API's STGroupString class.

    STGroupString wraps the StringTemplate API's STGroupString class. An STGroupString object reads a template group from a string. See the StringTemplate API documentation for details. Since STGroupString a subclass of STGroup, all the methods on the parent class are available on this one. This class cannot be instantiated directly; use the apply() methods on the companion object.

Value Members

  1. object Constants

    Permalink

    Miscellaneous shared constants.

  2. object ST

    Permalink

    Companion object for the ST class.

    Companion object for the ST class. This object provides apply() methods for instantiating ST objects.

  3. object STGroup

    Permalink

    Companion object for the STGroup class.

    Companion object for the STGroup class. This object provides apply() methods for instantiating STGroup objects.

  4. object STGroupDir

    Permalink

    Companion object for STGroupDir.

    Companion object for STGroupDir. This object provides apply() methods for instantiating STGroupDir objects.

  5. object STGroupFile

    Permalink

    Companion object for STGroupFile.

    Companion object for STGroupFile. This object provides apply() methods for instantiating STGroupFile objects.

  6. object STGroupString

    Permalink

    Companion object for STGroupString.

    Companion object for STGroupString. This object provides apply() methods for instantiating STGroupString objects.

Ungrouped