edu.vt.middleware.ldap.props
Class ConfigParser

java.lang.Object
  extended by edu.vt.middleware.ldap.props.ConfigParser

public class ConfigParser
extends Object

Parses the configuration data associated with classes that contain setter properties. The format of the property string should be like:

   MyClass{{propertyOne=foo}{propertyTwo=bar}}
 

Version:
$Revision: 1501 $ $Date: 2010-08-18 14:48:01 -0400 (Wed, 18 Aug 2010) $
Author:
Middleware Services

Constructor Summary
ConfigParser(String config)
          Creates a new ConfigParser with the supplied configuration string.
 
Method Summary
 String getClassName()
          Returns the class name from the configuration.
 Map<String,String> getProperties()
          Returns the properties from the configuration.
 Object initializeType()
          Initialize an instance of the class type with the properties contained in this config.
static boolean isConfig(String config)
          Returns whether the supplied configuration data contains a config.
protected  void setProperties(Class<?> c, Object o)
          Sets the properties on the supplied object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigParser

public ConfigParser(String config)
Creates a new ConfigParser with the supplied configuration string.

Parameters:
config - String
Method Detail

getClassName

public String getClassName()
Returns the class name from the configuration.

Returns:
String class name

getProperties

public Map<String,String> getProperties()
Returns the properties from the configuration.

Returns:
Map of property name to value

isConfig

public static boolean isConfig(String config)
Returns whether the supplied configuration data contains a config.

Parameters:
config - String
Returns:
boolean

initializeType

public Object initializeType()
Initialize an instance of the class type with the properties contained in this config.

Returns:
Object of the type the config parsed

setProperties

protected void setProperties(Class<?> c,
                             Object o)
Sets the properties on the supplied object.

Parameters:
c - Class type of the supplied object
o - Object to invoke properties on


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.