de.smartics.properties.spi.config.domain.key
Class PropertyResourceMatchers

Package class diagram package PropertyResourceMatchers
java.lang.Object
  extended by de.smartics.properties.spi.config.domain.key.PropertyResourceMatchers
All Implemented Interfaces:
Serializable

public final class PropertyResourceMatchers
     
     
extends Object
implements Serializable

A collection of matchers to determine a configuration key for a properties resource.

See Also:
Serialized Form

Constructor Summary
PropertyResourceMatchers()
          Convenience constructor for a matcher that matches nothing.
PropertyResourceMatchers(ConfigurationKey<?> anyKey, List<PropertiesResourceMatcher> matchers)
          Default constructor.
 
Method Summary
 ConfigurationKey<?> getKey(String resourceId)
          Returns the key for the given resource identifier.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyResourceMatchers

public PropertyResourceMatchers()
Convenience constructor for a matcher that matches nothing.


PropertyResourceMatchers

public PropertyResourceMatchers(ConfigurationKey<?> anyKey,
                                List<PropertiesResourceMatcher> matchers)
                         throws NullPointerException
Default constructor.

Parameters:
anyKey - the default key to match if none of the matchers can be applied. May be null.
matchers - the matchers for mapping properties resources (file path names) to a configuration key.
Throws:
NullPointerException - if matchers is null.
Method Detail

getKey

public ConfigurationKey<?> getKey(String resourceId)
Returns the key for the given resource identifier.

Parameters:
resourceId - the identifier of a resource. Usually the path to a properties file within an archive.
Returns:
the configuration key the resource is associated with or the default anyKey if none is registered for the given resourceId. The default key may be null.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.