private Resolution getDateResolution(AnnotatedElement annotatedElement) { if ( annotatedElement.isAnnotationPresent( DateBridge.class ) ) { return annotatedElement.getAnnotation( DateBridge.class ).resolution(); } return Resolution.MILLISECOND; }
private Resolution getDateResolution(AnnotatedElement annotatedElement) { if ( annotatedElement.isAnnotationPresent( DateBridge.class ) ) { return annotatedElement.getAnnotation( DateBridge.class ).resolution(); } return Resolution.MILLISECOND; }
@Override public FieldBridge provideFieldBridge(ExtendedBridgeProviderContext context) { AnnotatedElement annotatedElement = context.getAnnotatedElement(); if ( Date.class.isAssignableFrom( context.getReturnType() ) ) { if ( annotatedElement.isAnnotationPresent( org.hibernate.search.annotations.DateBridge.class ) ) { DateBridge dateBridgeAnnotation = annotatedElement.getAnnotation( org.hibernate.search.annotations.DateBridge.class ); Resolution resolution = dateBridgeAnnotation.resolution(); EncodingType encodingType = dateBridgeAnnotation.encoding(); return getDateFieldBridge( resolution, encodingType ); } else { return getDateFieldBridge( Resolution.MILLISECOND, EncodingType.NUMERIC ); } } return null; }
@Override public FieldBridge provideFieldBridge(ExtendedBridgeProviderContext context) { AnnotatedElement annotatedElement = context.getAnnotatedElement(); if ( Date.class.isAssignableFrom( context.getReturnType() ) ) { if ( annotatedElement.isAnnotationPresent( org.hibernate.search.annotations.DateBridge.class ) ) { DateBridge dateBridgeAnnotation = annotatedElement.getAnnotation( org.hibernate.search.annotations.DateBridge.class ); Resolution resolution = dateBridgeAnnotation.resolution(); EncodingType encodingType = dateBridgeAnnotation.encoding(); return getDateFieldBridge( resolution, encodingType ); } else { return getDateFieldBridge( Resolution.MILLISECOND, EncodingType.NUMERIC ); } } return null; }