final Field[] fieldArray = type.getDeclaredFields();
for (final Field field : fieldArray) {
final Property anno = field.getAnnotation(Property.class);
if (anno == null) {
continue;
}
field.setAccessible(true);
final String fieldName = field.getName();
final int modifiers = field.getModifiers();
if (!Modifier.isStatic(modifiers)) {
throw new IllegalArgumentException(
"property field must be static : " + type + " / "
+ fieldName);
}
if (!Modifier.isFinal(modifiers)) {
throw new IllegalArgumentException(
"property field must be final : " + type + " / "
+ fieldName);
}
if (!PropertyType.isValidType(field.getType())) {
throw new IllegalArgumentException(
"property field type must be one of : ["
+ PropertyType.getList() + "] " + type + " / "
+ fieldName + " / " + field.getType());
}
//
final String name = Util.isValidText(anno.name()) ? anno.name()
: fieldName;
final Object value;
try {
value = field.get(null);