grizzled.config

Configuration

object Configuration extends AnyRef

Companion object for the Configuration class

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Configuration
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final val DefaultCommentPattern: Regex

  7. final val DefaultSectionNamePattern: Regex

  8. def apply(source: Source, sections: Map[String, Map[String, String]], safe: Boolean, sectionNamePattern: Regex, commentPattern: Regex): Configuration

    Read a configuration file, permitting some predefined sections to be added to the configuration before it is read.

    Read a configuration file, permitting some predefined sections to be added to the configuration before it is read. The predefined sections are defined in a map of maps. The outer map is keyed by predefined section name. The inner maps consist of options and their values. For instance, to read a configuration file, giving it access to certain command line parameters, you could do something like this:

    object Foo {
      def main(args: Array[String]) = {
        // You'd obviously want to do some real argument checking here.
        val configFile = args(0)
        val name = args(1)
        val ipAddress = args(2)
        val sections = Map("args" -> Map("name" -> name, "ip" -> ipAddress))
        val config = Configuration(Source.fromFile(new File(configFile)), sections)
        ...
      }
    }
    
    source

    scala.io.Source object to read

    sections

    the predefined sections. An empty map means there are no predefined sections.

    safe

    Whether an exception should be thrown for bad variable substitutions (false) or not (true). Default: false

    sectionNamePattern

    Regular expression that matches legal section names.

    commentPattern

    Regular expression that matches comment lines.

    returns

    the Configuration object.

  9. def apply(source: Source, sections: Map[String, Map[String, String]]): Configuration

    Read a configuration file, permitting some predefined sections to be added to the configuration before it is read.

    Read a configuration file, permitting some predefined sections to be added to the configuration before it is read. The predefined sections are defined in a map of maps. The outer map is keyed by predefined section name. The inner maps consist of options and their values. For instance, to read a configuration file, giving it access to certain command line parameters, you could do something like this:

    object Foo {
      def main(args: Array[String]) = {
        // You'd obviously want to do some real argument checking here.
        val configFile = args(0)
        val name = args(1)
        val ipAddress = args(2)
        val sections = Map("args" -> Map("name" -> name, "ip" -> ipAddress))
        val config = Configuration(Source.fromFile(new File(configFile)), sections)
        ...
      }
    }
    
    source

    scala.io.Source object to read

    sections

    the predefined sections. An empty map means there are no predefined sections.

    returns

    the Configuration object.

  10. def apply(source: Source, safe: Boolean = false, sectionNamePattern: Regex = ..., commentPattern: Regex = Configuration.DefaultCommentPattern): Configuration

    Read a configuration file.

    Read a configuration file.

    source

    scala.io.Source object to read

    safe

    Whether an exception should be thrown for bad variable substitutions (false) or not (true). Default: false

    sectionNamePattern

    Regular expression that matches legal section names. Defaults as described above.

    commentPattern

    Regular expression that matches comment lines. Default: ^\s*(#.*)$

    returns

    the Configuration object.

  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  25. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any