calabash-android 0.4.7.pre6 → 0.4.7.pre7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/calabash-android/helpers.rb +7 -15
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/version.rb +1 -1
- data/test-server/build.xml +2 -2
- data/test-server/instrumentation-backend/.classpath +0 -3
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java +1 -2
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForProgress.java +1 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/QueryHelper.java +1 -2
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/json/JSONUtils.java +1 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/QueryResult.java +1 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryUtils.java +203 -222
- data/test-server/instrumentation-backend/src/sh/calaba/org/apache/http/entity/mime/version.properties +22 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Base64Variant.java +413 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Base64Variants.java +90 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/FormatSchema.java +29 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonEncoding.java +47 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonFactory.java +937 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonGenerationException.java +28 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonGenerator.java +1197 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonLocation.java +141 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonNode.java +879 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonParseException.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonParser.java +1434 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java +80 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonStreamContext.java +122 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonToken.java +161 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/ObjectCodec.java +157 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/PrettyPrinter.java +166 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/SerializableString.java +54 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Version.java +90 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Versioned.java +20 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JacksonAnnotation.java +20 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonAnyGetter.java +25 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonAnySetter.java +24 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonAutoDetect.java +148 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonBackReference.java +41 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonCreator.java +19 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonGetter.java +35 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonIgnore.java +57 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonIgnoreProperties.java +48 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonIgnoreType.java +33 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonManagedReference.java +41 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonMethod.java +90 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonProperty.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonPropertyOrder.java +46 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonRawValue.java +33 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonSetter.java +33 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonSubTypes.java +44 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonTypeInfo.java +236 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonTypeName.java +28 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonUnwrapped.java +76 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonValue.java +46 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonWriteNullProperties.java +34 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/package-info.java +16 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/DataFormatDetector.java +176 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/DataFormatMatcher.java +117 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/InputAccessor.java +130 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/MatchStrength.java +64 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/package-info.java +8 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/ByteSourceBootstrapper.java +518 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/DefaultPrettyPrinter.java +13 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/Indenter.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonGeneratorBase.java +570 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonNumericParserBase.java +20 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonParserBase.java +1067 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonParserMinimalBase.java +539 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonReadContext.java +188 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonWriteContext.java +178 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/ReaderBasedParser.java +1815 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/ReaderBasedParserBase.java +228 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/StreamBasedParserBase.java +197 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/Utf8Generator.java +1757 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/Utf8StreamParser.java +2966 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/WriterBasedGenerator.java +1815 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/package-info.java +6 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/BaseReader.java +117 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/CharacterEscapes.java +73 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/IOContext.java +239 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/InputDecorator.java +67 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/JsonStringEncoder.java +408 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/MergedStream.java +145 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/NumberInput.java +303 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/NumberOutput.java +398 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/OutputDecorator.java +40 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/SegmentedStringWriter.java +104 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/SerializedString.java +114 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/UTF32Reader.java +214 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/UTF8Writer.java +387 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/package.html +4 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/AbstractTypeResolver.java +63 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/AnnotationIntrospector.java +1485 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/BeanDescription.java +171 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/BeanProperty.java +123 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/BeanPropertyDefinition.java +66 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ClassIntrospector.java +117 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ContextualDeserializer.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ContextualKeyDeserializer.java +33 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ContextualSerializer.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializationConfig.java +926 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializationContext.java +262 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializationProblemHandler.java +56 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializerFactory.java +356 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializerProvider.java +185 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/Deserializers.java +339 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/HandlerInstantiator.java +115 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/InjectableValues.java +85 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonDeserializer.java +166 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonMappingException.java +335 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonSerializable.java +34 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonSerializableWithType.java +22 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonSerializer.java +138 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/KeyDeserializer.java +31 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/KeyDeserializers.java +21 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/MapperConfig.java +1154 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/MappingIterator.java +190 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/MappingJsonFactory.java +81 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/Module.java +255 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ObjectMapper.java +2885 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ObjectReader.java +958 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ObjectWriter.java +554 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/PropertyNamingStrategy.java +258 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ResolvableDeserializer.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ResolvableSerializer.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/RuntimeJsonMappingException.java +21 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/SerializationConfig.java +1041 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/SerializerFactory.java +198 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/SerializerProvider.java +552 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/Serializers.java +137 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/TypeDeserializer.java +118 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/TypeSerializer.java +164 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JacksonInject.java +30 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JacksonStdImpl.java +25 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonCachable.java +32 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonDeserialize.java +109 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonFilter.java +31 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonRootName.java +29 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonSerialize.java +216 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonTypeIdResolver.java +35 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonTypeResolver.java +28 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonValueInstantiator.java +26 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonView.java +37 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/NoClass.java +19 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/package-info.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/AbstractDeserializer.java +102 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ArrayDeserializer.java +28 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ArrayDeserializers.java +11 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BasicDeserializerFactory.java +894 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializer.java +1537 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializerBuilder.java +277 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializerFactory.java +1474 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializerModifier.java +58 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/CollectionDeserializer.java +47 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ContainerDeserializer.java +14 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/CustomDeserializerFactory.java +227 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/DateDeserializer.java +9 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/EnumDeserializer.java +15 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/EnumResolver.java +17 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/FromStringDeserializer.java +13 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/JsonNodeDeserializer.java +54 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/MapDeserializer.java +44 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/SettableAnyProperty.java +177 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/SettableBeanProperty.java +827 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializationContext.java +326 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializer.java +94 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializerProvider.java +494 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializers.java +119 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdKeyDeserializer.java +12 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdKeyDeserializers.java +11 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdScalarDeserializer.java +13 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ThrowableDeserializer.java +13 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/UntypedObjectDeserializer.java +9 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ValueInstantiator.java +280 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ValueInstantiators.java +52 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/BeanPropertyMap.java +257 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/CreatorCollector.java +141 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/CreatorProperty.java +152 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/ExternalTypeHandler.java +173 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/PropertyBasedCreator.java +117 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/PropertyValue.java +117 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/PropertyValueBuffer.java +102 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/UnwrappedPropertyHandler.java +41 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/ValueInjector.java +45 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/package-info.java +9 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/package-info.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/AtomicBooleanDeserializer.java +22 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/AtomicReferenceDeserializer.java +47 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/CalendarDeserializer.java +47 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ClassDeserializer.java +49 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/CollectionDeserializer.java +265 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ContainerDeserializerBase.java +37 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/DateDeserializer.java +30 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/EnumDeserializer.java +139 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/EnumMapDeserializer.java +90 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/EnumSetDeserializer.java +89 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/FromStringDeserializer.java +265 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/JavaTypeDeserializer.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/JsonNodeDeserializer.java +314 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/MapDeserializer.java +412 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ObjectArrayDeserializer.java +201 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/PrimitiveArrayDeserializers.java +583 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdDeserializer.java +1136 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdKeyDeserializer.java +340 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdKeyDeserializers.java +108 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdScalarDeserializer.java +34 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdValueInstantiator.java +392 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StringCollectionDeserializer.java +227 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StringDeserializer.java +55 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ThrowableDeserializer.java +164 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/TimestampDeserializer.java +30 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/TokenBufferDeserializer.java +36 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/UntypedObjectDeserializer.java +248 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/package-info.java +15 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/exc/UnrecognizedPropertyException.java +75 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/DOMDeserializer.java +65 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/OptionalHandlerFactory.java +217 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/package-info.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/Annotated.java +85 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedClass.java +980 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedConstructor.java +143 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedField.java +119 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedMember.java +56 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedMethod.java +188 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedMethodMap.java +85 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedParameter.java +191 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedWithParams.java +195 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotationMap.java +101 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/BasicBeanDescription.java +615 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/BasicClassIntrospector.java +364 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/JacksonAnnotationIntrospector.java +813 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/MemberKey.java +83 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/MethodFilter.java +12 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/NopAnnotationIntrospector.java +209 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/POJOPropertiesCollector.java +713 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/POJOPropertyBuilder.java +648 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/VisibilityChecker.java +424 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/package-info.java +12 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/NamedType.java +53 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/SubtypeResolver.java +39 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/TypeIdResolver.java +74 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/TypeResolverBuilder.java +151 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsArrayTypeDeserializer.java +126 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsArrayTypeSerializer.java +110 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsExternalTypeDeserializer.java +37 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsExternalTypeSerializer.java +129 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsPropertyTypeDeserializer.java +191 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsPropertyTypeSerializer.java +69 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsWrapperTypeDeserializer.java +103 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsWrapperTypeSerializer.java +121 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/ClassNameIdResolver.java +138 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/MinimalClassNameIdResolver.java +66 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/StdSubtypeResolver.java +151 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/StdTypeResolverBuilder.java +202 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeDeserializerBase.java +154 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeIdResolverBase.java +37 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeNameIdResolver.java +154 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeSerializerBase.java +31 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/package-info.java +9 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/package-info.java +10 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleAbstractTypeResolver.java +86 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleDeserializers.java +130 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleKeyDeserializers.java +59 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleModule.java +265 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleSerializers.java +206 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java +45 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/package-info.java +16 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/package-info.java +34 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/AnyGetterWriter.java +48 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ArraySerializers.java +7 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BasicSerializerFactory.java +806 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanPropertyFilter.java +30 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanPropertyWriter.java +512 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializer.java +126 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializerBuilder.java +140 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializerFactory.java +780 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializerModifier.java +95 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ContainerSerializers.java +8 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/CustomSerializerFactory.java +293 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/EnumSerializer.java +17 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/FilterProvider.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/FilteredBeanPropertyWriter.java +96 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/JdkSerializers.java +11 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/MapSerializer.java +58 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/PropertyBuilder.java +372 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ScalarSerializerBase.java +18 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/SerializerBase.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/StdKeySerializer.java +10 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/StdSerializerProvider.java +852 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/StdSerializers.java +372 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ToStringSerializer.java +14 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/FailingSerializer.java +43 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/JsonSerializerMap.java +93 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/PropertySerializerMap.java +231 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/ReadOnlyClassToSerializerMap.java +73 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/SerializerCache.java +304 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/SimpleBeanPropertyFilter.java +109 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/SimpleFilterProvider.java +114 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/UnknownSerializer.java +54 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/UnwrappingBeanPropertyWriter.java +99 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/UnwrappingBeanSerializer.java +76 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/package-info.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/package-info.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/AsArraySerializerBase.java +185 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/BeanSerializerBase.java +340 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/CalendarSerializer.java +43 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/CollectionSerializer.java +113 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ContainerSerializerBase.java +51 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/DateSerializer.java +42 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/EnumMapSerializer.java +218 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/EnumSerializer.java +84 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/EnumSetSerializer.java +47 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/IndexedStringListSerializer.java +116 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/InetAddressSerializer.java +51 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/IterableSerializer.java +63 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/JsonValueSerializer.java +233 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/MapSerializer.java +422 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/NonTypedScalarSerializerBase.java +34 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/NullSerializer.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ObjectArraySerializer.java +281 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/RawSerializer.java +52 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ScalarSerializerBase.java +52 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/SerializableSerializer.java +99 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/SerializableWithTypeSerializer.java +90 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/SerializerBase.java +184 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StaticListSerializerBase.java +46 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdArraySerializers.java +476 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdContainerSerializers.java +249 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdJdkSerializers.java +195 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdKeySerializer.java +43 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdKeySerializers.java +95 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StringCollectionSerializer.java +119 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StringSerializer.java +36 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/TimeZoneSerializer.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ToStringSerializer.java +73 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/TokenBufferSerializer.java +66 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/ArrayType.java +260 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/ClassKey.java +94 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/CollectionLikeType.java +204 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/CollectionType.java +94 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/HierarchicType.java +88 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/MapLikeType.java +265 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/MapType.java +146 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/SimpleType.java +250 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeBase.java +148 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeBindings.java +351 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeFactory.java +1165 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeModifier.java +38 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeParser.java +134 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/package-info.java +10 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Annotations.java +23 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ArrayBuilders.java +293 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/BeanUtil.java +260 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ClassUtil.java +645 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Comparators.java +48 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/EnumResolver.java +108 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/EnumValues.java +82 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ISO8601DateFormat.java +52 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ISO8601Utils.java +230 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/JSONPObject.java +105 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/JSONWrappedObject.java +117 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/LRUMap.java +28 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/LinkedNode.java +45 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Named.java +10 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ObjectBuffer.java +257 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/PrimitiveArrayBuilder.java +180 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Provider.java +21 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/RootNameLookup.java +54 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/StdDateFormat.java +348 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/package-info.java +4 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ArrayNode.java +758 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BaseJsonNode.java +122 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BigIntegerNode.java +104 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BinaryNode.java +136 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BooleanNode.java +84 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ContainerNode.java +185 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/DecimalNode.java +96 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/DoubleNode.java +106 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/IntNode.java +122 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/JsonNodeFactory.java +222 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/LongNode.java +99 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/MissingNode.java +97 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/NodeCursor.java +222 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/NullNode.java +58 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/NumericNode.java +72 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ObjectNode.java +696 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/POJONode.java +145 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/TextNode.java +299 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/TreeTraversingParser.java +383 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ValueNode.java +58 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/package-info.java +8 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/package-info.java +30 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/JsonSchema.java +82 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/JsonSerializableSchema.java +46 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/SchemaAware.java +25 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/package-info.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/BytesToNameCanonicalizer.java +969 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/CharsToNameCanonicalizer.java +578 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name.java +50 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name1.java +44 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name2.java +40 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name3.java +39 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java +68 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/package-info.java +5 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/type/JavaType.java +503 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/type/TypeReference.java +60 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/type/package-info.java +8 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/BufferRecycler.java +109 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/ByteArrayBuilder.java +294 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/CharTypes.java +237 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/DefaultPrettyPrinter.java +282 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/InternCache.java +49 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/JsonGeneratorDelegate.java +273 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/JsonParserDelegate.java +251 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/JsonParserSequence.java +150 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/MinimalPrettyPrinter.java +152 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/TextBuffer.java +707 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/TokenBuffer.java +1233 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/VersionUtil.java +79 -0
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/package-info.java +4 -0
- metadata +409 -5
- data/test-server/instrumentation-backend/libs/jackson-annotations-2.2.0-rc2-20130418.042013-1.jar +0 -0
- data/test-server/instrumentation-backend/libs/jackson-core-2.2.0-rc2-20130420.041001-2.jar +0 -0
- data/test-server/instrumentation-backend/libs/jackson-databind-2.2.0-rc2-20130422.041053-3.jar +0 -0
@@ -0,0 +1,277 @@
|
|
1
|
+
package sh.calaba.org.codehaus.jackson.map.deser;
|
2
|
+
|
3
|
+
import java.util.*;
|
4
|
+
|
5
|
+
import sh.calaba.org.codehaus.jackson.map.*;
|
6
|
+
import sh.calaba.org.codehaus.jackson.map.deser.impl.BeanPropertyMap;
|
7
|
+
import sh.calaba.org.codehaus.jackson.map.deser.impl.ValueInjector;
|
8
|
+
import sh.calaba.org.codehaus.jackson.map.introspect.AnnotatedMember;
|
9
|
+
import sh.calaba.org.codehaus.jackson.map.introspect.BasicBeanDescription;
|
10
|
+
import sh.calaba.org.codehaus.jackson.map.util.Annotations;
|
11
|
+
import sh.calaba.org.codehaus.jackson.type.JavaType;
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Builder class used for aggregating deserialization information about
|
15
|
+
* a POJO, in order to build a {@link JsonDeserializer} for deserializing
|
16
|
+
* intances.
|
17
|
+
*
|
18
|
+
* @since 1.7
|
19
|
+
*/
|
20
|
+
public class BeanDeserializerBuilder
|
21
|
+
{
|
22
|
+
/*
|
23
|
+
/**********************************************************
|
24
|
+
/* General information about POJO
|
25
|
+
/**********************************************************
|
26
|
+
*/
|
27
|
+
|
28
|
+
final protected BasicBeanDescription _beanDesc;
|
29
|
+
|
30
|
+
/*
|
31
|
+
/**********************************************************
|
32
|
+
/* Accumulated information about properties
|
33
|
+
/**********************************************************
|
34
|
+
*/
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Properties to deserialize collected so far.
|
38
|
+
*<p>
|
39
|
+
* Note: since 1.9.1, LinkedHashMap has been used, since preservation
|
40
|
+
* of order is actually important for some use cases.
|
41
|
+
*/
|
42
|
+
final protected HashMap<String, SettableBeanProperty> _properties = new LinkedHashMap<String, SettableBeanProperty>();
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Value injectors for deserialization
|
46
|
+
*
|
47
|
+
* @since 1.9
|
48
|
+
*/
|
49
|
+
protected List<ValueInjector> _injectables;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Back-reference properties this bean contains (if any)
|
53
|
+
*/
|
54
|
+
protected HashMap<String, SettableBeanProperty> _backRefProperties;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Set of names of properties that are recognized but are to be ignored for deserialization
|
58
|
+
* purposes (meaning no exception is thrown, value is just skipped).
|
59
|
+
*/
|
60
|
+
protected HashSet<String> _ignorableProps;
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Object that will handle value instantiation for the bean type.
|
64
|
+
*
|
65
|
+
* @since 1.9
|
66
|
+
*/
|
67
|
+
protected ValueInstantiator _valueInstantiator;
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Fallback setter used for handling any properties that are not
|
71
|
+
* mapped to regular setters. If setter is not null, it will be
|
72
|
+
* called once for each such property.
|
73
|
+
*/
|
74
|
+
protected SettableAnyProperty _anySetter;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Flag that can be set to ignore and skip unknown properties.
|
78
|
+
* If set, will not throw an exception for unknown properties.
|
79
|
+
*/
|
80
|
+
protected boolean _ignoreAllUnknown;
|
81
|
+
|
82
|
+
/*
|
83
|
+
/**********************************************************
|
84
|
+
/* Life-cycle: construction
|
85
|
+
/**********************************************************
|
86
|
+
*/
|
87
|
+
|
88
|
+
public BeanDeserializerBuilder(BasicBeanDescription beanDesc)
|
89
|
+
{
|
90
|
+
_beanDesc = beanDesc;
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Copy constructor for sub-classes to use, when constructing
|
95
|
+
* custom builder instances
|
96
|
+
*
|
97
|
+
* @since 1.9
|
98
|
+
*/
|
99
|
+
protected BeanDeserializerBuilder(BeanDeserializerBuilder src)
|
100
|
+
{
|
101
|
+
_beanDesc = src._beanDesc;
|
102
|
+
_anySetter = src._anySetter;
|
103
|
+
_ignoreAllUnknown = src._ignoreAllUnknown;
|
104
|
+
|
105
|
+
// let's make copy of properties
|
106
|
+
_properties.putAll(src._properties);
|
107
|
+
_backRefProperties = _copy(src._backRefProperties);
|
108
|
+
// Hmmh. Should we create defensive copies here? For now, not yet
|
109
|
+
_ignorableProps = src._ignorableProps;
|
110
|
+
_valueInstantiator = src._valueInstantiator;
|
111
|
+
}
|
112
|
+
|
113
|
+
private static HashMap<String, SettableBeanProperty> _copy(HashMap<String, SettableBeanProperty> src)
|
114
|
+
{
|
115
|
+
if (src == null) {
|
116
|
+
return null;
|
117
|
+
}
|
118
|
+
return new HashMap<String, SettableBeanProperty>(src);
|
119
|
+
}
|
120
|
+
|
121
|
+
/*
|
122
|
+
/**********************************************************
|
123
|
+
/* Life-cycle: state modification (adders, setters)
|
124
|
+
/**********************************************************
|
125
|
+
*/
|
126
|
+
|
127
|
+
/**
|
128
|
+
* Method for adding a new property or replacing a property.
|
129
|
+
*/
|
130
|
+
public void addOrReplaceProperty(SettableBeanProperty prop, boolean allowOverride)
|
131
|
+
{
|
132
|
+
_properties.put(prop.getName(), prop);
|
133
|
+
}
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Method to add a property setter. Will ensure that there is no
|
137
|
+
* unexpected override; if one is found will throw a
|
138
|
+
* {@link IllegalArgumentException}.
|
139
|
+
*/
|
140
|
+
public void addProperty(SettableBeanProperty prop)
|
141
|
+
{
|
142
|
+
SettableBeanProperty old = _properties.put(prop.getName(), prop);
|
143
|
+
if (old != null && old != prop) { // should never occur...
|
144
|
+
throw new IllegalArgumentException("Duplicate property '"+prop.getName()+"' for "+_beanDesc.getType());
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
/**
|
149
|
+
* Method called to add a property that represents so-called back reference;
|
150
|
+
* reference that "points back" to object that has forward reference to
|
151
|
+
* currently built bean.
|
152
|
+
*/
|
153
|
+
public void addBackReferenceProperty(String referenceName, SettableBeanProperty prop)
|
154
|
+
{
|
155
|
+
if (_backRefProperties == null) {
|
156
|
+
_backRefProperties = new HashMap<String, SettableBeanProperty>(4);
|
157
|
+
}
|
158
|
+
_backRefProperties.put(referenceName, prop);
|
159
|
+
// also: if we had property with same name, actually remove it
|
160
|
+
if (_properties != null) {
|
161
|
+
_properties.remove(prop.getName());
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* @since 1.9
|
167
|
+
*/
|
168
|
+
public void addInjectable(String propertyName, JavaType propertyType,
|
169
|
+
Annotations contextAnnotations, AnnotatedMember member,
|
170
|
+
Object valueId)
|
171
|
+
{
|
172
|
+
if (_injectables == null) {
|
173
|
+
_injectables = new ArrayList<ValueInjector>();
|
174
|
+
}
|
175
|
+
_injectables.add(new ValueInjector(propertyName, propertyType,
|
176
|
+
contextAnnotations, member, valueId));
|
177
|
+
}
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Method that will add property name as one of properties that can
|
181
|
+
* be ignored if not recognized.
|
182
|
+
*/
|
183
|
+
public void addIgnorable(String propName)
|
184
|
+
{
|
185
|
+
if (_ignorableProps == null) {
|
186
|
+
_ignorableProps = new HashSet<String>();
|
187
|
+
}
|
188
|
+
_ignorableProps.add(propName);
|
189
|
+
}
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Method called by deserializer factory, when a "creator property"
|
193
|
+
* (something that is passed via constructor- or factory method argument;
|
194
|
+
* instead of setter or field).
|
195
|
+
*<p>
|
196
|
+
* Default implementation does not do anything; we may need to revisit this
|
197
|
+
* decision if these properties need to be available through accessors.
|
198
|
+
* For now, however, we just have to ensure that we don't try to resolve
|
199
|
+
* types that masked setter/field has (see [JACKSON-700] for details).
|
200
|
+
*
|
201
|
+
* @since 1.9.2
|
202
|
+
*/
|
203
|
+
public void addCreatorProperty(BeanPropertyDefinition propDef)
|
204
|
+
{
|
205
|
+
// do nothing
|
206
|
+
}
|
207
|
+
|
208
|
+
public void setAnySetter(SettableAnyProperty s)
|
209
|
+
{
|
210
|
+
if (_anySetter != null && s != null) {
|
211
|
+
throw new IllegalStateException("_anySetter already set to non-null");
|
212
|
+
}
|
213
|
+
_anySetter = s;
|
214
|
+
}
|
215
|
+
|
216
|
+
public void setIgnoreUnknownProperties(boolean ignore) {
|
217
|
+
_ignoreAllUnknown = ignore;
|
218
|
+
}
|
219
|
+
|
220
|
+
/**
|
221
|
+
* @since 1.9
|
222
|
+
*/
|
223
|
+
public void setValueInstantiator(ValueInstantiator inst) {
|
224
|
+
_valueInstantiator = inst;
|
225
|
+
}
|
226
|
+
|
227
|
+
/*
|
228
|
+
/**********************************************************
|
229
|
+
/* Public accessors
|
230
|
+
/**********************************************************
|
231
|
+
*/
|
232
|
+
|
233
|
+
/**
|
234
|
+
* Method that allows accessing all properties that this
|
235
|
+
* builder currently contains.
|
236
|
+
*<p>
|
237
|
+
* Note that properties are returned in order that properties
|
238
|
+
* are ordered (explictly, or by rule), which is the serialization
|
239
|
+
* order.
|
240
|
+
*
|
241
|
+
* @since 1.8.3
|
242
|
+
*/
|
243
|
+
public Iterator<SettableBeanProperty> getProperties() {
|
244
|
+
return _properties.values().iterator();
|
245
|
+
}
|
246
|
+
|
247
|
+
public boolean hasProperty(String propertyName) {
|
248
|
+
return _properties.containsKey(propertyName);
|
249
|
+
}
|
250
|
+
|
251
|
+
public SettableBeanProperty removeProperty(String name)
|
252
|
+
{
|
253
|
+
return _properties.remove(name);
|
254
|
+
}
|
255
|
+
|
256
|
+
/**
|
257
|
+
* @since 1.9
|
258
|
+
*/
|
259
|
+
public ValueInstantiator getValueInstantiator() {
|
260
|
+
return _valueInstantiator;
|
261
|
+
}
|
262
|
+
|
263
|
+
/*
|
264
|
+
/**********************************************************
|
265
|
+
/* Build method(s)
|
266
|
+
/**********************************************************
|
267
|
+
*/
|
268
|
+
|
269
|
+
public JsonDeserializer<?> build(BeanProperty forProperty)
|
270
|
+
{
|
271
|
+
BeanPropertyMap propertyMap = new BeanPropertyMap(_properties.values());
|
272
|
+
propertyMap.assignIndexes();
|
273
|
+
return new BeanDeserializer(_beanDesc, forProperty,
|
274
|
+
_valueInstantiator, propertyMap, _backRefProperties, _ignorableProps, _ignoreAllUnknown,
|
275
|
+
_anySetter, _injectables);
|
276
|
+
}
|
277
|
+
}
|
@@ -0,0 +1,1474 @@
|
|
1
|
+
package sh.calaba.org.codehaus.jackson.map.deser;
|
2
|
+
|
3
|
+
import java.util.*;
|
4
|
+
|
5
|
+
import sh.calaba.org.codehaus.jackson.JsonNode;
|
6
|
+
import sh.calaba.org.codehaus.jackson.map.*;
|
7
|
+
import sh.calaba.org.codehaus.jackson.map.deser.impl.CreatorCollector;
|
8
|
+
import sh.calaba.org.codehaus.jackson.map.deser.impl.CreatorProperty;
|
9
|
+
import sh.calaba.org.codehaus.jackson.map.deser.std.StdKeyDeserializers;
|
10
|
+
import sh.calaba.org.codehaus.jackson.map.deser.std.ThrowableDeserializer;
|
11
|
+
import sh.calaba.org.codehaus.jackson.map.introspect.*;
|
12
|
+
import sh.calaba.org.codehaus.jackson.map.type.*;
|
13
|
+
import sh.calaba.org.codehaus.jackson.map.util.ArrayBuilders;
|
14
|
+
import sh.calaba.org.codehaus.jackson.map.util.ClassUtil;
|
15
|
+
import sh.calaba.org.codehaus.jackson.map.util.EnumResolver;
|
16
|
+
import sh.calaba.org.codehaus.jackson.type.JavaType;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Concrete deserializer factory class that adds full Bean deserializer
|
20
|
+
* construction logic using class introspection.
|
21
|
+
*<p>
|
22
|
+
* Since there is no caching, this factory is stateless and a globally
|
23
|
+
* shared singleton instance ({@link #instance}) can be used by
|
24
|
+
* {@link DeserializerProvider}s).
|
25
|
+
*/
|
26
|
+
public class BeanDeserializerFactory
|
27
|
+
extends BasicDeserializerFactory
|
28
|
+
{
|
29
|
+
/**
|
30
|
+
* Signature of <b>Throwable.initCause</b> method.
|
31
|
+
*/
|
32
|
+
private final static Class<?>[] INIT_CAUSE_PARAMS = new Class<?>[] { Throwable.class };
|
33
|
+
|
34
|
+
/*
|
35
|
+
/**********************************************************
|
36
|
+
/* Config class implementation
|
37
|
+
/**********************************************************
|
38
|
+
*/
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Standard configuration settings container class implementation.
|
42
|
+
*
|
43
|
+
* @since 1.7
|
44
|
+
*/
|
45
|
+
public static class ConfigImpl extends Config
|
46
|
+
{
|
47
|
+
protected final static KeyDeserializers[] NO_KEY_DESERIALIZERS = new KeyDeserializers[0];
|
48
|
+
protected final static BeanDeserializerModifier[] NO_MODIFIERS = new BeanDeserializerModifier[0];
|
49
|
+
protected final static AbstractTypeResolver[] NO_ABSTRACT_TYPE_RESOLVERS = new AbstractTypeResolver[0];
|
50
|
+
protected final static ValueInstantiators[] NO_VALUE_INSTANTIATORS = new ValueInstantiators[0];
|
51
|
+
|
52
|
+
/**
|
53
|
+
* List of providers for additional deserializers, checked before considering default
|
54
|
+
* basic or bean deserializers.
|
55
|
+
*
|
56
|
+
* @since 1.7
|
57
|
+
*/
|
58
|
+
protected final Deserializers[] _additionalDeserializers;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* List of providers for additional key deserializers, checked before considering
|
62
|
+
* standard key deserializers.
|
63
|
+
*
|
64
|
+
* @since 1.7
|
65
|
+
*/
|
66
|
+
protected final KeyDeserializers[] _additionalKeyDeserializers;
|
67
|
+
|
68
|
+
/**
|
69
|
+
* List of modifiers that can change the way {@link BeanDeserializer} instances
|
70
|
+
* are configured and constructed.
|
71
|
+
*/
|
72
|
+
protected final BeanDeserializerModifier[] _modifiers;
|
73
|
+
|
74
|
+
/**
|
75
|
+
* List of objects that may be able to resolve abstract types to
|
76
|
+
* concrete types. Used by functionality like "mr Bean" to materialize
|
77
|
+
* types as needed.
|
78
|
+
*
|
79
|
+
* @since 1.8
|
80
|
+
*/
|
81
|
+
protected final AbstractTypeResolver[] _abstractTypeResolvers;
|
82
|
+
|
83
|
+
/**
|
84
|
+
* List of objects that know how to create instances of POJO types;
|
85
|
+
* possibly using custom construction (non-annoted constructors; factory
|
86
|
+
* methods external to value type etc).
|
87
|
+
* Used to support objects that are created using non-standard methods;
|
88
|
+
* or to support post-constructor functionality.
|
89
|
+
*
|
90
|
+
* @since 1.9
|
91
|
+
*/
|
92
|
+
protected final ValueInstantiators[] _valueInstantiators;
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Constructor for creating basic configuration with no additional
|
96
|
+
* handlers.
|
97
|
+
*/
|
98
|
+
public ConfigImpl() {
|
99
|
+
this(null, null, null, null, null);
|
100
|
+
}
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Copy-constructor that will create an instance that contains defined
|
104
|
+
* set of additional deserializer providers.
|
105
|
+
*/
|
106
|
+
protected ConfigImpl(Deserializers[] allAdditionalDeserializers,
|
107
|
+
KeyDeserializers[] allAdditionalKeyDeserializers,
|
108
|
+
BeanDeserializerModifier[] modifiers,
|
109
|
+
AbstractTypeResolver[] atr,
|
110
|
+
ValueInstantiators[] vi)
|
111
|
+
{
|
112
|
+
_additionalDeserializers = (allAdditionalDeserializers == null) ?
|
113
|
+
NO_DESERIALIZERS : allAdditionalDeserializers;
|
114
|
+
_additionalKeyDeserializers = (allAdditionalKeyDeserializers == null) ?
|
115
|
+
NO_KEY_DESERIALIZERS : allAdditionalKeyDeserializers;
|
116
|
+
_modifiers = (modifiers == null) ? NO_MODIFIERS : modifiers;
|
117
|
+
_abstractTypeResolvers = (atr == null) ? NO_ABSTRACT_TYPE_RESOLVERS : atr;
|
118
|
+
_valueInstantiators = (vi == null) ? NO_VALUE_INSTANTIATORS : vi;
|
119
|
+
}
|
120
|
+
|
121
|
+
@Override
|
122
|
+
public Config withAdditionalDeserializers(Deserializers additional)
|
123
|
+
{
|
124
|
+
if (additional == null) {
|
125
|
+
throw new IllegalArgumentException("Can not pass null Deserializers");
|
126
|
+
}
|
127
|
+
Deserializers[] all = ArrayBuilders.insertInListNoDup(_additionalDeserializers, additional);
|
128
|
+
return new ConfigImpl(all, _additionalKeyDeserializers, _modifiers,
|
129
|
+
_abstractTypeResolvers, _valueInstantiators);
|
130
|
+
}
|
131
|
+
|
132
|
+
@Override
|
133
|
+
public Config withAdditionalKeyDeserializers(KeyDeserializers additional)
|
134
|
+
{
|
135
|
+
if (additional == null) {
|
136
|
+
throw new IllegalArgumentException("Can not pass null KeyDeserializers");
|
137
|
+
}
|
138
|
+
KeyDeserializers[] all = ArrayBuilders.insertInListNoDup(_additionalKeyDeserializers, additional);
|
139
|
+
return new ConfigImpl(_additionalDeserializers, all, _modifiers,
|
140
|
+
_abstractTypeResolvers, _valueInstantiators);
|
141
|
+
}
|
142
|
+
|
143
|
+
@Override
|
144
|
+
public Config withDeserializerModifier(BeanDeserializerModifier modifier)
|
145
|
+
{
|
146
|
+
if (modifier == null) {
|
147
|
+
throw new IllegalArgumentException("Can not pass null modifier");
|
148
|
+
}
|
149
|
+
BeanDeserializerModifier[] all = ArrayBuilders.insertInListNoDup(_modifiers, modifier);
|
150
|
+
return new ConfigImpl(_additionalDeserializers, _additionalKeyDeserializers, all,
|
151
|
+
_abstractTypeResolvers, _valueInstantiators);
|
152
|
+
}
|
153
|
+
|
154
|
+
@Override
|
155
|
+
public Config withAbstractTypeResolver(AbstractTypeResolver resolver)
|
156
|
+
{
|
157
|
+
if (resolver == null) {
|
158
|
+
throw new IllegalArgumentException("Can not pass null resolver");
|
159
|
+
}
|
160
|
+
AbstractTypeResolver[] all = ArrayBuilders.insertInListNoDup(_abstractTypeResolvers, resolver);
|
161
|
+
return new ConfigImpl(_additionalDeserializers, _additionalKeyDeserializers, _modifiers,
|
162
|
+
all, _valueInstantiators);
|
163
|
+
}
|
164
|
+
|
165
|
+
@Override
|
166
|
+
public Config withValueInstantiators(ValueInstantiators instantiators)
|
167
|
+
{
|
168
|
+
if (instantiators == null) {
|
169
|
+
throw new IllegalArgumentException("Can not pass null resolver");
|
170
|
+
}
|
171
|
+
ValueInstantiators[] all = ArrayBuilders.insertInListNoDup(_valueInstantiators, instantiators);
|
172
|
+
return new ConfigImpl(_additionalDeserializers, _additionalKeyDeserializers, _modifiers,
|
173
|
+
_abstractTypeResolvers, all);
|
174
|
+
}
|
175
|
+
|
176
|
+
@Override
|
177
|
+
public boolean hasDeserializers() { return _additionalDeserializers.length > 0; }
|
178
|
+
|
179
|
+
@Override
|
180
|
+
public boolean hasKeyDeserializers() { return _additionalKeyDeserializers.length > 0; }
|
181
|
+
|
182
|
+
@Override
|
183
|
+
public boolean hasDeserializerModifiers() { return _modifiers.length > 0; }
|
184
|
+
|
185
|
+
@Override
|
186
|
+
public boolean hasAbstractTypeResolvers() { return _abstractTypeResolvers.length > 0; }
|
187
|
+
|
188
|
+
@Override
|
189
|
+
public boolean hasValueInstantiators() { return _valueInstantiators.length > 0; }
|
190
|
+
|
191
|
+
@Override
|
192
|
+
public Iterable<Deserializers> deserializers() {
|
193
|
+
return ArrayBuilders.arrayAsIterable(_additionalDeserializers);
|
194
|
+
}
|
195
|
+
|
196
|
+
@Override
|
197
|
+
public Iterable<KeyDeserializers> keyDeserializers() {
|
198
|
+
return ArrayBuilders.arrayAsIterable(_additionalKeyDeserializers);
|
199
|
+
}
|
200
|
+
|
201
|
+
@Override
|
202
|
+
public Iterable<BeanDeserializerModifier> deserializerModifiers() {
|
203
|
+
return ArrayBuilders.arrayAsIterable(_modifiers);
|
204
|
+
}
|
205
|
+
|
206
|
+
@Override
|
207
|
+
public Iterable<AbstractTypeResolver> abstractTypeResolvers() {
|
208
|
+
return ArrayBuilders.arrayAsIterable(_abstractTypeResolvers);
|
209
|
+
}
|
210
|
+
|
211
|
+
@Override
|
212
|
+
public Iterable<ValueInstantiators> valueInstantiators() {
|
213
|
+
return ArrayBuilders.arrayAsIterable(_valueInstantiators);
|
214
|
+
}
|
215
|
+
}
|
216
|
+
|
217
|
+
/*
|
218
|
+
/**********************************************************
|
219
|
+
/* Life-cycle
|
220
|
+
/**********************************************************
|
221
|
+
*/
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Globally shareable thread-safe instance which has no additional custom deserializers
|
225
|
+
* registered
|
226
|
+
*/
|
227
|
+
public final static BeanDeserializerFactory instance = new BeanDeserializerFactory(null);
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Configuration settings for this factory; immutable instance (just like this
|
231
|
+
* factory), new version created via copy-constructor (fluent-style)
|
232
|
+
*
|
233
|
+
* @since 1.7
|
234
|
+
*/
|
235
|
+
protected final Config _factoryConfig;
|
236
|
+
|
237
|
+
@Deprecated
|
238
|
+
public BeanDeserializerFactory() {
|
239
|
+
this(null);
|
240
|
+
}
|
241
|
+
|
242
|
+
/**
|
243
|
+
* @since 1.7
|
244
|
+
*/
|
245
|
+
public BeanDeserializerFactory(DeserializerFactory.Config config) {
|
246
|
+
if (config == null) {
|
247
|
+
config = new ConfigImpl();
|
248
|
+
}
|
249
|
+
_factoryConfig = config;
|
250
|
+
}
|
251
|
+
|
252
|
+
@Override
|
253
|
+
public final Config getConfig() {
|
254
|
+
return _factoryConfig;
|
255
|
+
}
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Method used by module registration functionality, to construct a new bean
|
259
|
+
* deserializer factory
|
260
|
+
* with different configuration settings.
|
261
|
+
*
|
262
|
+
* @since 1.7
|
263
|
+
*/
|
264
|
+
@Override
|
265
|
+
public DeserializerFactory withConfig(DeserializerFactory.Config config)
|
266
|
+
{
|
267
|
+
if (_factoryConfig == config) {
|
268
|
+
return this;
|
269
|
+
}
|
270
|
+
|
271
|
+
/* 22-Nov-2010, tatu: Handling of subtypes is tricky if we do immutable-with-copy-ctor;
|
272
|
+
* and we pretty much have to here either choose between losing subtype instance
|
273
|
+
* when registering additional deserializers, or losing deserializers.
|
274
|
+
* Instead, let's actually just throw an error if this method is called when subtype
|
275
|
+
* has not properly overridden this method; this to indicate problem as soon as possible.
|
276
|
+
*/
|
277
|
+
if (getClass() != BeanDeserializerFactory.class) {
|
278
|
+
throw new IllegalStateException("Subtype of BeanDeserializerFactory ("+getClass().getName()
|
279
|
+
+") has not properly overridden method 'withAdditionalDeserializers': can not instantiate subtype with "
|
280
|
+
+"additional deserializer definitions");
|
281
|
+
}
|
282
|
+
return new BeanDeserializerFactory(config);
|
283
|
+
}
|
284
|
+
|
285
|
+
/*
|
286
|
+
/**********************************************************
|
287
|
+
/* Overrides for super-class methods used for finding
|
288
|
+
/* custom deserializers
|
289
|
+
/**********************************************************
|
290
|
+
*/
|
291
|
+
|
292
|
+
@Override
|
293
|
+
public KeyDeserializer createKeyDeserializer(DeserializationConfig config, JavaType type,
|
294
|
+
BeanProperty property)
|
295
|
+
throws JsonMappingException
|
296
|
+
{
|
297
|
+
// First: possible custom deserializers
|
298
|
+
if (_factoryConfig.hasKeyDeserializers()) {
|
299
|
+
BasicBeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass());
|
300
|
+
for (KeyDeserializers d : _factoryConfig.keyDeserializers()) {
|
301
|
+
KeyDeserializer deser = d.findKeyDeserializer(type, config, beanDesc, property);
|
302
|
+
if (deser != null) {
|
303
|
+
return deser;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
}
|
307
|
+
// and if none found, standard ones:
|
308
|
+
// No serializer needed if it's plain old String, or Object/untyped
|
309
|
+
Class<?> raw = type.getRawClass();
|
310
|
+
if (raw == String.class || raw == Object.class) {
|
311
|
+
return StdKeyDeserializers.constructStringKeyDeserializer(config, type);
|
312
|
+
}
|
313
|
+
// Most other keys are of limited number of static types
|
314
|
+
KeyDeserializer kdes = _keyDeserializers.get(type);
|
315
|
+
if (kdes != null) {
|
316
|
+
return kdes;
|
317
|
+
}
|
318
|
+
// And then other one-offs; first, Enum:
|
319
|
+
if (type.isEnumType()) {
|
320
|
+
return _createEnumKeyDeserializer(config, type, property);
|
321
|
+
}
|
322
|
+
// One more thing: can we find ctor(String) or valueOf(String)?
|
323
|
+
kdes = StdKeyDeserializers.findStringBasedKeyDeserializer(config, type);
|
324
|
+
return kdes;
|
325
|
+
}
|
326
|
+
|
327
|
+
private KeyDeserializer _createEnumKeyDeserializer(DeserializationConfig config, JavaType type,
|
328
|
+
BeanProperty property)
|
329
|
+
throws JsonMappingException
|
330
|
+
{
|
331
|
+
BasicBeanDescription beanDesc = config.introspect(type);
|
332
|
+
Class<?> enumClass = type.getRawClass();
|
333
|
+
EnumResolver<?> enumRes = constructEnumResolver(enumClass, config);
|
334
|
+
// [JACKSON-193] May have @JsonCreator for static factory method:
|
335
|
+
for (AnnotatedMethod factory : beanDesc.getFactoryMethods()) {
|
336
|
+
if (config.getAnnotationIntrospector().hasCreatorAnnotation(factory)) {
|
337
|
+
int argCount = factory.getParameterCount();
|
338
|
+
if (argCount == 1) {
|
339
|
+
Class<?> returnType = factory.getRawType();
|
340
|
+
// usually should be class, but may be just plain Enum<?> (for Enum.valueOf()?)
|
341
|
+
if (returnType.isAssignableFrom(enumClass)) {
|
342
|
+
// note: mostly copied from 'EnumDeserializer.deserializerForCreator(...)'
|
343
|
+
if (factory.getParameterType(0) != String.class) {
|
344
|
+
throw new IllegalArgumentException("Parameter #0 type for factory method ("+factory+") not suitable, must be java.lang.String");
|
345
|
+
}
|
346
|
+
if (config.canOverrideAccessModifiers()) {
|
347
|
+
ClassUtil.checkAndFixAccess(factory.getMember());
|
348
|
+
}
|
349
|
+
return StdKeyDeserializers.constructEnumKeyDeserializer(enumRes, factory);
|
350
|
+
}
|
351
|
+
}
|
352
|
+
throw new IllegalArgumentException("Unsuitable method ("+factory+") decorated with @JsonCreator (for Enum type "
|
353
|
+
+enumClass.getName()+")");
|
354
|
+
}
|
355
|
+
}
|
356
|
+
// [JACKSON-749] Also, need to consider @JsonValue, if one found
|
357
|
+
return StdKeyDeserializers.constructEnumKeyDeserializer(enumRes);
|
358
|
+
}
|
359
|
+
|
360
|
+
@Override
|
361
|
+
protected JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType type, DeserializationConfig config,
|
362
|
+
DeserializerProvider provider,
|
363
|
+
BeanProperty property,
|
364
|
+
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
|
365
|
+
throws JsonMappingException
|
366
|
+
{
|
367
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
368
|
+
JsonDeserializer<?> deser = d.findArrayDeserializer(type, config, provider, property,
|
369
|
+
elementTypeDeserializer, elementDeserializer);
|
370
|
+
if (deser != null) {
|
371
|
+
return deser;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
return null;
|
375
|
+
}
|
376
|
+
|
377
|
+
@Override
|
378
|
+
protected JsonDeserializer<?> _findCustomCollectionDeserializer(CollectionType type, DeserializationConfig config,
|
379
|
+
DeserializerProvider provider, BasicBeanDescription beanDesc,
|
380
|
+
BeanProperty property,
|
381
|
+
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
|
382
|
+
throws JsonMappingException
|
383
|
+
{
|
384
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
385
|
+
JsonDeserializer<?> deser = d.findCollectionDeserializer(type, config, provider, beanDesc, property,
|
386
|
+
elementTypeDeserializer, elementDeserializer);
|
387
|
+
if (deser != null) {
|
388
|
+
return deser;
|
389
|
+
}
|
390
|
+
}
|
391
|
+
return null;
|
392
|
+
}
|
393
|
+
|
394
|
+
@Override
|
395
|
+
protected JsonDeserializer<?> _findCustomCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config,
|
396
|
+
DeserializerProvider provider, BasicBeanDescription beanDesc,
|
397
|
+
BeanProperty property,
|
398
|
+
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
|
399
|
+
throws JsonMappingException
|
400
|
+
{
|
401
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
402
|
+
JsonDeserializer<?> deser = d.findCollectionLikeDeserializer(type, config, provider, beanDesc, property,
|
403
|
+
elementTypeDeserializer, elementDeserializer);
|
404
|
+
if (deser != null) {
|
405
|
+
return deser;
|
406
|
+
}
|
407
|
+
}
|
408
|
+
return null;
|
409
|
+
}
|
410
|
+
|
411
|
+
@Override
|
412
|
+
protected JsonDeserializer<?> _findCustomEnumDeserializer(Class<?> type, DeserializationConfig config,
|
413
|
+
BasicBeanDescription beanDesc, BeanProperty property)
|
414
|
+
throws JsonMappingException
|
415
|
+
{
|
416
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
417
|
+
JsonDeserializer<?> deser = d.findEnumDeserializer(type, config, beanDesc, property);
|
418
|
+
if (deser != null) {
|
419
|
+
return deser;
|
420
|
+
}
|
421
|
+
}
|
422
|
+
return null;
|
423
|
+
}
|
424
|
+
|
425
|
+
@Override
|
426
|
+
protected JsonDeserializer<?> _findCustomMapDeserializer(MapType type,
|
427
|
+
DeserializationConfig config,
|
428
|
+
DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property,
|
429
|
+
KeyDeserializer keyDeserializer,
|
430
|
+
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
|
431
|
+
throws JsonMappingException
|
432
|
+
{
|
433
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
434
|
+
JsonDeserializer<?> deser = d.findMapDeserializer(type, config, provider, beanDesc, property,
|
435
|
+
keyDeserializer, elementTypeDeserializer, elementDeserializer);
|
436
|
+
if (deser != null) {
|
437
|
+
return deser;
|
438
|
+
}
|
439
|
+
}
|
440
|
+
return null;
|
441
|
+
}
|
442
|
+
|
443
|
+
@Override
|
444
|
+
protected JsonDeserializer<?> _findCustomMapLikeDeserializer(MapLikeType type,
|
445
|
+
DeserializationConfig config,
|
446
|
+
DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property,
|
447
|
+
KeyDeserializer keyDeserializer,
|
448
|
+
TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)
|
449
|
+
throws JsonMappingException
|
450
|
+
{
|
451
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
452
|
+
JsonDeserializer<?> deser = d.findMapLikeDeserializer(type, config, provider, beanDesc, property,
|
453
|
+
keyDeserializer, elementTypeDeserializer, elementDeserializer);
|
454
|
+
if (deser != null) {
|
455
|
+
return deser;
|
456
|
+
}
|
457
|
+
}
|
458
|
+
return null;
|
459
|
+
}
|
460
|
+
|
461
|
+
@Override
|
462
|
+
protected JsonDeserializer<?> _findCustomTreeNodeDeserializer(Class<? extends JsonNode> type,
|
463
|
+
DeserializationConfig config, BeanProperty property)
|
464
|
+
throws JsonMappingException
|
465
|
+
{
|
466
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
467
|
+
JsonDeserializer<?> deser = d.findTreeNodeDeserializer(type, config, property);
|
468
|
+
if (deser != null) {
|
469
|
+
return deser;
|
470
|
+
}
|
471
|
+
}
|
472
|
+
return null;
|
473
|
+
}
|
474
|
+
|
475
|
+
// Note: NOT overriding, superclass has no matching method
|
476
|
+
@SuppressWarnings("unchecked")
|
477
|
+
protected JsonDeserializer<Object> _findCustomBeanDeserializer(JavaType type, DeserializationConfig config,
|
478
|
+
DeserializerProvider provider, BasicBeanDescription beanDesc, BeanProperty property)
|
479
|
+
throws JsonMappingException
|
480
|
+
{
|
481
|
+
for (Deserializers d : _factoryConfig.deserializers()) {
|
482
|
+
JsonDeserializer<?> deser = d.findBeanDeserializer(type, config, provider, beanDesc, property);
|
483
|
+
if (deser != null) {
|
484
|
+
return (JsonDeserializer<Object>) deser;
|
485
|
+
}
|
486
|
+
}
|
487
|
+
return null;
|
488
|
+
}
|
489
|
+
|
490
|
+
/*
|
491
|
+
/**********************************************************
|
492
|
+
/* DeserializerFactory API implementation
|
493
|
+
/**********************************************************
|
494
|
+
*/
|
495
|
+
|
496
|
+
/**
|
497
|
+
* Method that will find complete abstract type mapping for specified type, doing as
|
498
|
+
* many resolution steps as necessary.
|
499
|
+
*/
|
500
|
+
@Override
|
501
|
+
public JavaType mapAbstractType(DeserializationConfig config, JavaType type)
|
502
|
+
throws JsonMappingException
|
503
|
+
{
|
504
|
+
while (true) {
|
505
|
+
JavaType next = _mapAbstractType2(config, type);
|
506
|
+
if (next == null) {
|
507
|
+
return type;
|
508
|
+
}
|
509
|
+
/* Should not have to worry about cycles; but better verify since they will invariably
|
510
|
+
* occur... :-)
|
511
|
+
* (also: guard against invalid resolution to a non-related type)
|
512
|
+
*/
|
513
|
+
Class<?> prevCls = type.getRawClass();
|
514
|
+
Class<?> nextCls = next.getRawClass();
|
515
|
+
if ((prevCls == nextCls) || !prevCls.isAssignableFrom(nextCls)) {
|
516
|
+
throw new IllegalArgumentException("Invalid abstract type resolution from "+type+" to "+next+": latter is not a subtype of former");
|
517
|
+
}
|
518
|
+
type = next;
|
519
|
+
}
|
520
|
+
}
|
521
|
+
|
522
|
+
/**
|
523
|
+
* Value instantiator is created both based on creator annotations,
|
524
|
+
* and on optional externally provided instantiators (registered through
|
525
|
+
* module interface).
|
526
|
+
*/
|
527
|
+
@Override
|
528
|
+
public ValueInstantiator findValueInstantiator(DeserializationConfig config,
|
529
|
+
BasicBeanDescription beanDesc)
|
530
|
+
throws JsonMappingException
|
531
|
+
{
|
532
|
+
ValueInstantiator instantiator;
|
533
|
+
// [JACKSON-633] Check @JsonValueInstantiator before anything else
|
534
|
+
AnnotatedClass ac = beanDesc.getClassInfo();
|
535
|
+
Object instDef = config.getAnnotationIntrospector().findValueInstantiator(ac);
|
536
|
+
if (instDef != null) {
|
537
|
+
if (instDef instanceof ValueInstantiator) {
|
538
|
+
instantiator = (ValueInstantiator) instDef;
|
539
|
+
} else {
|
540
|
+
if (!(instDef instanceof Class<?>)) { // sanity check
|
541
|
+
throw new IllegalStateException("Invalid value instantiator returned for type "+beanDesc+": neither a Class nor ValueInstantiator");
|
542
|
+
}
|
543
|
+
Class<?> cls = (Class<?>) instDef;
|
544
|
+
if (!ValueInstantiator.class.isAssignableFrom(cls)) {
|
545
|
+
throw new IllegalStateException("Invalid instantiator Class<?> returned for type "+beanDesc+": "
|
546
|
+
+cls.getName()+" not a ValueInstantiator");
|
547
|
+
}
|
548
|
+
@SuppressWarnings("unchecked")
|
549
|
+
Class<? extends ValueInstantiator> instClass = (Class<? extends ValueInstantiator>) cls;
|
550
|
+
instantiator = config.valueInstantiatorInstance(ac, (Class<? extends ValueInstantiator>)instClass);
|
551
|
+
}
|
552
|
+
} else {
|
553
|
+
instantiator = constructDefaultValueInstantiator(config, beanDesc);
|
554
|
+
}
|
555
|
+
|
556
|
+
// finally: anyone want to modify ValueInstantiator?
|
557
|
+
if (_factoryConfig.hasValueInstantiators()) {
|
558
|
+
for (ValueInstantiators insts : _factoryConfig.valueInstantiators()) {
|
559
|
+
instantiator = insts.findValueInstantiator(config, beanDesc, instantiator);
|
560
|
+
// let's do sanity check; easier to spot buggy handlers
|
561
|
+
if (instantiator == null) {
|
562
|
+
throw new JsonMappingException("Broken registered ValueInstantiators (of type "
|
563
|
+
+insts.getClass().getName()+"): returned null ValueInstantiator");
|
564
|
+
}
|
565
|
+
}
|
566
|
+
}
|
567
|
+
|
568
|
+
return instantiator;
|
569
|
+
}
|
570
|
+
|
571
|
+
/**
|
572
|
+
* Method that {@link DeserializerProvider}s call to create a new
|
573
|
+
* deserializer for types other than Collections, Maps, arrays and
|
574
|
+
* enums.
|
575
|
+
*/
|
576
|
+
@Override
|
577
|
+
public JsonDeserializer<Object> createBeanDeserializer(DeserializationConfig config,
|
578
|
+
DeserializerProvider p, JavaType type, BeanProperty property)
|
579
|
+
throws JsonMappingException
|
580
|
+
{
|
581
|
+
// First things first: abstract types may use defaulting:
|
582
|
+
if (type.isAbstract()) {
|
583
|
+
type = mapAbstractType(config, type);
|
584
|
+
}
|
585
|
+
|
586
|
+
// First things first: maybe explicit definition via annotations?
|
587
|
+
BasicBeanDescription beanDesc = config.introspect(type);
|
588
|
+
JsonDeserializer<Object> ad = findDeserializerFromAnnotation(config, beanDesc.getClassInfo(), property);
|
589
|
+
if (ad != null) {
|
590
|
+
return ad;
|
591
|
+
}
|
592
|
+
// Or value annotation that indicates more specific type to use:
|
593
|
+
JavaType newType = modifyTypeByAnnotation(config, beanDesc.getClassInfo(), type, null);
|
594
|
+
if (newType.getRawClass() != type.getRawClass()) {
|
595
|
+
type = newType;
|
596
|
+
beanDesc = config.introspect(type);
|
597
|
+
}
|
598
|
+
// We may also have custom overrides:
|
599
|
+
JsonDeserializer<Object> custom = _findCustomBeanDeserializer(type, config, p, beanDesc, property);
|
600
|
+
if (custom != null) {
|
601
|
+
return custom;
|
602
|
+
}
|
603
|
+
/* One more thing to check: do we have an exception type
|
604
|
+
* (Throwable or its sub-classes)? If so, need slightly
|
605
|
+
* different handling.
|
606
|
+
*/
|
607
|
+
if (type.isThrowable()) {
|
608
|
+
return buildThrowableDeserializer(config, type, beanDesc, property);
|
609
|
+
}
|
610
|
+
/* Or, for abstract types, may have alternate means for resolution
|
611
|
+
* (defaulting, materialization)
|
612
|
+
*/
|
613
|
+
if (type.isAbstract()) {
|
614
|
+
// [JACKSON-41] (v1.6): Let's make it possible to materialize abstract types.
|
615
|
+
JavaType concreteType = materializeAbstractType(config, beanDesc);
|
616
|
+
if (concreteType != null) {
|
617
|
+
/* important: introspect actual implementation (abstract class or
|
618
|
+
* interface doesn't have constructors, for one)
|
619
|
+
*/
|
620
|
+
beanDesc = config.introspect(concreteType);
|
621
|
+
return buildBeanDeserializer(config, concreteType, beanDesc, property);
|
622
|
+
}
|
623
|
+
}
|
624
|
+
|
625
|
+
// Otherwise, may want to check handlers for standard types, from superclass:
|
626
|
+
JsonDeserializer<Object> deser = findStdBeanDeserializer(config, p, type, property);
|
627
|
+
if (deser != null) {
|
628
|
+
return deser;
|
629
|
+
}
|
630
|
+
|
631
|
+
// Otherwise: could the class be a Bean class? If not, bail out
|
632
|
+
if (!isPotentialBeanType(type.getRawClass())) {
|
633
|
+
return null;
|
634
|
+
}
|
635
|
+
// Use generic bean introspection to build deserializer
|
636
|
+
return buildBeanDeserializer(config, type, beanDesc, property);
|
637
|
+
}
|
638
|
+
|
639
|
+
/**
|
640
|
+
* Method that will find abstract type mapping for specified type, doing a single
|
641
|
+
* lookup through registered abstract type resolvers; will not do recursive lookups.
|
642
|
+
*/
|
643
|
+
protected JavaType _mapAbstractType2(DeserializationConfig config, JavaType type)
|
644
|
+
throws JsonMappingException
|
645
|
+
{
|
646
|
+
Class<?> currClass = type.getRawClass();
|
647
|
+
if (_factoryConfig.hasAbstractTypeResolvers()) {
|
648
|
+
for (AbstractTypeResolver resolver : _factoryConfig.abstractTypeResolvers()) {
|
649
|
+
JavaType concrete = resolver.findTypeMapping(config, type);
|
650
|
+
if (concrete != null && concrete.getRawClass() != currClass) {
|
651
|
+
return concrete;
|
652
|
+
}
|
653
|
+
}
|
654
|
+
}
|
655
|
+
return null;
|
656
|
+
}
|
657
|
+
|
658
|
+
protected JavaType materializeAbstractType(DeserializationConfig config,
|
659
|
+
BasicBeanDescription beanDesc)
|
660
|
+
throws JsonMappingException
|
661
|
+
{
|
662
|
+
final JavaType abstractType = beanDesc.getType();
|
663
|
+
|
664
|
+
/* [JACKSON-502] (1.8): Now it is possible to have multiple resolvers too,
|
665
|
+
* as they are registered via module interface.
|
666
|
+
*/
|
667
|
+
for (AbstractTypeResolver r : _factoryConfig.abstractTypeResolvers()) {
|
668
|
+
JavaType concrete = r.resolveAbstractType(config, abstractType);
|
669
|
+
if (concrete != null) {
|
670
|
+
return concrete;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
return null;
|
674
|
+
}
|
675
|
+
|
676
|
+
/*
|
677
|
+
/**********************************************************
|
678
|
+
/* Public construction method beyond DeserializerFactory API:
|
679
|
+
/* can be called from outside as well as overridden by
|
680
|
+
/* sub-classes
|
681
|
+
/**********************************************************
|
682
|
+
*/
|
683
|
+
|
684
|
+
/**
|
685
|
+
* Method that is to actually build a bean deserializer instance.
|
686
|
+
* All basic sanity checks have been done to know that what we have
|
687
|
+
* may be a valid bean type, and that there are no default simple
|
688
|
+
* deserializers.
|
689
|
+
*/
|
690
|
+
@SuppressWarnings("unchecked")
|
691
|
+
public JsonDeserializer<Object> buildBeanDeserializer(DeserializationConfig config,
|
692
|
+
JavaType type, BasicBeanDescription beanDesc, BeanProperty property)
|
693
|
+
throws JsonMappingException
|
694
|
+
{
|
695
|
+
// First: check what creators we can use, if any
|
696
|
+
ValueInstantiator valueInstantiator = findValueInstantiator(config, beanDesc);
|
697
|
+
// ... since often we have nothing to go on, if we have abstract type:
|
698
|
+
if (type.isAbstract()) {
|
699
|
+
if (!valueInstantiator.canInstantiate()) {
|
700
|
+
// and if so, need placeholder deserializer
|
701
|
+
return new AbstractDeserializer(type);
|
702
|
+
}
|
703
|
+
}
|
704
|
+
BeanDeserializerBuilder builder = constructBeanDeserializerBuilder(beanDesc);
|
705
|
+
builder.setValueInstantiator(valueInstantiator);
|
706
|
+
// And then setters for deserializing from JSON Object
|
707
|
+
addBeanProps(config, beanDesc, builder);
|
708
|
+
// managed/back reference fields/setters need special handling... first part
|
709
|
+
addReferenceProperties(config, beanDesc, builder);
|
710
|
+
addInjectables(config, beanDesc, builder);
|
711
|
+
|
712
|
+
// [JACKSON-440]: update builder now that all information is in?
|
713
|
+
if (_factoryConfig.hasDeserializerModifiers()) {
|
714
|
+
for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) {
|
715
|
+
builder = mod.updateBuilder(config, beanDesc, builder);
|
716
|
+
}
|
717
|
+
}
|
718
|
+
JsonDeserializer<?> deserializer = builder.build(property);
|
719
|
+
|
720
|
+
// [JACKSON-440]: may have modifier(s) that wants to modify or replace serializer we just built:
|
721
|
+
if (_factoryConfig.hasDeserializerModifiers()) {
|
722
|
+
for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) {
|
723
|
+
deserializer = mod.modifyDeserializer(config, beanDesc, deserializer);
|
724
|
+
}
|
725
|
+
}
|
726
|
+
return (JsonDeserializer<Object>) deserializer;
|
727
|
+
|
728
|
+
}
|
729
|
+
|
730
|
+
@SuppressWarnings("unchecked")
|
731
|
+
public JsonDeserializer<Object> buildThrowableDeserializer(DeserializationConfig config,
|
732
|
+
JavaType type, BasicBeanDescription beanDesc, BeanProperty property)
|
733
|
+
throws JsonMappingException
|
734
|
+
{
|
735
|
+
// first: construct like a regular bean deserializer...
|
736
|
+
BeanDeserializerBuilder builder = constructBeanDeserializerBuilder(beanDesc);
|
737
|
+
builder.setValueInstantiator(findValueInstantiator(config, beanDesc));
|
738
|
+
|
739
|
+
addBeanProps(config, beanDesc, builder);
|
740
|
+
// (and assume there won't be any back references)
|
741
|
+
|
742
|
+
// But then let's decorate things a bit
|
743
|
+
/* To resolve [JACKSON-95], need to add "initCause" as setter
|
744
|
+
* for exceptions (sub-classes of Throwable).
|
745
|
+
*/
|
746
|
+
AnnotatedMethod am = beanDesc.findMethod("initCause", INIT_CAUSE_PARAMS);
|
747
|
+
if (am != null) { // should never be null
|
748
|
+
SettableBeanProperty prop = constructSettableProperty(config, beanDesc, "cause", am);
|
749
|
+
if (prop != null) {
|
750
|
+
/* 21-Aug-2011, tatus: We may actually have found 'cause' property
|
751
|
+
* to set (with new 1.9 code)... but let's replace it just in case,
|
752
|
+
* otherwise can end up with odd errors.
|
753
|
+
*/
|
754
|
+
builder.addOrReplaceProperty(prop, true);
|
755
|
+
}
|
756
|
+
}
|
757
|
+
|
758
|
+
// And also need to ignore "localizedMessage"
|
759
|
+
builder.addIgnorable("localizedMessage");
|
760
|
+
/* As well as "message": it will be passed via constructor,
|
761
|
+
* as there's no 'setMessage()' method
|
762
|
+
*/
|
763
|
+
builder.addIgnorable("message");
|
764
|
+
|
765
|
+
// [JACKSON-440]: update builder now that all information is in?
|
766
|
+
if (_factoryConfig.hasDeserializerModifiers()) {
|
767
|
+
for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) {
|
768
|
+
builder = mod.updateBuilder(config, beanDesc, builder);
|
769
|
+
}
|
770
|
+
}
|
771
|
+
JsonDeserializer<?> deserializer = builder.build(property);
|
772
|
+
|
773
|
+
/* At this point it ought to be a BeanDeserializer; if not, must assume
|
774
|
+
* it's some other thing that can handle deserialization ok...
|
775
|
+
*/
|
776
|
+
if (deserializer instanceof BeanDeserializer) {
|
777
|
+
deserializer = new ThrowableDeserializer((BeanDeserializer) deserializer);
|
778
|
+
}
|
779
|
+
|
780
|
+
// [JACKSON-440]: may have modifier(s) that wants to modify or replace serializer we just built:
|
781
|
+
if (_factoryConfig.hasDeserializerModifiers()) {
|
782
|
+
for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) {
|
783
|
+
deserializer = mod.modifyDeserializer(config, beanDesc, deserializer);
|
784
|
+
}
|
785
|
+
}
|
786
|
+
return (JsonDeserializer<Object>) deserializer;
|
787
|
+
}
|
788
|
+
|
789
|
+
/*
|
790
|
+
/**********************************************************
|
791
|
+
/* Helper methods for Bean deserializer construction,
|
792
|
+
/* overridable by sub-classes
|
793
|
+
/**********************************************************
|
794
|
+
*/
|
795
|
+
|
796
|
+
/**
|
797
|
+
* Overridable method that constructs a {@link BeanDeserializerBuilder}
|
798
|
+
* which is used to accumulate information needed to create deserializer
|
799
|
+
* instance.
|
800
|
+
*
|
801
|
+
* @since 1.7
|
802
|
+
*/
|
803
|
+
protected BeanDeserializerBuilder constructBeanDeserializerBuilder(BasicBeanDescription beanDesc) {
|
804
|
+
return new BeanDeserializerBuilder(beanDesc);
|
805
|
+
}
|
806
|
+
|
807
|
+
/**
|
808
|
+
* Method that will construct standard default {@link ValueInstantiator}
|
809
|
+
* using annotations (like @JsonCreator) and visibility rules
|
810
|
+
*
|
811
|
+
* @since 1.9
|
812
|
+
*/
|
813
|
+
protected ValueInstantiator constructDefaultValueInstantiator(DeserializationConfig config,
|
814
|
+
BasicBeanDescription beanDesc)
|
815
|
+
throws JsonMappingException
|
816
|
+
{
|
817
|
+
boolean fixAccess = config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS);
|
818
|
+
CreatorCollector creators = new CreatorCollector(beanDesc, fixAccess);
|
819
|
+
AnnotationIntrospector intr = config.getAnnotationIntrospector();
|
820
|
+
|
821
|
+
// First, let's figure out constructor/factory-based instantiation
|
822
|
+
// 23-Jan-2010, tatus: but only for concrete types
|
823
|
+
if (beanDesc.getType().isConcrete()) {
|
824
|
+
AnnotatedConstructor defaultCtor = beanDesc.findDefaultConstructor();
|
825
|
+
if (defaultCtor != null) {
|
826
|
+
if (fixAccess) {
|
827
|
+
ClassUtil.checkAndFixAccess(defaultCtor.getAnnotated());
|
828
|
+
}
|
829
|
+
creators.setDefaultConstructor(defaultCtor);
|
830
|
+
}
|
831
|
+
}
|
832
|
+
|
833
|
+
// need to construct suitable visibility checker:
|
834
|
+
VisibilityChecker<?> vchecker = config.getDefaultVisibilityChecker();
|
835
|
+
vchecker = config.getAnnotationIntrospector().findAutoDetectVisibility(beanDesc.getClassInfo(), vchecker);
|
836
|
+
|
837
|
+
/* Important: first add factory methods; then constructors, so
|
838
|
+
* latter can override former!
|
839
|
+
*/
|
840
|
+
_addDeserializerFactoryMethods(config, beanDesc, vchecker, intr, creators);
|
841
|
+
_addDeserializerConstructors(config, beanDesc, vchecker, intr, creators);
|
842
|
+
|
843
|
+
return creators.constructValueInstantiator(config);
|
844
|
+
}
|
845
|
+
|
846
|
+
protected void _addDeserializerConstructors
|
847
|
+
(DeserializationConfig config, BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker,
|
848
|
+
AnnotationIntrospector intr, CreatorCollector creators)
|
849
|
+
throws JsonMappingException
|
850
|
+
{
|
851
|
+
for (AnnotatedConstructor ctor : beanDesc.getConstructors()) {
|
852
|
+
int argCount = ctor.getParameterCount();
|
853
|
+
if (argCount < 1) {
|
854
|
+
continue;
|
855
|
+
}
|
856
|
+
boolean isCreator = intr.hasCreatorAnnotation(ctor);
|
857
|
+
boolean isVisible = vchecker.isCreatorVisible(ctor);
|
858
|
+
// some single-arg constructors (String, number) are auto-detected
|
859
|
+
if (argCount == 1) {
|
860
|
+
_handleSingleArgumentConstructor(config, beanDesc, vchecker, intr, creators,
|
861
|
+
ctor, isCreator, isVisible);
|
862
|
+
continue;
|
863
|
+
}
|
864
|
+
if (!isCreator && !isVisible) {
|
865
|
+
continue;
|
866
|
+
}
|
867
|
+
// [JACKSON-541] improved handling a bit so:
|
868
|
+
// 2 or more args; all params must have name annotations
|
869
|
+
// ... or @JacksonInject (or equivalent)
|
870
|
+
// But if it was auto-detected and there's no annotations, keep silent (was not meant to be a creator?)
|
871
|
+
boolean annotationFound = false;
|
872
|
+
/* [JACKSON-712] One more possibility; can have 1 or more injectables, and
|
873
|
+
* exactly one non-annotated parameter: if so, it's still delegating.
|
874
|
+
*/
|
875
|
+
AnnotatedParameter nonAnnotatedParam = null;
|
876
|
+
int namedCount = 0;
|
877
|
+
int injectCount = 0;
|
878
|
+
CreatorProperty[] properties = new CreatorProperty[argCount];
|
879
|
+
for (int i = 0; i < argCount; ++i) {
|
880
|
+
AnnotatedParameter param = ctor.getParameter(i);
|
881
|
+
String name = (param == null) ? null : intr.findPropertyNameForParam(param);
|
882
|
+
Object injectId = intr.findInjectableValueId(param);
|
883
|
+
if (name != null && name.length() > 0) {
|
884
|
+
++namedCount;
|
885
|
+
properties[i] = constructCreatorProperty(config, beanDesc, name, i, param, injectId);
|
886
|
+
} else if (injectId != null) {
|
887
|
+
++injectCount;
|
888
|
+
properties[i] = constructCreatorProperty(config, beanDesc, name, i, param, injectId);
|
889
|
+
} else if (nonAnnotatedParam == null) {
|
890
|
+
nonAnnotatedParam = param;
|
891
|
+
}
|
892
|
+
}
|
893
|
+
|
894
|
+
// Ok: if named or injectable, we have more work to do
|
895
|
+
if (isCreator || namedCount > 0 || injectCount > 0) {
|
896
|
+
// simple case; everything covered:
|
897
|
+
if ((namedCount + injectCount) == argCount) {
|
898
|
+
creators.addPropertyCreator(ctor, properties);
|
899
|
+
} else if ((namedCount == 0) && ((injectCount + 1) == argCount)) {
|
900
|
+
// secondary: all but one injectable, one un-annotated (un-named)
|
901
|
+
// [JACKSON-712] SHOULD support; but we won't yet (tricky to do, not impossible)
|
902
|
+
throw new IllegalArgumentException("Delegated constructor with Injectables not yet supported (see [JACKSON-712]) for "
|
903
|
+
+ctor);
|
904
|
+
} else { // otherwise, epic fail
|
905
|
+
throw new IllegalArgumentException("Argument #"+nonAnnotatedParam.getIndex()+" of constructor "+ctor+" has no property name annotation; must have name when multiple-paramater constructor annotated as Creator");
|
906
|
+
}
|
907
|
+
}
|
908
|
+
if (annotationFound) {
|
909
|
+
creators.addPropertyCreator(ctor, properties);
|
910
|
+
}
|
911
|
+
}
|
912
|
+
}
|
913
|
+
|
914
|
+
protected boolean _handleSingleArgumentConstructor(DeserializationConfig config,
|
915
|
+
BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker,
|
916
|
+
AnnotationIntrospector intr, CreatorCollector creators,
|
917
|
+
AnnotatedConstructor ctor, boolean isCreator, boolean isVisible)
|
918
|
+
throws JsonMappingException
|
919
|
+
{
|
920
|
+
// note: if we do have parameter name, it'll be "property constructor":
|
921
|
+
AnnotatedParameter param = ctor.getParameter(0);
|
922
|
+
String name = intr.findPropertyNameForParam(param);
|
923
|
+
Object injectId = intr.findInjectableValueId(param);
|
924
|
+
|
925
|
+
if ((injectId != null) || (name != null && name.length() > 0)) { // property-based
|
926
|
+
// We know there's a name and it's only 1 parameter.
|
927
|
+
CreatorProperty[] properties = new CreatorProperty[1];
|
928
|
+
properties[0] = constructCreatorProperty(config, beanDesc, name, 0, param, injectId);
|
929
|
+
creators.addPropertyCreator(ctor, properties);
|
930
|
+
return true;
|
931
|
+
}
|
932
|
+
|
933
|
+
// otherwise either 'simple' number, String, or general delegate:
|
934
|
+
Class<?> type = ctor.getParameterClass(0);
|
935
|
+
if (type == String.class) {
|
936
|
+
if (isCreator || isVisible) {
|
937
|
+
creators.addStringCreator(ctor);
|
938
|
+
}
|
939
|
+
return true;
|
940
|
+
}
|
941
|
+
if (type == int.class || type == Integer.class) {
|
942
|
+
if (isCreator || isVisible) {
|
943
|
+
creators.addIntCreator(ctor);
|
944
|
+
}
|
945
|
+
return true;
|
946
|
+
}
|
947
|
+
if (type == long.class || type == Long.class) {
|
948
|
+
if (isCreator || isVisible) {
|
949
|
+
creators.addLongCreator(ctor);
|
950
|
+
}
|
951
|
+
return true;
|
952
|
+
}
|
953
|
+
if (type == double.class || type == Double.class) {
|
954
|
+
if (isCreator || isVisible) {
|
955
|
+
creators.addDoubleCreator(ctor);
|
956
|
+
}
|
957
|
+
return true;
|
958
|
+
}
|
959
|
+
|
960
|
+
// Delegating Creator ok iff it has @JsonCreator (etc)
|
961
|
+
if (isCreator) {
|
962
|
+
creators.addDelegatingCreator(ctor);
|
963
|
+
return true;
|
964
|
+
}
|
965
|
+
return false;
|
966
|
+
}
|
967
|
+
|
968
|
+
protected void _addDeserializerFactoryMethods
|
969
|
+
(DeserializationConfig config, BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker,
|
970
|
+
AnnotationIntrospector intr, CreatorCollector creators)
|
971
|
+
throws JsonMappingException
|
972
|
+
{
|
973
|
+
|
974
|
+
for (AnnotatedMethod factory : beanDesc.getFactoryMethods()) {
|
975
|
+
int argCount = factory.getParameterCount();
|
976
|
+
if (argCount < 1) {
|
977
|
+
continue;
|
978
|
+
}
|
979
|
+
boolean isCreator = intr.hasCreatorAnnotation(factory);
|
980
|
+
// some single-arg factory methods (String, number) are auto-detected
|
981
|
+
if (argCount == 1) {
|
982
|
+
AnnotatedParameter param = factory.getParameter(0);
|
983
|
+
String name = intr.findPropertyNameForParam(param);
|
984
|
+
Object injectId = intr.findInjectableValueId(param);
|
985
|
+
|
986
|
+
if ((injectId == null) && (name == null || name.length() == 0)) { // not property based
|
987
|
+
_handleSingleArgumentFactory(config, beanDesc, vchecker, intr, creators,
|
988
|
+
factory, isCreator);
|
989
|
+
// otherwise just ignored
|
990
|
+
continue;
|
991
|
+
}
|
992
|
+
// fall through if there's name
|
993
|
+
} else {
|
994
|
+
// more than 2 args, must be @JsonCreator
|
995
|
+
if (!intr.hasCreatorAnnotation(factory)) {
|
996
|
+
continue;
|
997
|
+
}
|
998
|
+
}
|
999
|
+
// 1 or more args; all params must have name annotations
|
1000
|
+
CreatorProperty[] properties = new CreatorProperty[argCount];
|
1001
|
+
for (int i = 0; i < argCount; ++i) {
|
1002
|
+
AnnotatedParameter param = factory.getParameter(i);
|
1003
|
+
String name = intr.findPropertyNameForParam(param);
|
1004
|
+
Object injectableId = intr.findInjectableValueId(param);
|
1005
|
+
// At this point, name annotation is NOT optional
|
1006
|
+
if ((name == null || name.length() == 0) && (injectableId == null)) {
|
1007
|
+
throw new IllegalArgumentException("Argument #"+i+" of factory method "+factory+" has no property name annotation; must have when multiple-paramater static method annotated as Creator");
|
1008
|
+
}
|
1009
|
+
properties[i] = constructCreatorProperty(config, beanDesc, name, i, param, injectableId);
|
1010
|
+
}
|
1011
|
+
creators.addPropertyCreator(factory, properties);
|
1012
|
+
}
|
1013
|
+
}
|
1014
|
+
|
1015
|
+
protected boolean _handleSingleArgumentFactory(DeserializationConfig config,
|
1016
|
+
BasicBeanDescription beanDesc, VisibilityChecker<?> vchecker,
|
1017
|
+
AnnotationIntrospector intr, CreatorCollector creators,
|
1018
|
+
AnnotatedMethod factory, boolean isCreator)
|
1019
|
+
throws JsonMappingException
|
1020
|
+
{
|
1021
|
+
Class<?> type = factory.getParameterClass(0);
|
1022
|
+
|
1023
|
+
if (type == String.class) {
|
1024
|
+
if (isCreator || vchecker.isCreatorVisible(factory)) {
|
1025
|
+
creators.addStringCreator(factory);
|
1026
|
+
}
|
1027
|
+
return true;
|
1028
|
+
}
|
1029
|
+
if (type == int.class || type == Integer.class) {
|
1030
|
+
if (isCreator || vchecker.isCreatorVisible(factory)) {
|
1031
|
+
creators.addIntCreator(factory);
|
1032
|
+
}
|
1033
|
+
return true;
|
1034
|
+
}
|
1035
|
+
if (type == long.class || type == Long.class) {
|
1036
|
+
if (isCreator || vchecker.isCreatorVisible(factory)) {
|
1037
|
+
creators.addLongCreator(factory);
|
1038
|
+
}
|
1039
|
+
return true;
|
1040
|
+
}
|
1041
|
+
if (type == double.class || type == Double.class) {
|
1042
|
+
if (isCreator || vchecker.isCreatorVisible(factory)) {
|
1043
|
+
creators.addDoubleCreator(factory);
|
1044
|
+
}
|
1045
|
+
return true;
|
1046
|
+
}
|
1047
|
+
if (type == boolean.class || type == Boolean.class) {
|
1048
|
+
if (isCreator || vchecker.isCreatorVisible(factory)) {
|
1049
|
+
creators.addBooleanCreator(factory);
|
1050
|
+
}
|
1051
|
+
return true;
|
1052
|
+
}
|
1053
|
+
if (intr.hasCreatorAnnotation(factory)) {
|
1054
|
+
creators.addDelegatingCreator(factory);
|
1055
|
+
return true;
|
1056
|
+
}
|
1057
|
+
return false;
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
/**
|
1061
|
+
* Method that will construct a property object that represents
|
1062
|
+
* a logical property passed via Creator (constructor or static
|
1063
|
+
* factory method)
|
1064
|
+
*/
|
1065
|
+
protected CreatorProperty constructCreatorProperty(DeserializationConfig config,
|
1066
|
+
BasicBeanDescription beanDesc, String name, int index,
|
1067
|
+
AnnotatedParameter param,
|
1068
|
+
Object injectableValueId)
|
1069
|
+
throws JsonMappingException
|
1070
|
+
{
|
1071
|
+
JavaType t0 = config.getTypeFactory().constructType(param.getParameterType(), beanDesc.bindingsForBeanType());
|
1072
|
+
BeanProperty.Std property = new BeanProperty.Std(name, t0, beanDesc.getClassAnnotations(), param);
|
1073
|
+
JavaType type = resolveType(config, beanDesc, t0, param, property);
|
1074
|
+
if (type != t0) {
|
1075
|
+
property = property.withType(type);
|
1076
|
+
}
|
1077
|
+
// Is there an annotation that specifies exact deserializer?
|
1078
|
+
JsonDeserializer<Object> deser = findDeserializerFromAnnotation(config, param, property);
|
1079
|
+
// If yes, we are mostly done:
|
1080
|
+
type = modifyTypeByAnnotation(config, param, type, name);
|
1081
|
+
|
1082
|
+
// Type deserializer: either comes from property (and already resolved)
|
1083
|
+
TypeDeserializer typeDeser = (TypeDeserializer) type.getTypeHandler();
|
1084
|
+
// or if not, based on type being referenced:
|
1085
|
+
if (typeDeser == null) {
|
1086
|
+
typeDeser = findTypeDeserializer(config, type, property);
|
1087
|
+
}
|
1088
|
+
CreatorProperty prop = new CreatorProperty(name, type, typeDeser,
|
1089
|
+
beanDesc.getClassAnnotations(), param, index, injectableValueId);
|
1090
|
+
if (deser != null) {
|
1091
|
+
prop = prop.withValueDeserializer(deser);
|
1092
|
+
}
|
1093
|
+
return prop;
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
/**
|
1097
|
+
* Method called to figure out settable properties for the
|
1098
|
+
* bean deserializer to use.
|
1099
|
+
*<p>
|
1100
|
+
* Note: designed to be overridable, and effort is made to keep interface
|
1101
|
+
* similar between versions.
|
1102
|
+
*/
|
1103
|
+
protected void addBeanProps(DeserializationConfig config,
|
1104
|
+
BasicBeanDescription beanDesc, BeanDeserializerBuilder builder)
|
1105
|
+
throws JsonMappingException
|
1106
|
+
{
|
1107
|
+
List<BeanPropertyDefinition> props = beanDesc.findProperties();
|
1108
|
+
// Things specified as "ok to ignore"? [JACKSON-77]
|
1109
|
+
AnnotationIntrospector intr = config.getAnnotationIntrospector();
|
1110
|
+
boolean ignoreAny = false;
|
1111
|
+
{
|
1112
|
+
Boolean B = intr.findIgnoreUnknownProperties(beanDesc.getClassInfo());
|
1113
|
+
if (B != null) {
|
1114
|
+
ignoreAny = B.booleanValue();
|
1115
|
+
builder.setIgnoreUnknownProperties(ignoreAny);
|
1116
|
+
}
|
1117
|
+
}
|
1118
|
+
// Or explicit/implicit definitions?
|
1119
|
+
Set<String> ignored = ArrayBuilders.arrayToSet(intr.findPropertiesToIgnore(beanDesc.getClassInfo()));
|
1120
|
+
for (String propName : ignored) {
|
1121
|
+
builder.addIgnorable(propName);
|
1122
|
+
}
|
1123
|
+
AnnotatedMethod anySetter = beanDesc.findAnySetter();
|
1124
|
+
// Implicit ones via @JsonIgnore and equivalent?
|
1125
|
+
/* 26-Dec-2011, tatu: As per [JACKSON-744], it probably does NOT make
|
1126
|
+
* sense to consider ignorable, esp. now that both getters and setters
|
1127
|
+
* can induce ignoral.
|
1128
|
+
*/
|
1129
|
+
{
|
1130
|
+
Collection<String> ignored2 = (anySetter == null) ?
|
1131
|
+
beanDesc.getIgnoredPropertyNames() : beanDesc.getIgnoredPropertyNamesForDeser();
|
1132
|
+
if (ignored2 != null) {
|
1133
|
+
for (String propName : ignored2) {
|
1134
|
+
// allow ignoral of similarly named JSON property, but do not force;
|
1135
|
+
// latter means NOT adding this to 'ignored':
|
1136
|
+
builder.addIgnorable(propName);
|
1137
|
+
}
|
1138
|
+
}
|
1139
|
+
}
|
1140
|
+
HashMap<Class<?>,Boolean> ignoredTypes = new HashMap<Class<?>,Boolean>();
|
1141
|
+
|
1142
|
+
// These are all valid setters, but we do need to introspect bit more
|
1143
|
+
for (BeanPropertyDefinition property : props) {
|
1144
|
+
String name = property.getName();
|
1145
|
+
if (ignored.contains(name)) { // explicit ignoral using @JsonIgnoreProperties needs to block entries
|
1146
|
+
continue;
|
1147
|
+
}
|
1148
|
+
/* [JACKSON-700] If property as passed via constructor parameter, we must
|
1149
|
+
* handle things in special way. Not sure what is the most optimal way...
|
1150
|
+
* for now, let's just call a (new) method in builder, which does nothing.
|
1151
|
+
*/
|
1152
|
+
if (property.hasConstructorParameter()) {
|
1153
|
+
// but let's call a method just to allow custom builders to be aware...
|
1154
|
+
builder.addCreatorProperty(property);
|
1155
|
+
continue;
|
1156
|
+
}
|
1157
|
+
// primary: have a setter?
|
1158
|
+
if (property.hasSetter()) {
|
1159
|
+
AnnotatedMethod setter = property.getSetter();
|
1160
|
+
// [JACKSON-429] Some types are declared as ignorable as well
|
1161
|
+
Class<?> type = setter.getParameterClass(0);
|
1162
|
+
if (isIgnorableType(config, beanDesc, type, ignoredTypes)) {
|
1163
|
+
// important: make ignorable, to avoid errors if value is actually seen
|
1164
|
+
builder.addIgnorable(name);
|
1165
|
+
continue;
|
1166
|
+
}
|
1167
|
+
SettableBeanProperty prop = constructSettableProperty(config, beanDesc, name, setter);
|
1168
|
+
if (prop != null) {
|
1169
|
+
builder.addProperty(prop);
|
1170
|
+
}
|
1171
|
+
continue;
|
1172
|
+
}
|
1173
|
+
if (property.hasField()) {
|
1174
|
+
AnnotatedField field = property.getField();
|
1175
|
+
// [JACKSON-429] Some types are declared as ignorable as well
|
1176
|
+
Class<?> type = field.getRawType();
|
1177
|
+
if (isIgnorableType(config, beanDesc, type, ignoredTypes)) {
|
1178
|
+
// important: make ignorable, to avoid errors if value is actually seen
|
1179
|
+
builder.addIgnorable(name);
|
1180
|
+
continue;
|
1181
|
+
}
|
1182
|
+
SettableBeanProperty prop = constructSettableProperty(config, beanDesc, name, field);
|
1183
|
+
if (prop != null) {
|
1184
|
+
builder.addProperty(prop);
|
1185
|
+
}
|
1186
|
+
}
|
1187
|
+
}
|
1188
|
+
// Also, do we have a fallback "any" setter?
|
1189
|
+
if (anySetter != null) {
|
1190
|
+
builder.setAnySetter(constructAnySetter(config, beanDesc, anySetter));
|
1191
|
+
}
|
1192
|
+
|
1193
|
+
/* As per [JACKSON-88], may also need to consider getters
|
1194
|
+
* for Map/Collection properties
|
1195
|
+
*/
|
1196
|
+
/* also, as per [JACKSON-328], should not override fields (or actual setters),
|
1197
|
+
* thus these are added AFTER adding fields
|
1198
|
+
*/
|
1199
|
+
if (config.isEnabled(DeserializationConfig.Feature.USE_GETTERS_AS_SETTERS)) {
|
1200
|
+
/* Hmmh. We have to assume that 'use getters as setters' also
|
1201
|
+
* implies 'yes, do auto-detect these getters'? (if not, we'd
|
1202
|
+
* need to add AUTO_DETECT_GETTERS to deser config too, not
|
1203
|
+
* just ser config)
|
1204
|
+
*/
|
1205
|
+
for (BeanPropertyDefinition property : props) {
|
1206
|
+
if (property.hasGetter()) {
|
1207
|
+
String name = property.getName();
|
1208
|
+
if (builder.hasProperty(name) || ignored.contains(name)) {
|
1209
|
+
continue;
|
1210
|
+
}
|
1211
|
+
AnnotatedMethod getter = property.getGetter();
|
1212
|
+
// should only consider Collections and Maps, for now?
|
1213
|
+
Class<?> rt = getter.getRawType();
|
1214
|
+
if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) {
|
1215
|
+
if (!ignored.contains(name) && !builder.hasProperty(name)) {
|
1216
|
+
builder.addProperty(constructSetterlessProperty(config, beanDesc, name, getter));
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
}
|
1220
|
+
}
|
1221
|
+
}
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
/**
|
1225
|
+
* Method that will find if bean has any managed- or back-reference properties,
|
1226
|
+
* and if so add them to bean, to be linked during resolution phase.
|
1227
|
+
*
|
1228
|
+
* @since 1.6
|
1229
|
+
*/
|
1230
|
+
protected void addReferenceProperties(DeserializationConfig config,
|
1231
|
+
BasicBeanDescription beanDesc, BeanDeserializerBuilder builder)
|
1232
|
+
throws JsonMappingException
|
1233
|
+
{
|
1234
|
+
// and then back references, not necessarily found as regular properties
|
1235
|
+
Map<String,AnnotatedMember> refs = beanDesc.findBackReferenceProperties();
|
1236
|
+
if (refs != null) {
|
1237
|
+
for (Map.Entry<String, AnnotatedMember> en : refs.entrySet()) {
|
1238
|
+
String name = en.getKey();
|
1239
|
+
AnnotatedMember m = en.getValue();
|
1240
|
+
if (m instanceof AnnotatedMethod) {
|
1241
|
+
builder.addBackReferenceProperty(name, constructSettableProperty(
|
1242
|
+
config, beanDesc, m.getName(), (AnnotatedMethod) m));
|
1243
|
+
} else {
|
1244
|
+
builder.addBackReferenceProperty(name, constructSettableProperty(
|
1245
|
+
config, beanDesc, m.getName(), (AnnotatedField) m));
|
1246
|
+
}
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
}
|
1250
|
+
|
1251
|
+
/**
|
1252
|
+
* Method called locate all members used for value injection (if any),
|
1253
|
+
* constructor {@link sh.calaba.org.codehaus.jackson.map.deser.impl.ValueInjector} instances, and add them to builder.
|
1254
|
+
*
|
1255
|
+
* @since 1.9
|
1256
|
+
*/
|
1257
|
+
protected void addInjectables(DeserializationConfig config,
|
1258
|
+
BasicBeanDescription beanDesc, BeanDeserializerBuilder builder)
|
1259
|
+
throws JsonMappingException
|
1260
|
+
{
|
1261
|
+
Map<Object, AnnotatedMember> raw = beanDesc.findInjectables();
|
1262
|
+
if (raw != null) {
|
1263
|
+
boolean fixAccess = config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS);
|
1264
|
+
for (Map.Entry<Object, AnnotatedMember> entry : raw.entrySet()) {
|
1265
|
+
AnnotatedMember m = entry.getValue();
|
1266
|
+
if (fixAccess) {
|
1267
|
+
m.fixAccess(); // to ensure we can call it
|
1268
|
+
}
|
1269
|
+
builder.addInjectable(m.getName(), beanDesc.resolveType(m.getGenericType()),
|
1270
|
+
beanDesc.getClassAnnotations(), m, entry.getKey());
|
1271
|
+
}
|
1272
|
+
}
|
1273
|
+
}
|
1274
|
+
|
1275
|
+
/**
|
1276
|
+
* Method called to construct fallback {@link SettableAnyProperty}
|
1277
|
+
* for handling unknown bean properties, given a method that
|
1278
|
+
* has been designated as such setter.
|
1279
|
+
*/
|
1280
|
+
protected SettableAnyProperty constructAnySetter(DeserializationConfig config,
|
1281
|
+
BasicBeanDescription beanDesc, AnnotatedMethod setter)
|
1282
|
+
throws JsonMappingException
|
1283
|
+
{
|
1284
|
+
if (config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) {
|
1285
|
+
setter.fixAccess(); // to ensure we can call it
|
1286
|
+
}
|
1287
|
+
// we know it's a 2-arg method, second arg is the value
|
1288
|
+
JavaType type = beanDesc.bindingsForBeanType().resolveType(setter.getParameterType(1));
|
1289
|
+
BeanProperty.Std property = new BeanProperty.Std(setter.getName(), type, beanDesc.getClassAnnotations(), setter);
|
1290
|
+
type = resolveType(config, beanDesc, type, setter, property);
|
1291
|
+
|
1292
|
+
/* AnySetter can be annotated with @JsonClass (etc) just like a
|
1293
|
+
* regular setter... so let's see if those are used.
|
1294
|
+
* Returns null if no annotations, in which case binding will
|
1295
|
+
* be done at a later point.
|
1296
|
+
*/
|
1297
|
+
JsonDeserializer<Object> deser = findDeserializerFromAnnotation(config, setter, property);
|
1298
|
+
if (deser != null) {
|
1299
|
+
return new SettableAnyProperty(property, setter, type, deser);
|
1300
|
+
}
|
1301
|
+
/* Otherwise, method may specify more specific (sub-)class for
|
1302
|
+
* value (no need to check if explicit deser was specified):
|
1303
|
+
*/
|
1304
|
+
type = modifyTypeByAnnotation(config, setter, type, property.getName());
|
1305
|
+
return new SettableAnyProperty(property, setter, type, null);
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
/**
|
1309
|
+
* Method that will construct a regular bean property setter using
|
1310
|
+
* the given setter method.
|
1311
|
+
*
|
1312
|
+
* @param setter Method to use to set property value; or null if none.
|
1313
|
+
* Null only for "setterless" properties
|
1314
|
+
*
|
1315
|
+
* @return Property constructed, if any; or null to indicate that
|
1316
|
+
* there should be no property based on given definitions.
|
1317
|
+
*/
|
1318
|
+
protected SettableBeanProperty constructSettableProperty(DeserializationConfig config,
|
1319
|
+
BasicBeanDescription beanDesc, String name,
|
1320
|
+
AnnotatedMethod setter)
|
1321
|
+
throws JsonMappingException
|
1322
|
+
{
|
1323
|
+
// need to ensure method is callable (for non-public)
|
1324
|
+
if (config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) {
|
1325
|
+
setter.fixAccess();
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
// note: this works since we know there's exactly one argument for methods
|
1329
|
+
JavaType t0 = beanDesc.bindingsForBeanType().resolveType(setter.getParameterType(0));
|
1330
|
+
BeanProperty.Std property = new BeanProperty.Std(name, t0, beanDesc.getClassAnnotations(), setter);
|
1331
|
+
JavaType type = resolveType(config, beanDesc, t0, setter, property);
|
1332
|
+
// did type change?
|
1333
|
+
if (type != t0) {
|
1334
|
+
property = property.withType(type);
|
1335
|
+
}
|
1336
|
+
|
1337
|
+
/* First: does the Method specify the deserializer to use?
|
1338
|
+
* If so, let's use it.
|
1339
|
+
*/
|
1340
|
+
JsonDeserializer<Object> propDeser = findDeserializerFromAnnotation(config, setter, property);
|
1341
|
+
type = modifyTypeByAnnotation(config, setter, type, name);
|
1342
|
+
TypeDeserializer typeDeser = type.getTypeHandler();
|
1343
|
+
SettableBeanProperty prop = new SettableBeanProperty.MethodProperty(name, type, typeDeser,
|
1344
|
+
beanDesc.getClassAnnotations(), setter);
|
1345
|
+
if (propDeser != null) {
|
1346
|
+
prop = prop.withValueDeserializer(propDeser);
|
1347
|
+
}
|
1348
|
+
// [JACKSON-235]: need to retain name of managed forward references:
|
1349
|
+
AnnotationIntrospector.ReferenceProperty ref = config.getAnnotationIntrospector().findReferenceType(setter);
|
1350
|
+
if (ref != null && ref.isManagedReference()) {
|
1351
|
+
prop.setManagedReferenceName(ref.getName());
|
1352
|
+
}
|
1353
|
+
return prop;
|
1354
|
+
}
|
1355
|
+
|
1356
|
+
protected SettableBeanProperty constructSettableProperty(DeserializationConfig config,
|
1357
|
+
BasicBeanDescription beanDesc, String name, AnnotatedField field)
|
1358
|
+
throws JsonMappingException
|
1359
|
+
{
|
1360
|
+
// need to ensure method is callable (for non-public)
|
1361
|
+
if (config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) {
|
1362
|
+
field.fixAccess();
|
1363
|
+
}
|
1364
|
+
JavaType t0 = beanDesc.bindingsForBeanType().resolveType(field.getGenericType());
|
1365
|
+
BeanProperty.Std property = new BeanProperty.Std(name, t0, beanDesc.getClassAnnotations(), field);
|
1366
|
+
JavaType type = resolveType(config, beanDesc, t0, field, property);
|
1367
|
+
// did type change?
|
1368
|
+
if (type != t0) {
|
1369
|
+
property = property.withType(type);
|
1370
|
+
}
|
1371
|
+
/* First: does the Method specify the deserializer to use?
|
1372
|
+
* If so, let's use it.
|
1373
|
+
*/
|
1374
|
+
JsonDeserializer<Object> propDeser = findDeserializerFromAnnotation(config, field, property);
|
1375
|
+
type = modifyTypeByAnnotation(config, field, type, name);
|
1376
|
+
TypeDeserializer typeDeser = type.getTypeHandler();
|
1377
|
+
SettableBeanProperty prop = new SettableBeanProperty.FieldProperty(name, type, typeDeser,
|
1378
|
+
beanDesc.getClassAnnotations(), field);
|
1379
|
+
if (propDeser != null) {
|
1380
|
+
prop = prop.withValueDeserializer(propDeser);
|
1381
|
+
}
|
1382
|
+
// [JACKSON-235]: need to retain name of managed forward references:
|
1383
|
+
AnnotationIntrospector.ReferenceProperty ref = config.getAnnotationIntrospector().findReferenceType(field);
|
1384
|
+
if (ref != null && ref.isManagedReference()) {
|
1385
|
+
prop.setManagedReferenceName(ref.getName());
|
1386
|
+
}
|
1387
|
+
return prop;
|
1388
|
+
}
|
1389
|
+
|
1390
|
+
/**
|
1391
|
+
* Method that will construct a regular bean property setter using
|
1392
|
+
* the given setter method.
|
1393
|
+
*
|
1394
|
+
* @param getter Method to use to get property value to modify, null if
|
1395
|
+
* none. Non-null for "setterless" properties.
|
1396
|
+
*/
|
1397
|
+
protected SettableBeanProperty constructSetterlessProperty(DeserializationConfig config,
|
1398
|
+
BasicBeanDescription beanDesc, String name, AnnotatedMethod getter)
|
1399
|
+
throws JsonMappingException
|
1400
|
+
{
|
1401
|
+
// need to ensure it is callable now:
|
1402
|
+
if (config.isEnabled(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) {
|
1403
|
+
getter.fixAccess();
|
1404
|
+
}
|
1405
|
+
|
1406
|
+
JavaType type = getter.getType(beanDesc.bindingsForBeanType());
|
1407
|
+
/* First: does the Method specify the deserializer to use?
|
1408
|
+
* If so, let's use it.
|
1409
|
+
*/
|
1410
|
+
BeanProperty.Std property = new BeanProperty.Std(name, type, beanDesc.getClassAnnotations(), getter);
|
1411
|
+
// @TODO: create BeanProperty to pass?
|
1412
|
+
JsonDeserializer<Object> propDeser = findDeserializerFromAnnotation(config, getter, property);
|
1413
|
+
type = modifyTypeByAnnotation(config, getter, type, name);
|
1414
|
+
TypeDeserializer typeDeser = type.getTypeHandler();
|
1415
|
+
SettableBeanProperty prop = new SettableBeanProperty.SetterlessProperty(name, type, typeDeser,
|
1416
|
+
beanDesc.getClassAnnotations(), getter);
|
1417
|
+
if (propDeser != null) {
|
1418
|
+
prop = prop.withValueDeserializer(propDeser);
|
1419
|
+
}
|
1420
|
+
return prop;
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
/*
|
1424
|
+
/**********************************************************
|
1425
|
+
/* Helper methods for Bean deserializer, other
|
1426
|
+
/**********************************************************
|
1427
|
+
*/
|
1428
|
+
|
1429
|
+
/**
|
1430
|
+
* Helper method used to skip processing for types that we know
|
1431
|
+
* can not be (i.e. are never consider to be) beans:
|
1432
|
+
* things like primitives, Arrays, Enums, and proxy types.
|
1433
|
+
*<p>
|
1434
|
+
* Note that usually we shouldn't really be getting these sort of
|
1435
|
+
* types anyway; but better safe than sorry.
|
1436
|
+
*/
|
1437
|
+
protected boolean isPotentialBeanType(Class<?> type)
|
1438
|
+
{
|
1439
|
+
String typeStr = ClassUtil.canBeABeanType(type);
|
1440
|
+
if (typeStr != null) {
|
1441
|
+
throw new IllegalArgumentException("Can not deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
|
1442
|
+
}
|
1443
|
+
if (ClassUtil.isProxyType(type)) {
|
1444
|
+
throw new IllegalArgumentException("Can not deserialize Proxy class "+type.getName()+" as a Bean");
|
1445
|
+
}
|
1446
|
+
/* also: can't deserialize some local classes: static are ok; in-method not;
|
1447
|
+
* and with [JACKSON-594], other non-static inner classes are ok
|
1448
|
+
*/
|
1449
|
+
typeStr = ClassUtil.isLocalType(type, true);
|
1450
|
+
if (typeStr != null) {
|
1451
|
+
throw new IllegalArgumentException("Can not deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
|
1452
|
+
}
|
1453
|
+
return true;
|
1454
|
+
}
|
1455
|
+
|
1456
|
+
/**
|
1457
|
+
* Helper method that will check whether given raw type is marked as always ignorable
|
1458
|
+
* (for purpose of ignoring properties with type)
|
1459
|
+
*/
|
1460
|
+
protected boolean isIgnorableType(DeserializationConfig config, BasicBeanDescription beanDesc,
|
1461
|
+
Class<?> type, Map<Class<?>,Boolean> ignoredTypes)
|
1462
|
+
{
|
1463
|
+
Boolean status = ignoredTypes.get(type);
|
1464
|
+
if (status == null) {
|
1465
|
+
BasicBeanDescription desc = config.introspectClassAnnotations(type);
|
1466
|
+
status = config.getAnnotationIntrospector().isIgnorableType(desc.getClassInfo());
|
1467
|
+
// We default to 'false', ie. not ignorable
|
1468
|
+
if (status == null) {
|
1469
|
+
status = Boolean.FALSE;
|
1470
|
+
}
|
1471
|
+
}
|
1472
|
+
return status;
|
1473
|
+
}
|
1474
|
+
}
|