net.sf.eos.util.functions
Class ConfigurationKeyIntrospectorFunction

java.lang.Object
  extended by net.sf.eos.util.functions.ConfigurationKeyIntrospectorFunction
All Implemented Interfaces:
Function<ConfigurationKeyIntrospectorFunction.ConfigurationKeySupport,ConfigurationKey>

@Experimental
public class ConfigurationKeyIntrospectorFunction
extends Object
implements Function<ConfigurationKeyIntrospectorFunction.ConfigurationKeySupport,ConfigurationKey>

Extracts a ConfigurationKey from a given type with a specified value. The implementation only intrspects field which are public, final and static. Otherwise the key will be ignored. Use this function with DefaultValueConfigurationKeyFunction to get the default value of a ConfigurationKey.

Since:
0.1.0
Version:
0.1.0
Author:
Sascha Kohlmann

Nested Class Summary
static class ConfigurationKeyIntrospectorFunction.ConfigurationKeySupport
          Simple holder for reflection data.
 
Constructor Summary
ConfigurationKeyIntrospectorFunction()
           
 
Method Summary
 ConfigurationKey apply(ConfigurationKeyIntrospectorFunction.ConfigurationKeySupport from)
          Extracts the ConfigurationKey from the given class with the specified value of the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.eos.Function
equals
 

Constructor Detail

ConfigurationKeyIntrospectorFunction

public ConfigurationKeyIntrospectorFunction()
Method Detail

apply

public ConfigurationKey apply(@Nullable
                              ConfigurationKeyIntrospectorFunction.ConfigurationKeySupport from)
Extracts the ConfigurationKey from the given class with the specified value of the key.

Specified by:
apply in interface Function<ConfigurationKeyIntrospectorFunction.ConfigurationKeySupport,ConfigurationKey>
Parameters:
from - the instance holds the data to refelect the ConfigurationKey
Returns:
a ConfigurationKey if the function is able to reflect it. Otherwise null.


Copyright © 2008. All Rights Reserved.