Package org.jdbi.v3.core.argument
Class DelegatingArgumentFactory
- java.lang.Object
-
- org.jdbi.v3.core.argument.DelegatingArgumentFactory
-
- All Implemented Interfaces:
ArgumentFactory,ArgumentFactory.Preparable
- Direct Known Subclasses:
BoxedArgumentFactory,EssentialsArgumentFactory,InternetArgumentFactory,JavaTimeArgumentFactory,OptionalArgumentFactory,PrimitivesArgumentFactory,SqlArgumentFactory,SqlTimeArgumentFactory
abstract class DelegatingArgumentFactory extends java.lang.Object implements ArgumentFactory.Preparable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jdbi.v3.core.argument.ArgumentFactory
ArgumentFactory.Preparable
-
-
Constructor Summary
Constructors Constructor Description DelegatingArgumentFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<Argument>build(java.lang.reflect.Type expectedType, java.lang.Object value, ConfigRegistry config)Returns anArgumentfor the given value if the factory supports it; empty otherwise.java.util.Optional<java.util.function.Function<java.lang.Object,Argument>>prepare(java.lang.reflect.Type type, ConfigRegistry config)java.util.Collection<? extends java.lang.reflect.Type>prePreparedTypes()(package private) <T> voidregister(java.lang.Class<T> klass, int sqlType, StatementBinder<T> binder)
-
-
-
Field Detail
-
builders
private final java.util.IdentityHashMap<java.lang.Class<?>,java.util.function.Function<java.lang.Object,Argument>> builders
-
-
Method Detail
-
prepare
public java.util.Optional<java.util.function.Function<java.lang.Object,Argument>> prepare(java.lang.reflect.Type type, ConfigRegistry config)
- Specified by:
preparein interfaceArgumentFactory.Preparable
-
build
public java.util.Optional<Argument> build(java.lang.reflect.Type expectedType, java.lang.Object value, ConfigRegistry config)
Description copied from interface:ArgumentFactoryReturns anArgumentfor the given value if the factory supports it; empty otherwise.- Specified by:
buildin interfaceArgumentFactory- Specified by:
buildin interfaceArgumentFactory.Preparable- Parameters:
expectedType- the known type of value. Depending on the situation this may be a full generic signature e.g.ParameterizedType, aClass, or Object.class if no type information is known.value- the value to convert into anArgumentconfig- the config registry, for composition- Returns:
- an argument for the given value if this factory supports it, or
Optional.empty()otherwise. - See Also:
StatementContext.findArgumentFor(Type, Object),Arguments.findFor(Type, Object)
-
prePreparedTypes
public java.util.Collection<? extends java.lang.reflect.Type> prePreparedTypes()
- Specified by:
prePreparedTypesin interfaceArgumentFactory.Preparable
-
register
<T> void register(java.lang.Class<T> klass, int sqlType, StatementBinder<T> binder)
-
-