Package io.jans.configapi.core.util
Class DataUtil
- java.lang.Object
-
- io.jans.configapi.core.util.DataUtil
-
@ApplicationScoped @Named("dataUtil") public class DataUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description DataUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
containsField(List<Field> allFields, String attribute)
static List<io.jans.orm.search.filter.Filter>
createFilter(List<io.jans.model.FieldFilterData> fieldFilterData, String primaryKey, io.jans.orm.PersistenceEntryManager persistenceEntryManager)
static Date
decodeStringDate(String dateString, String primaryKey, io.jans.orm.PersistenceEntryManager persistenceEntryManager)
static String
encodeDate(Date date, String primaryKey, io.jans.orm.PersistenceEntryManager persistenceEntryManager)
static Date
formatStrDate(String dateString, String datePattern)
static List<Field>
getAllFields(Class<?> type)
static List<Field>
getAllFields(List<Field> fields, Class<?> type)
static Map<String,String>
getFieldDataType(Class<?> clazz, List<String> fieldList)
static Map<String,String>
getFieldType(Class<?> clazz, List<io.jans.model.FieldFilterData> fieldFilterData)
static Map<String,String>
getFieldTypeMap(Class<?> clazz)
static io.jans.orm.reflect.property.Getter
getGetterMethod(Class<?> clazz, String name)
static LocalDateTime
getIso8601Date(String dateString, String pattern)
static Class<?>
getPropertType(String className, String name)
static Method
getSetter(String fieldName, Class<?> clazz)
static io.jans.orm.reflect.property.Setter
getSetterMethod(Class<?> clazz, String name)
static Object
getValue(Object object, String property)
static Object
invokeGetterMethod(Object obj, String variableName)
static Object
invokeMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
Object
invokeReflectionGetter(Object obj, String variableName)
static void
invokeReflectionSetter(Object obj, String propertyName, Object variableValue)
static boolean
isAttributeInExclusion(String className, String attribute, Map<String,List<String>> exclusionMap)
static boolean
isKeyPresentInMap(String key, Map<String,String> map)
boolean
isStringField(Map<String,String> objectPropertyMap, String attribute)
-
-
-
Method Detail
-
getPropertType
public static Class<?> getPropertType(String className, String name) throws io.jans.orm.exception.MappingException
- Throws:
io.jans.orm.exception.MappingException
-
getGetterMethod
public static io.jans.orm.reflect.property.Getter getGetterMethod(Class<?> clazz, String name) throws io.jans.orm.exception.MappingException
- Throws:
io.jans.orm.exception.MappingException
-
getSetterMethod
public static io.jans.orm.reflect.property.Setter getSetterMethod(Class<?> clazz, String name) throws io.jans.orm.exception.MappingException
- Throws:
io.jans.orm.exception.MappingException
-
getValue
public static Object getValue(Object object, String property) throws io.jans.orm.exception.MappingException
- Throws:
io.jans.orm.exception.MappingException
-
getSetter
public static Method getSetter(String fieldName, Class<?> clazz) throws IntrospectionException
- Throws:
IntrospectionException
-
invokeMethod
public static Object invokeMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
-
invokeReflectionSetter
public static void invokeReflectionSetter(Object obj, String propertyName, Object variableValue)
-
isStringField
public boolean isStringField(Map<String,String> objectPropertyMap, String attribute)
-
isAttributeInExclusion
public static boolean isAttributeInExclusion(String className, String attribute, Map<String,List<String>> exclusionMap)
-
getFieldDataType
public static Map<String,String> getFieldDataType(Class<?> clazz, List<String> fieldList)
-
getFieldType
public static Map<String,String> getFieldType(Class<?> clazz, List<io.jans.model.FieldFilterData> fieldFilterData)
-
createFilter
public static List<io.jans.orm.search.filter.Filter> createFilter(List<io.jans.model.FieldFilterData> fieldFilterData, String primaryKey, io.jans.orm.PersistenceEntryManager persistenceEntryManager)
-
encodeDate
public static String encodeDate(Date date, String primaryKey, io.jans.orm.PersistenceEntryManager persistenceEntryManager)
-
decodeStringDate
public static Date decodeStringDate(String dateString, String primaryKey, io.jans.orm.PersistenceEntryManager persistenceEntryManager)
-
getIso8601Date
public static LocalDateTime getIso8601Date(String dateString, String pattern)
-
-