Class PropertyHelper
java.lang.Object
org.camunda.bpm.container.impl.metadata.PropertyHelper
- Author:
- Daniel Meyer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
protected static final ContainerIntegrationLogger
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyProperties
(Object configuration, Map<String, String> properties) Sets an objects fields via reflection from String values.static void
Sets an objects fields via reflection from String values.static void
applyProperty
(Object configuration, String key, String stringValue) protected static String
convertToCamelCase
(String value, String token) static Object
convertToClass
(String value, Class<?> clazz) Converts a value to the type of the given field.static boolean
getBooleanProperty
(Map<String, String> properties, String name, boolean defaultValue) static String
resolveProperty
(Properties props, String original) Replaces Ant-style property references if the corresponding keys exist in the providedProperties
.
-
Field Details
-
LOG
-
KEBAB_CASE
- See Also:
-
SNAKE_CASE
- See Also:
-
CAMEL_CASE
- See Also:
-
-
Constructor Details
-
PropertyHelper
public PropertyHelper()
-
-
Method Details
-
getBooleanProperty
-
convertToClass
Converts a value to the type of the given field.- Parameters:
value
-field
-- Returns:
-
applyProperty
-
applyProperties
public static void applyProperties(Object configuration, Map<String, String> properties, String namingStrategy) Sets an objects fields via reflection from String values. Depending on the field's type the respective values are converted to int or boolean. This method allows to specify a property naming strategy, i.e., if a property is written incamelCase
,kebab-case
, orsnake_case
.- Parameters:
configuration
-properties
-namingStrategy
- can be eitherKEBAB_CASE
,SNAKE_CASE
, orCAMEL_CASE
.- Throws:
ProcessEngineException
- if a property is supplied that matches no field or if the field's type is not String, nor int, nor boolean.
-
applyProperties
Sets an objects fields via reflection from String values. Depending on the field's type the respective values are converted to int or boolean.- Parameters:
configuration
-properties
-- Throws:
ProcessEngineException
- if a property is supplied that matches no field or if the field's type is not String, nor int, nor boolean.
-
resolveProperty
Replaces Ant-style property references if the corresponding keys exist in the providedProperties
.- Parameters:
props
- contains possible replacementsoriginal
- may contain Ant-style templates- Returns:
- the original string with replaced properties or the unchanged original string if no placeholder found.
-
convertToCamelCase
-