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

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

public final class PathMatcher
     
     
extends Object
implements PropertiesResourceMatcher

Matches a path that may contain wildcards at the end of the path.

See Also:
Serialized Form

Nested Class Summary
static class PathMatcher.Matcher
          Matcher of a single path.
 
Method Summary
static PathMatcher forMatchers(ConfigurationKey<?> configurationKey, List<PathMatcher.Matcher> matchers)
          Constructs an instance based on the given matchers.
static PathMatcher forPaths(ConfigurationKey<?> configurationKey, List<String> paths)
          Constructs an instance based on the given paths.
 ConfigurationKey<?> getConfigurationKey()
          Returns the configuration key the matcher is responsible for.
 boolean match(String id)
          Matches the identifier with the matchers algorithm.
 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
 

Method Detail

forPaths

public static PathMatcher forPaths(ConfigurationKey<?> configurationKey,
                                   List<String> paths)
Constructs an instance based on the given paths.

Parameters:
configurationKey - the configuration key the matcher is responsible for.
paths - the list of paths to match. A path may end with * signaling a wildcard match.
Returns:
the constructed instance.

forMatchers

public static PathMatcher forMatchers(ConfigurationKey<?> configurationKey,
                                      List<PathMatcher.Matcher> matchers)
Constructs an instance based on the given matchers.

Parameters:
configurationKey - the configuration key the matcher is responsible for.
matchers - the matchers to use for matching.
Returns:
the constructed instance.

getConfigurationKey

public ConfigurationKey<?> getConfigurationKey()
Returns the configuration key the matcher is responsible for.

Specified by:
getConfigurationKey in interface PropertiesResourceMatcher
Returns:
the configuration key the matcher is responsible for.

match

public boolean match(String id)
Description copied from interface: PropertiesResourceMatcher
Matches the identifier with the matchers algorithm.

Specified by:
match in interface PropertiesResourceMatcher
Parameters:
id - the identifier of the resource.
Returns:
true if the matcher matches the id, false otherwise.

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.