/** * @since 1.7 */ @SuppressWarnings("unchecked") protected SerializerBase(JavaType type) { _handledType = (Class<T>) type.getRawClass(); }
protected NullProvider(JavaType type, Object nullValue) { _nullValue = nullValue; // [JACKSON-420] _isPrimitive = type.isPrimitive(); _rawType = type.getRawClass(); }
private final static int hash(JavaType type, boolean typed) { int hash = type.hashCode() - 1; if (typed) { --hash; } return hash; }
/** * @since 1.9 */ public JavaType withContentValueHandler(Object h) { /* 16-Aug-2011, tatu: This is not entirely correct, as we can not * create new immutable instances. However, sub-classes can, * so if mapper is version 1.9, things work as expected. * Otherwise, in 2.0 we can make this method abstract. */ getContentType().setValueHandler(h); return this; }
@Override public JavaType getContentType() { return _mapType.getContentType(); }
@Override public boolean hasGenericTypes() { // arrays are not parameterized, but element type may be: return _componentType.hasGenericTypes(); }
@Override public final boolean equals(Object o) { if (o == this) return true; TypeKey other = (TypeKey) o; if (other._isTyped == _isTyped) { if (_class != null) { return other._class == _class; } return _type.equals(other._type); } return false; } }
/** * @since 1.9 */ public JavaType withValueHandler(Object h) { /* 16-Aug-2011, tatu: This is not entirely correct, as we can not * create new immutable instances. However, sub-classes can, * so if mapper is version 1.9, things work as expected. * Otherwise, in 2.0 we can make this method abstract. */ setValueHandler(h); return this; }
/** * Method that can be used to find out if the type directly declares generic * parameters (for its direct super-class and/or super-interfaces). * * @since 1.6 */ public boolean hasGenericTypes() { return containedTypeCount() > 0; }
public EnumMapSerializer(JavaType valueType, boolean staticTyping, EnumValues keyEnums, TypeSerializer vts, BeanProperty property, JsonSerializer<Object> valueSerializer) { super(EnumMap.class, false); _staticTyping = staticTyping || (valueType != null && valueType.isFinal()); _valueType = valueType; _keyEnums = keyEnums; _valueTypeSerializer = vts; _property = property; _valueSerializer = valueSerializer; }
/** * @since 1.9 */ public CollectionDeserializer(JavaType collectionType, JsonDeserializer<Object> valueDeser, TypeDeserializer valueTypeDeser, ValueInstantiator valueInstantiator) { super(collectionType.getRawClass()); _collectionType = collectionType; _valueDeserializer = valueDeser; _valueTypeDeserializer = valueTypeDeser; _valueInstantiator = valueInstantiator; }
@Override public JavaType getContentType() { return _arrayType.getContentType(); }
@Override public Class<?> getDefaultImpl() { return (_defaultImpl == null) ? null : _defaultImpl.getRawClass(); }
@Override public JavaType getContentType() { return _collectionType.getContentType(); }
protected CollectionLikeType(Class<?> collT, JavaType elemT, Object valueHandler, Object typeHandler) { super(collT, elemT.hashCode(), valueHandler, typeHandler); _elementType = elemT; }
public TypeBindings(TypeFactory typeFactory, JavaType type) { this(typeFactory, null, type.getRawClass(), type); }
@Override public JavaType getContentType() { return _collectionType.getContentType(); }
public Class<?> getRawSerializationType() { return (_cfgSerializationType == null) ? null : _cfgSerializationType.getRawClass(); }
protected StdDeserializer(JavaType valueType) { _valueClass = (valueType == null) ? null : valueType.getRawClass(); }