Top Description Inners Constructors Methods
org.eclipse.persistence.config

public Class PropertiesUtils

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, java.util.ArrayList, .List, org.eclipse.persistence.exceptions.ConversionException, org.eclipse.persistence.internal.security.PrivilegedAccessHelper

A static utility class that handles parsing a String "key=value,key1=value1...." and calls an appropriate set[key]([value]) method on the provided instance.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static PropertiesUtils.MethodMatch
private static Method[]
getMethods(Class<?> cls)

private static List<Method>
getMethodsMatchingName(Object instance, String methodName)

private static Object
invokeMethod(Method method, Object instance, Object... params)

private static void
processKeyValue(Object instance, String propertyName, String kv)

public static void
set(Object
An JavaBean instance
instance
,
String
The configuration name that is being set into instance. This is only used for informational purposes.
propertyName
,
String
A String of key=value comma delimited ie: k1=v1,k2=v2,...
kvs
)

Attempts to parse and then set the provided kvs String into the appropriate set method on the provided instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropertiesUtilsback to summary
public PropertiesUtils()

Method Detail

getMethodMatchingParameterback to summary
private static PropertiesUtils.MethodMatch getMethodMatchingParameter(List<Method> methods, String parameter) throws Exception
getMethodsback to summary
private static Method[] getMethods(Class<?> cls)
getMethodsMatchingNameback to summary
private static List<Method> getMethodsMatchingName(Object instance, String methodName)
invokeMethodback to summary
private static Object invokeMethod(Method method, Object instance, Object... params) throws Exception
processKeyValueback to summary
private static void processKeyValue(Object instance, String propertyName, String kv)
setback to summary
public static void set(Object instance, String propertyName, String kvs)

Attempts to parse and then set the provided kvs String into the appropriate set method on the provided instance.

Note

Keys and values cannot contain '=' or ','

Parameters
instance:Object

An JavaBean instance

propertyName:String

The configuration name that is being set into instance. This is only used for informational purposes.

kvs:String

A String of key=value comma delimited ie: k1=v1,k2=v2,...

Exceptions
ConversionException:
if unable to process the provided kvs
org.eclipse.persistence.config back to summary

private Class PropertiesUtils.MethodMatch

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Method
pack-priv final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Method
public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

methodback to summary
pack-priv final Method method
parsedValueback to summary
pack-priv final Object parsedValue

Constructor Detail

MethodMatchback to summary
public MethodMatch(Method m, Object p)

Method Detail

getMethodback to summary
public Method getMethod()
getParsedValueback to summary
public Object getParsedValue()