de.esprit.common.util

## Class FileParams

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<K,V>
    - - java.util.LinkedHashMap<K,V>
      - - de.esprit.common.util.PowerMap<java.lang.String,java.lang.Object>
        - - de.esprit.common.util.PropertyMap
          - - de.esprit.common.util.FileParams

- All Implemented Interfaces:
    Dumpable, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>

      public class FileParams
      extends PropertyMap

  This class reads key-value parameters from the given parameter file
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileParams(java.io.File paramsFile)`
    `FileParams(java.lang.String fileName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `createDumpHeader()`
    `java.io.File` | `getFile()`
    `FileInfo` | `getFileInfo()`
    `boolean` | `getRequiredBoolean(java.lang.String key)`
    `int` | `getRequiredInt(java.lang.String key)`
    `java.lang.String` | `getRequiredString(java.lang.String key)`
    `void` | `load()` Adds the key-value pairs from the given file to the list
    `void` | `save()` Saves the current key-value pairs in the file they where loaded from.
    `void` | `save(java.util.List<java.lang.String> headLines)` Saves the current key-value pairs in the file they where loaded from.
    `void` | `save(java.lang.String headLine)`
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.

    - ### Methods inherited from class de.esprit.common.util.PropertyMap

      `clone, loadFrom, loadFrom, saveTo, saveTo, saveTo`

    - ### Methods inherited from class de.esprit.common.util.PowerMap

      `getAsBoolean, getAsBoolean, getAsDate, getAsDate, getAsDouble, getAsDouble, getAsDuration, getAsDuration, getAsFloat, getAsFloat, getAsInt, getAsInt, getAsLong, getAsLong, getAsShort, getAsShort, getAsString, getAsString, getAsTime, getAsTime, getAsTimestamp, getAsTimestamp, getMaxKeyLength, reverse, toDumpString, toDumpString, toString`

    - ### Methods inherited from class java.util.LinkedHashMap

      `clear, containsValue, get, removeEldestEntry`

    - ### Methods inherited from class java.util.HashMap

      `containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

- - ### Constructor Detail

    - #### FileParams

          public FileParams(java.lang.String fileName)
                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### FileParams

          public FileParams(java.io.File paramsFile)
                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### load

          public void load()
                    throws java.io.IOException

      Adds the key-value pairs from the given file to the list
      Throws:
        `java.io.IOException`

    - #### save

          public void save()
                    throws java.io.IOException

      Saves the current key-value pairs in the file they where loaded from.
      Throws:
        `java.io.IOException`

    - #### save

          public void save(java.lang.String headLine)
                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### save

          public void save(java.util.List<java.lang.String> headLines)
                    throws java.io.IOException

      Saves the current key-value pairs in the file they where loaded from.
      Throws:
        `java.io.IOException`

    - #### getFile

          public java.io.File getFile()

    - #### getFileInfo

          public FileInfo getFileInfo()

    - #### getRequiredString

          public java.lang.String getRequiredString(java.lang.String key)
                                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getRequiredInt

          public int getRequiredInt(java.lang.String key)
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getRequiredBoolean

          public boolean getRequiredBoolean(java.lang.String key)
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `PowerMap<java.lang.String,java.lang.Object>`

    - #### createDumpHeader

          protected java.lang.String createDumpHeader()

      Overrides:
        `createDumpHeader` in class `PowerMap<java.lang.String,java.lang.Object>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.