All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fusesource.scalate.Binding.scala Maven / Gradle / Ivy

There is a newer version: 1.5.3-scala_2.8.2
Show newest version
/*
 * Copyright (C) 2009, Progress Software Corporation and/or its
 * subsidiaries or affiliates.  All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
package org.fusesource.scalate

/**
 * Describes a variable binding that a Scalate template defines.
 *
 * @author Hiram Chirino
 */
case class Binding(
  name: String,
  className: String = "Any",
  importMembers: Boolean = false,
  defaultValue: Option[String] = None,
  kind: String = "val",
  isImplicit: Boolean = false) { 
}

object Binding {
  
  def of[T](
    name: String,
    importMembers: Boolean = false,
    defaultValue: Option[String] = None,
    kind: String = "val",
    isImplicit: Boolean = false)(implicit m: Manifest[T]) =
      new Binding(name, m.erasure.getName, importMembers, defaultValue, kind, isImplicit)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy