com.atlassian.crowd.integration.osuser
Class PropertyParser

java.lang.Object
  extended by com.atlassian.crowd.integration.osuser.PropertyParser

public class PropertyParser
extends java.lang.Object

Parses properties and groups them based on a prefix.


Nested Class Summary
static class PropertyParser.Pair
          This class implements the holder for the property sort key and suffix.
static interface PropertyParser.Result
          This interface represents a result of parsing that contains a paresed class and a set of properties.
protected static class PropertyParser.ValueHolder
          This is a holder for a key-pair and the property value.
 
Constructor Summary
PropertyParser(java.lang.String prefix)
          Creates a new instance of this class initialized with a given prefix
 
Method Summary
protected  java.util.List filterAndSortValidProperties(java.util.Properties properties)
          This method filters out all properties that do not follow the required patter.
 java.util.List parse(java.util.Properties properties)
          Parses given properties and creates a list of PropertyParser.Result objects.
 PropertyParser.Pair parseKey(java.lang.String key)
          Parses the property with a given name and returns pair containing the sort key and suffix if any found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyParser

public PropertyParser(java.lang.String prefix)
Creates a new instance of this class initialized with a given prefix

Parameters:
prefix - property name prefix
Method Detail

parse

public java.util.List parse(java.util.Properties properties)
Parses given properties and creates a list of PropertyParser.Result objects.

Parameters:
properties - properties to parse
Returns:
a list of PropertyParser.Result objects

filterAndSortValidProperties

protected java.util.List filterAndSortValidProperties(java.util.Properties properties)
This method filters out all properties that do not follow the required patter. All valid properties are sorted before they are returned from this method.

Parameters:
properties - properties to filter and sort
Returns:
a sorted list of valid properties

parseKey

public PropertyParser.Pair parseKey(java.lang.String key)
Parses the property with a given name and returns pair containing the sort key and suffix if any found.

Parameters:
key - property key
Returns:
pair or null if the given key does not math the pattern of this property parser


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.