de.esprit.appsuite.nio.ndf

## Class NdfProperties

- 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.appsuite.nio.ndf.NdfProperties

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

      public class NdfProperties
      extends PowerMap<java.lang.String,java.lang.Object>
      implements NdfConstants

  This map stores NDF property values either as Strings or java object data types. Even multiple values like String[] or List<String> are supported. Various access methods allow for fetching a readily typed property value for convenience.
  Note that this map serves a a two way converter from Object to String and from String to Object respectively. The `NdfWriter` puts Objects into it and writes them as Strings whereas the `NdfParser` puts Strings into it which you may retrieve as Objects.
  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>`

  - ### Field Summary

    - ### Fields inherited from interface de.esprit.appsuite.nio.ndf.NdfConstants

      `allowedInNames, blockCommentChar, booleanFalseChar, booleanFalseLiteral, booleanTrueChar, booleanTrueLiteral, currentNdfDocVersion, defaultTextEndChar, defaultTextParagraphChar, lineCommentChar, ndfDocAuthorKey, ndfDocCreatedKey, ndfDocEncodingKey, ndfDocTypeKey, ndfDocVersionKey, nullLiteral, quotingBreakCodes, standardBreakCodes, structureChar, textValueBreakCodes, validTextBreakSymbols`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NdfProperties()`
    `NdfProperties(java.util.Map<java.lang.String,java.lang.Object> props)`
    `NdfProperties(java.lang.String key, java.lang.Object value)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkForUnrequestedKeys()` Checks if all property keys have been requested.
    `void` | `checkForUnsupportedKeys(java.util.List<java.lang.String> supportedkeys)` Checks the property keys for invalid unsupported keys.
    `void` | `checkKeyExists(java.lang.String key)` Throws an Exception if the given required key does not exist.
    `void` | `checkValueExistsFor(java.lang.String key)` Throws an Exception if no value exists for the given required key.
    `NdfProperties` | `clone()`
    `boolean` | `equals(java.lang.Object obj)` Checks equality by comparing all property values explicitly.
    `java.lang.Object` | `get(java.lang.Object key)`
    `java.lang.String[]` | `getAsArray(java.lang.String key)`
    `boolean` | `getAsBoolean(java.lang.String key)`
    `java.util.List<java.lang.String>` | `getAsList(java.lang.String key)`
    `java.lang.Object` | `put(java.lang.String key, java.util.List<java.lang.String> list)` Allows for putting a List of String values.
    `java.lang.Object` | `put(java.lang.String key, java.lang.Object... values)` Note that all Object-values should have a reasonable String representation because they are actually stored as a list of Strings.
    `java.lang.Object` | `put(java.lang.String key, java.lang.String[] values)` Allows for putting an array of String values.

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

      `createDumpHeader, 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, toString`

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

      `clear, containsValue, removeEldestEntry`

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

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

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

      `hashCode`

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

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

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

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

- - ### Constructor Detail

    - #### NdfProperties

          public NdfProperties()

    - #### NdfProperties

          public NdfProperties(java.util.Map<java.lang.String,java.lang.Object> props)

    - #### NdfProperties

          public NdfProperties(java.lang.String key,
                       java.lang.Object value)

  - ### Method Detail

    - #### get

          public java.lang.Object get(java.lang.Object key)

      Specified by:
        `get` in interface `java.util.Map<java.lang.String,java.lang.Object>`
      Overrides:
        `get` in class `java.util.LinkedHashMap<java.lang.String,java.lang.Object>`

    - #### put

          public final java.lang.Object put(java.lang.String key,
                             java.lang.Object... values)

      Note that all Object-values should have a reasonable String representation because they are actually stored as a list of Strings.
      Returns:
        the previous value associated with `key`, or `null` if there was no mapping for `key`.

    - #### put

          public final java.lang.Object put(java.lang.String key,
                             java.util.List<java.lang.String> list)

      Allows for putting a List of String values.

    - #### put

          public final java.lang.Object put(java.lang.String key,
                             java.lang.String[] values)

      Allows for putting an array of String values.

    - #### getAsBoolean

          public final boolean getAsBoolean(java.lang.String key)

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

    - #### getAsList

          public final java.util.List<java.lang.String> getAsList(java.lang.String key)

    - #### getAsArray

          public final java.lang.String[] getAsArray(java.lang.String key)

    - #### checkKeyExists

          public final void checkKeyExists(java.lang.String key)
                                    throws java.lang.Exception

      Throws an Exception if the given required key does not exist.
      Throws:
        `java.lang.Exception`

    - #### checkValueExistsFor

          public final void checkValueExistsFor(java.lang.String key)
                                         throws java.lang.Exception

      Throws an Exception if no value exists for the given required key.
      Throws:
        `java.lang.Exception`

    - #### checkForUnsupportedKeys

          public void checkForUnsupportedKeys(java.util.List<java.lang.String> supportedkeys)
                                       throws UnsupportedPropertyKeyException

      Checks the property keys for invalid unsupported keys. Only the given keys are considered to be valid.
      Throws:
        `UnsupportedPropertyKeyException`

    - #### checkForUnrequestedKeys

          public void checkForUnrequestedKeys()
                                       throws UnrequestedPropertyKeyException

      Checks if all property keys have been requested. Not requested keys are considered to be invalid.
      Throws:
        `UnrequestedPropertyKeyException`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Checks equality by comparing all property values explicitly.
      Specified by:
        `equals` in interface `java.util.Map<java.lang.String,java.lang.Object>`
      Overrides:
        `equals` in class `java.util.AbstractMap<java.lang.String,java.lang.Object>`

    - #### clone

          public NdfProperties clone()

      Overrides:
        `clone` in class `java.util.HashMap<java.lang.String,java.lang.Object>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.