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