public class DateFormatMethodExecutor
extends java.lang.Object
implements org.springframework.expression.MethodExecutor
MethodExecutor
handling formatting using a SimpleDateFormat
.Constructor and Description |
---|
DateFormatMethodExecutor()
Instantiates a new date format method executor.
|
DateFormatMethodExecutor(java.lang.String key)
Instantiates a new date format method executor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
dateFormat(java.lang.String pattern,
java.util.Date date) |
static java.lang.String |
dateFormat(java.lang.String pattern,
java.lang.Integer epoch) |
static java.lang.String |
dateFormat(java.lang.String pattern,
java.lang.Long epoch) |
static java.lang.String |
dateFormat(java.lang.String pattern,
java.lang.String datestring) |
static java.lang.String |
dateFormat(java.lang.String pattern,
java.lang.String datestring,
java.lang.String dateformat) |
org.springframework.expression.TypedValue |
execute(org.springframework.expression.EvaluationContext context,
java.lang.Object target,
java.lang.Object... arguments) |
protected java.lang.String |
getKey()
Gets the key for timestamp if defined.
|
public DateFormatMethodExecutor()
public DateFormatMethodExecutor(java.lang.String key)
key
- the key for timestamppublic org.springframework.expression.TypedValue execute(org.springframework.expression.EvaluationContext context, java.lang.Object target, java.lang.Object... arguments) throws org.springframework.expression.AccessException
execute
in interface org.springframework.expression.MethodExecutor
org.springframework.expression.AccessException
protected java.lang.String getKey()
public static java.lang.String dateFormat(java.lang.String pattern, java.lang.Integer epoch) throws org.springframework.expression.AccessException
org.springframework.expression.AccessException
public static java.lang.String dateFormat(java.lang.String pattern, java.lang.Long epoch) throws org.springframework.expression.AccessException
org.springframework.expression.AccessException
public static java.lang.String dateFormat(java.lang.String pattern, java.util.Date date) throws org.springframework.expression.AccessException
org.springframework.expression.AccessException
public static java.lang.String dateFormat(java.lang.String pattern, java.lang.String datestring) throws org.springframework.expression.AccessException
org.springframework.expression.AccessException
public static java.lang.String dateFormat(java.lang.String pattern, java.lang.String datestring, java.lang.String dateformat) throws org.springframework.expression.AccessException
org.springframework.expression.AccessException