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) Fileprivate static final MethodType(package private) boolean(package private) Map<Type,Converter.Hook> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tcnv(TypeReference<T> tr, Object source) static <T> Tstatic Objectprivate Collectioncollection(Type collectionType, Class<? extends Collection> rawClass, Object o) <T> Tconvert(TypeReference<T> type, Object o) <T> T(package private) Objectprivate Objectprivate Class<?>getRawClass(Type type) hook(Type type, Converter.Hook hook) static booleanisMultiple(Class<?> c) Return if the class's instances can hold multiple values.static booleanisMultiple(Type c) Return if the class's instances can hold multiple values.private static booleanstatic Stringprivate Mapprivate static booleanprivate static <T> TnewInstance(Class<T> rawClass) private Number<T> TConvert a map to an interface.private StringsanitizeInputForURI(String input) voidvoidsetFatalIsException(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
-