/** * Method that can be used to construct "raw" Map-like type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructMapLikeType(collectionClass, typeFactory.unknownType(), typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public MapLikeType constructRawMapLikeType(Class<?> mapClass) { return MapLikeType.construct(mapClass, unknownType(), unknownType()); }
/** * Method that can be used to construct "raw" Map type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructMapType(collectionClass, typeFactory.unknownType(), typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public MapType constructRawMapType(Class<? extends Map> mapClass) { return MapType.construct(mapClass, unknownType(), unknownType()); }
/** * Method that can be used to construct "raw" Collection-like type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructCollectionLikeType(collectionClass, typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public CollectionLikeType constructRawCollectionLikeType(Class<?> collectionClass) { return CollectionLikeType.construct(collectionClass, unknownType()); }
/** * Method that can be used to construct "raw" Collection type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructCollectionType(collectionClass, typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public CollectionType constructRawCollectionType(Class<? extends Collection> collectionClass) { return CollectionType.construct(collectionClass, unknownType()); }
protected JavaType getType(TypeBindings bindings, TypeVariable<?>[] typeParams) { // [JACKSON-468] Need to consider local type binding declarations too... if (typeParams != null && typeParams.length > 0) { bindings = bindings.childInstance(); for (TypeVariable<?> var : typeParams) { String name = var.getName(); // to prevent infinite loops, need to first add placeholder ("<T extends Enum<T>>" etc) bindings._addPlaceholder(name); // About only useful piece of information is the lower bound (which is at least Object.class) Type lowerBound = var.getBounds()[0]; JavaType type = (lowerBound == null) ? TypeFactory.unknownType() : bindings.resolveType(lowerBound); bindings.addBinding(var.getName(), type); } } return bindings.resolveType(getGenericType()); }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
JavaType referencedType; if (params == null || params.length < 1) { // untyped (raw) referencedType = TypeFactory.unknownType(); } else { referencedType = params[0];
/** * Method that can be used to construct "raw" Map type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructMapType(collectionClass, typeFactory.unknownType(), typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public MapType constructRawMapType(Class<? extends Map> mapClass) { return MapType.construct(mapClass, unknownType(), unknownType()); }
/** * Method that can be used to construct "raw" Map-like type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructMapLikeType(collectionClass, typeFactory.unknownType(), typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public MapLikeType constructRawMapLikeType(Class<?> mapClass) { return MapLikeType.construct(mapClass, unknownType(), unknownType()); }
/** * Method that can be used to construct "raw" Collection-like type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructCollectionLikeType(collectionClass, typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public CollectionLikeType constructRawCollectionLikeType(Class<?> collectionClass) { return CollectionLikeType.construct(collectionClass, unknownType()); }
/** * Method that can be used to construct "raw" Collection type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructCollectionType(collectionClass, typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public CollectionType constructRawCollectionType(Class<? extends Collection> collectionClass) { return CollectionType.construct(collectionClass, unknownType()); }
@Override public JavaType modifyType(final JavaType type, final Type jdkType, final TypeBindings context, final TypeFactory typeFactory) { final Class<?> raw = type.getRawClass(); if (fluentIterableClass.isAssignableFrom(raw)) { return typeFactory.constructParametricType(Iterable.class, typeFactory.unknownType()); } return type; } };
protected JavaType getType(TypeBindings bindings, TypeVariable<?>[] typeParams) { // [JACKSON-468] Need to consider local type binding declarations too... if (typeParams != null && typeParams.length > 0) { bindings = bindings.childInstance(); for (TypeVariable<?> var : typeParams) { String name = var.getName(); // to prevent infinite loops, need to first add placeholder ("<T extends Enum<T>>" etc) bindings._addPlaceholder(name); // About only useful piece of information is the lower bound (which is at least Object.class) Type lowerBound = var.getBounds()[0]; JavaType type = (lowerBound == null) ? TypeFactory.unknownType() : bindings.resolveType(lowerBound); bindings.addBinding(var.getName(), type); } } return bindings.resolveType(getGenericType()); }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
JavaType referencedType; if (params == null || params.length < 1) { // untyped (raw) referencedType = TypeFactory.unknownType(); } else { referencedType = params[0];
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return ContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIterableSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iterableSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }
protected JsonSerializer<?> buildIteratorSerializer(SerializationConfig config, JavaType type, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) { // if there's generic type, it'll be the first contained type JavaType valueType = type.containedType(0); if (valueType == null) { valueType = TypeFactory.unknownType(); } TypeSerializer vts = createTypeSerializer(config, valueType, property); return StdContainerSerializers.iteratorSerializer(valueType, usesStaticTyping(config, beanDesc, vts, property), vts, property); }