com.emarsys.ecommon.prefs.config
Enum Configuration.Type

java.lang.Object
  extended by java.lang.Enum<Configuration.Type>
      extended by com.emarsys.ecommon.prefs.config.Configuration.Type
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Configuration.Type>
Enclosing class:
Configuration

public static enum Configuration.Type
extends java.lang.Enum<Configuration.Type>

Defines different Configuration.Types of concrete Configuration instances.

A Configuration's Configuration.Type describes its main characteristics and functionality and is also responsible for creating .

Author:
Michael "kULO" Kulovits

Enum Constant Summary
DEFAULT
          Describes a Configuration that supports default values.
FALLBACK
          Describes a Configuration that supports fallback values.
FALLBACK_DEFAULT
          Describes a Configuration that supports fallback and default values .
RAW
          Describes a pretty much "unspecified" Configuration we do know nothing about.
 
Method Summary
abstract  ConfigurationBackend createConfigBackend(ConfigurationBackend config, ConfigurationDeclaration declaration)
          An abstract factory method that is used to initialze a Configuration's backend according to this Configuration.Type as well as the ConfigurationDeclaration passed.
static Configuration.Type valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Configuration.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

RAW

public static final Configuration.Type RAW
Describes a pretty much "unspecified" Configuration we do know nothing about. Neither default values nor fallback settings might be supported.


DEFAULT

public static final Configuration.Type DEFAULT
Describes a Configuration that supports default values.


FALLBACK

public static final Configuration.Type FALLBACK
Describes a Configuration that supports fallback values.


FALLBACK_DEFAULT

public static final Configuration.Type FALLBACK_DEFAULT
Describes a Configuration that supports fallback and default values . The priority chain used for setting resolution is the following: primary setting --> fallback --> default --> fallback-default

Method Detail

values

public static Configuration.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Configuration.Type c : Configuration.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Configuration.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

createConfigBackend

public abstract ConfigurationBackend createConfigBackend(ConfigurationBackend config,
                                                         ConfigurationDeclaration declaration)
An abstract factory method that is used to initialze a Configuration's backend according to this Configuration.Type as well as the ConfigurationDeclaration passed. The created backend will use the passed instance as its primary source.

Parameters:
config - - the primary backend of the Configuration
declaration - - the declaration of the Configuration
Returns:
always a valid ConfigurationBackend, never null


Copyright © 2010 emarsys AG. All Rights Reserved.