Package edu.vt.middleware.ldap.props
Class ConfigParser
- java.lang.Object
-
- edu.vt.middleware.ldap.props.ConfigParser
-
public class ConfigParser extends java.lang.ObjectParses 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 20:48:01 +0200 (Wed, 18 Aug 2010) $
- Author:
- Middleware Services
-
-
Constructor Summary
Constructors Constructor Description ConfigParser(java.lang.String config)Creates a newConfigParserwith the supplied configuration string.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClassName()Returns the class name from the configuration.java.util.Map<java.lang.String,java.lang.String>getProperties()Returns the properties from the configuration.java.lang.ObjectinitializeType()Initialize an instance of the class type with the properties contained in this config.static booleanisConfig(java.lang.String config)Returns whether the supplied configuration data contains a config.protected voidsetProperties(java.lang.Class<?> c, java.lang.Object o)Sets the properties on the supplied object.
-
-
-
Method Detail
-
getClassName
public java.lang.String getClassName()
Returns the class name from the configuration.- Returns:
Stringclass name
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
Returns the properties from the configuration.- Returns:
Mapof property name to value
-
isConfig
public static boolean isConfig(java.lang.String config)
Returns whether the supplied configuration data contains a config.- Parameters:
config-String- Returns:
boolean
-
initializeType
public java.lang.Object initializeType()
Initialize an instance of the class type with the properties contained in this config.- Returns:
Objectof the type the config parsed
-
setProperties
protected void setProperties(java.lang.Class<?> c, java.lang.Object o)Sets the properties on the supplied object.- Parameters:
c-Classtype of the supplied objecto-Objectto invoke properties on
-
-