type.getTypeClass().getName(),
timestamp,
type.isTypesafe(),
results.getReturnType() );
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 );
Package pkg = pkgRegistry.getPackage();
MVELDialect dialect = (MVELDialect) pkgRegistry.getDialectCompiletimeRegistry().getDialect( "mvel" );
PackageBuildContext context = new PackageBuildContext();
context.init( this, pkg, typeDescr, pkgRegistry.getDialectCompiletimeRegistry(), dialect, null );
if ( !type.isTypesafe() ) {
context.setTypesafe( false );
}
MVELAnalysisResult results = (MVELAnalysisResult)
context.getDialect().analyzeExpression( context,
typeDescr,
duration,
new BoundIdentifiers( Collections.EMPTY_MAP,
Collections.EMPTY_MAP,
Collections.EMPTY_MAP,
type.getTypeClass() ) );
if ( results != null ) {
InternalReadAccessor reader = pkg.getClassFieldAccessorStore().getMVELReader( ClassUtils.getPackage( type.getTypeClass() ),
type.getTypeClass().getName(),
duration,
type.isTypesafe(),
results.getReturnType() );
MVELDialectRuntimeData data = (MVELDialectRuntimeData) pkg.getDialectRuntimeRegistry().getDialectData( "mvel" );
data.addCompileable( (MVELCompileable) reader );
((MVELCompileable) reader).compile( data );
type.setDurationExtractor( reader );
} else {
this.results.add( new TypeDeclarationError( typeDescr,
"Error processing @duration for TypeDeclaration '" + type.getFullName() +