/** * Initialize annotation-based path properties. * @return */ private static void initPaths() { // TODO: Retrieving such entries should be (instance...) methods of ConfPaths or a specific configuration instance. deprecatedFields.clear(); deprecatedPrefixes.clear(); globalOnlyFields.clear(); globalOnlyPrefixes.clear(); movedPaths.clear(); for (final WrapMoved moved : ConfPaths.getExtraMovedPaths()) { movedPaths.put(moved.oldPath, moved); } for (final Field field : ConfPaths.class.getDeclaredFields()) { if (field.getType() != String.class) { // Only process strings. continue; } final String fieldName = field.getName(); checkAddPrefixes(field, fieldName, GlobalConfig.class, globalOnlyFields, globalOnlyPrefixes); checkAddPrefixes(field, fieldName, Deprecated.class, deprecatedFields, deprecatedPrefixes); if (field.isAnnotationPresent(Moved.class)) { // TODO: Prefixes: Might later support relocating entire sections with one annotation? addMoved(field, field.getAnnotation(Moved.class)); } } }