String timestamp = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if ( timestamp != null ) {
type.setTimestampAttribute( timestamp );
ClassDefinition cd = type.getTypeClassDef();
Package pkg = pkgRegistry.getPackage();
InternalReadAccessor reader = pkg.getClassFieldAccessorStore().getMVELReader( ClassUtils.getPackage( type.getTypeClass() ),
type.getTypeClass().getName(),
timestamp,
type.isTypesafe() );
MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( "mvel" );
data.addCompileable( (MVELCompileable) reader );
((MVELCompileable) reader).compile( data );
type.setTimestampExtractor( reader );
}
annotationDescr = typeDescr.getAnnotation( TypeDeclaration.ATTR_DURATION );
String duration = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if ( duration != null ) {
type.setDurationAttribute( duration );
ClassDefinition cd = type.getTypeClassDef();
Package pkg = pkgRegistry.getPackage();
InternalReadAccessor reader = pkg.getClassFieldAccessorStore().getMVELReader( ClassUtils.getPackage( type.getTypeClass() ),
type.getTypeClass().getName(),
duration,
type.isTypesafe() );
MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( "mvel" );
data.addCompileable( (MVELCompileable) reader );