|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.props.PropertyValueParser
public class PropertyValueParser
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}}
If the class name is supplied to the constructor, the property string need not contain the class declaration.
| Field Summary | |
|---|---|
protected static Pattern |
CONFIG_PATTERN
Property string containing configuration. |
protected org.slf4j.Logger |
logger
Logger for this class. |
protected static Pattern |
PARAMS_ONLY_CONFIG_PATTERN
Property string for configuring a config where the class is known. |
protected static Pattern |
PROPERTY_PATTERN
Pattern for finding properties. |
| Constructor Summary | |
|---|---|
protected |
PropertyValueParser()
Default constructor. |
|
PropertyValueParser(String config)
Creates a new config parser. |
|
PropertyValueParser(String config,
String clazz)
Creates a new config parser. |
| Method Summary | |
|---|---|
String |
getClassName()
Returns the class name of the object to initialize. |
Map<String,String> |
getProperties()
Returns the properties from the configuration. |
protected void |
initialize(String clazz,
String props)
Invokes setClassName(String) and initializeProperties(Matcher). |
protected void |
initializeProperties(Matcher matcher)
Finds all the matches in the supplied matcher puts them into the properties map. |
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. |
static boolean |
isParamsOnlyConfig(String config)
Returns whether the supplied configuration data contains a params only config. |
protected void |
setClassName(String name)
Sets the class name of the object to initialize. |
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 |
| Field Detail |
|---|
protected static final Pattern CONFIG_PATTERN
protected static final Pattern PARAMS_ONLY_CONFIG_PATTERN
protected static final Pattern PROPERTY_PATTERN
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
protected PropertyValueParser()
public PropertyValueParser(String config)
config - containing configuration data
public PropertyValueParser(String config,
String clazz)
config - containing configuration dataclazz - fully qualified class name| Method Detail |
|---|
protected void initialize(String clazz,
String props)
setClassName(String) and initializeProperties(Matcher).
clazz - type to create and initializeprops - to set on the classprotected void initializeProperties(Matcher matcher)
matcher - to find matchespublic String getClassName()
protected void setClassName(String name)
name - of the object class typepublic Map<String,String> getProperties()
public static boolean isConfig(String config)
config - containing configuration data
public static boolean isParamsOnlyConfig(String config)
config - containing configuration data
public Object initializeType()
protected void setProperties(Class<?> c,
Object o)
c - type of the supplied objecto - to invoke properties on
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||