Package aQute.lib.converter
Class Converter
java.lang.Object
aQute.lib.converter.Converter
- Direct Known Subclasses:
SpecialConverter
General Java type converter from an object to any type. Supports number
conversion
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) List<Converter.Hook>
(package private) File
private static final MethodType
(package private) boolean
(package private) Map<Type,
Converter.Hook> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
cnv
(TypeReference<T> tr, Object source) static <T> T
static Object
private Collection
collection
(Type collectionType, Class<? extends Collection> rawClass, Object o) <T> T
convert
(TypeReference<T> type, Object o) <T> T
(package private) Object
private Object
private Class<?>
getRawClass
(Type type) hook
(Type type, Converter.Hook hook) static boolean
isMultiple
(Class<?> c) Return if the class's instances can hold multiple values.static boolean
isMultiple
(Type c) Return if the class's instances can hold multiple values.private static boolean
static String
private Map
private static boolean
private static <T> T
newInstance
(Class<T> rawClass) private Number
<T> T
Convert a map to an interface.private String
sanitizeInputForURI
(String input) void
void
setFatalIsException
(boolean b) Collection<?>
Map<?,
?>
-
Field Details
-
fatal
boolean fatal -
hooks
Map<Type,Converter.Hook> hooks -
allHooks
List<Converter.Hook> allHooks -
base
File base -
defaultConstructor
-
-
Constructor Details
-
Converter
public Converter()
-
-
Method Details
-
convert
- Throws:
Exception
-
convert
- Throws:
Exception
-
convert
- Throws:
Exception
-
convertT
- Throws:
Exception
-
sanitizeInputForURI
-
number
-
collection
private Collection collection(Type collectionType, Class<? extends Collection> rawClass, Object o) throws Exception - Throws:
Exception
-
newInstance
- Throws:
Exception
-
isStatic
-
map
- Throws:
Exception
-
array
- Throws:
Exception
-
getRawClass
-
toCollection
-
toMap
- Throws:
Exception
-
getFields
-
error
-
setFatalIsException
public void setFatalIsException(boolean b) -
hook
-
proxy
Convert a map to an interface.- Parameters:
interfc
-properties
-- Returns:
- proxy object for map
-
mangleMethodName
-
match
-
cnv
- Throws:
Exception
-
cnv
- Throws:
Exception
-
cnv
- Throws:
Exception
-
isMultiple
Return if the class's instances can hold multiple values.- Parameters:
c
- the class to test- Returns:
- true if the class's instances can hold multiple values
-
isMultiple
Return if the class's instances can hold multiple values.- Parameters:
c
- the class to test- Returns:
- true if the class's instances can hold multiple values
-
setBase
-