public class DefaultPropertyUtil extends Object
Constructor and Description |
---|
DefaultPropertyUtil() |
Modifier and Type | Method and Description |
---|---|
static Object |
createTypedValue(Class<?> type,
String defaultValue)
Create a custom Field Object based on the Type and defaultValue.
|
static Object |
createTypedValue(String fieldType,
String defaultValue)
Deprecated.
since 5.1. use
createTypedValue(Class, String) instead. |
static Class<?> |
getFieldTypeClass(int fieldType)
Return the related Class for a desired Type.
|
static Class<?> |
getFieldTypeClass(String fieldType)
Return the related Class for a desired Type by String.
|
static <T> DefaultProperty<T> |
newDefaultProperty(Class<T> type,
String defaultValue)
Create a DefaultProperty and set the defaultValue after conversion.
|
static DefaultProperty |
newDefaultProperty(int fieldType,
Object value)
Deprecated.
since 5.1. use
newDefaultProperty(Class, String) instead. |
static DefaultProperty |
newDefaultProperty(String fieldType,
String stringValue)
Deprecated.
since 5.1. use
newDefaultProperty(Class, String) instead. |
public static <T> DefaultProperty<T> newDefaultProperty(Class<T> type, String defaultValue)
@Deprecated public static DefaultProperty newDefaultProperty(String fieldType, String stringValue) throws NumberFormatException
newDefaultProperty(Class, String)
instead.NumberFormatException
@Deprecated public static DefaultProperty newDefaultProperty(int fieldType, Object value) throws NumberFormatException
newDefaultProperty(Class, String)
instead.PropertyType
.NumberFormatException
@Deprecated public static Object createTypedValue(String fieldType, String defaultValue) throws NumberFormatException
createTypedValue(Class, String)
instead.NumberFormatException
- In case of the default value could not be parsed to the desired class.public static Object createTypedValue(Class<?> type, String defaultValue) throws NumberFormatException
NumberFormatException
- In case of the default value could not be parsed to the desired class.public static Class<?> getFieldTypeClass(String fieldType)
PropertyType
to read the type from the String.
If no fieldType is defined, the default is String.IllegalArgumentException
- if the Type is not supported.public static Class<?> getFieldTypeClass(int fieldType)
IllegalArgumentException
- if the Type is not supported.Copyright © 2015 Magnolia International Ltd.. All rights reserved.