@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) @Documented public @interface ApolloJsonValue
Usage example:
// Inject the json property value for type SomeObject.
// Suppose SomeObject has 2 properties, someString and someInt, then the possible config
// in Apollo is someJsonPropertyKey={"someString":"someValue", "someInt":10}.
@ApolloJsonValue("${someJsonPropertyKey:someDefaultValue}")
private SomeObject someObject;
// Suppose SomeObject has a field of type Date named 'time', then the possible config
// in Apollo is someJsonPropertyKey={"time":"2024/01/04"}.
@ApolloJsonValue(value="${someJsonPropertyKey:someDefaultValue}", datePattern="yyyy/MM/dd")
private SomeObject someObject;
Create by zhangzheng on 2018/3/6Value| Modifier and Type | Required Element and Description |
|---|---|
String |
value
The actual value expression: e.g.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
datePattern
The datePattern follows the same rule as required by
SimpleDateFormat. |
public abstract String value
public abstract String datePattern
SimpleDateFormat.Copyright © 2025. All rights reserved.