public String format ( Object expression , Object objPattern ) { if ( objPattern instanceof String ) { final String pattern = filterPattern ( ( String ) objPattern ) ; if ( expression == null ) { return null ; } if ( expression instanceof LocalDate ) { return create ( ( LocalDate ) expression ) . toDisp ( pattern ) ; } if ( expression instanceof LocalDateTime ) { return create ( ( LocalDateTime ) expression ) . toDisp ( pattern ) ; } if ( expression instanceof java . util . Date ) { return create ( ( java . util . Date ) expression ) . toDisp ( pattern ) ; } if ( expression instanceof String ) { return create ( ( String ) expression ) . toDisp ( pattern ) ; } String msg = "First argument as two arguments should be LocalDate or LocalDateTime or Date or String(expression): " + expression ; throw new TemplateProcessingException ( msg ) ; } String msg = "Second argument as two arguments should be String(pattern): objPattern=" + objPattern ; throw new TemplateProcessingException ( msg ) ; }
Get formatted date string .