public class DefaultDataRepresentationService extends Object implements DataRepresentationService
DataRepresentationService
Modifier and Type | Field and Description |
---|---|
static String |
BATCHEE_DATA_PREFIX |
static String |
BATCHEE_SPLIT_TOKEN |
Constructor and Description |
---|
DefaultDataRepresentationService() |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
convertBackJava7DateTypes(String typeVal,
String valueVal) |
protected <T> T |
convertBackJavaNativeTypes(String typeVal,
String value) |
protected <T> T |
convertBackSerializableObjectTypes(byte[] internalRepresentation) |
protected <T> byte[] |
convertCustomTypes(T dataObject)
This is an extension point for other serialisation algorithms.
|
protected <T> byte[] |
convertJava7DateTypes(T dataObject)
Convert javas internal Date objects to db representation.
|
protected <T> byte[] |
convertJavaNativeTypes(T dataObject)
This method converts java native types to a 'nice' string representation
which will be stored in the database.
|
protected <T> byte[] |
convertSerializableObjectTypes(T dataObject)
This is the default operation if no other way to serialise the data was used
|
protected ClassLoader |
getClassLoader() |
protected SimpleDateFormat |
getSimpleDateFormat() |
protected SimpleDateFormat |
getTimestampDateFormat()
Attention: The nanos must get concatenated separately as there is no formatter for nanos!
|
void |
init(Properties batchConfig) |
protected Object |
invokeStaticMethod(String typeVal,
String methodName,
Class paramType,
String valueVal) |
protected byte[] |
toBatchEeData(Class<?> type,
String stringRepresentation) |
<T> byte[] |
toInternalRepresentation(T dataObject)
Convert the given dataObject into something which can be stored
in a BLOB in the database.
|
<T> T |
toJavaRepresentation(byte[] internalRepresentation)
Convert the internal representation stored in the
PersistenceManagerService
to the Java objects needed by the batch artifacts. |
public static final String BATCHEE_SPLIT_TOKEN
public static final String BATCHEE_DATA_PREFIX
public void init(Properties batchConfig)
init
in interface BatchService
public <T> byte[] toInternalRepresentation(T dataObject)
DataRepresentationService
toInternalRepresentation
in interface DataRepresentationService
dataObject
- the object to store or null
if no data is to be storedpublic <T> T toJavaRepresentation(byte[] internalRepresentation)
DataRepresentationService
PersistenceManagerService
to the Java objects needed by the batch artifacts.toJavaRepresentation
in interface DataRepresentationService
internalRepresentation
- the String representation which we store in the databasprotected <T> byte[] convertCustomTypes(T dataObject)
protected <T> byte[] convertJavaNativeTypes(T dataObject)
null
if the dataObject was not a native Java typeprotected <T> byte[] convertJava7DateTypes(T dataObject)
protected <T> T convertBackJava7DateTypes(String typeVal, String valueVal)
protected Object invokeStaticMethod(String typeVal, String methodName, Class paramType, String valueVal)
protected <T> byte[] convertSerializableObjectTypes(T dataObject)
protected <T> T convertBackSerializableObjectTypes(byte[] internalRepresentation)
protected ClassLoader getClassLoader()
protected SimpleDateFormat getSimpleDateFormat()
protected SimpleDateFormat getTimestampDateFormat()
Copyright © 2017 The Apache Software Foundation. All rights reserved.