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. def != (arg0: AnyRef): Boolean

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

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

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

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

    Attributes
    final
    Definition Classes
    Any
  6. val DefaultCommentPattern : Regex

    Attributes
    final
  7. val DefaultSectionNamePattern : Regex

    Attributes
    final
  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. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  12. def clone (): AnyRef

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

    Attributes
    final
    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. def getClass (): java.lang.Class[_]

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

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

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

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
  23. def toString (): String

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any