Package one.nio.config
Class ConfigParser
java.lang.Object
one.nio.config.ConfigParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidchangeReference(List<?> list, Object array) collectFields(Class<?> cls) private Objectprivate voidprivate booleanhasScalarConverter(Class<?> type, AnnotatedType aType) private booleanhasTail()private booleanisSameLevel(int newLevel, int prevLevel, int minLevel) private intnextLine()static <T> Tstatic <T> Tprivate ObjectparseArray(Type elementType, AnnotatedType aType, int minLevel) private Objectprivate Collection<Object> parseCollection(Class<?> rawType, Type elementType, AnnotatedType aType, int minLevel) private <T extends Collection<Object>>
TparseCollection(T list, Type elementType, AnnotatedType aType, int minLevel) parseMap(Class<?> rawType, AnnotatedType aType, Type keyType, Type valueType, int minLevel) parseMap(T map, AnnotatedType aType, Type keyType, Type valueType, int minLevel) private Objectprivate ObjectparseScalar(Class<?> type, AnnotatedType aType, String value) private ObjectparseValue(Type type, AnnotatedType aType, int level) private voidregisterReference(Object ref) private Class<?> resolveArrayElementType(Type elementType) private voidskipSpaces(int from) private Stringtail()
-
Field Details
-
st
-
references
-
line
-
indent
private int indent
-
-
Constructor Details
-
ConfigParser
-
-
Method Details
-
parse
-
parse
-
parseValue
private Object parseValue(Type type, AnnotatedType aType, int level) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
parseBean
- Throws:
ReflectiveOperationException
-
fillBean
- Throws:
ReflectiveOperationException
-
convert
- Throws:
ReflectiveOperationException
-
parseArray
private Object parseArray(Type elementType, AnnotatedType aType, int minLevel) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
resolveArrayElementType
-
changeReference
-
parseCollection
private Collection<Object> parseCollection(Class<?> rawType, Type elementType, AnnotatedType aType, int minLevel) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
parseCollection
private <T extends Collection<Object>> T parseCollection(T list, Type elementType, AnnotatedType aType, int minLevel) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
parseMap
private Map<Object,Object> parseMap(Class<?> rawType, AnnotatedType aType, Type keyType, Type valueType, int minLevel) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
parseMap
private <T extends Map<Object,Object>> T parseMap(T map, AnnotatedType aType, Type keyType, Type valueType, int minLevel) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
isSameLevel
private boolean isSameLevel(int newLevel, int prevLevel, int minLevel) -
hasScalarConverter
-
parseScalar
private Object parseScalar(Class<?> type, AnnotatedType aType, String value) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
registerReference
-
parseReference
-
collectFields
-
nextLine
private int nextLine() -
skipSpaces
private void skipSpaces(int from) -
tail
-
hasTail
private boolean hasTail()
-