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.
Files changed (423) hide show
  1. checksums.yaml +4 -4
  2. data/lib/calabash-android/helpers.rb +7 -15
  3. data/lib/calabash-android/lib/TestServer.apk +0 -0
  4. data/lib/calabash-android/version.rb +1 -1
  5. data/test-server/build.xml +2 -2
  6. data/test-server/instrumentation-backend/.classpath +0 -3
  7. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/HttpServer.java +1 -2
  8. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForProgress.java +1 -1
  9. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/QueryHelper.java +1 -2
  10. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/json/JSONUtils.java +1 -1
  11. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/QueryResult.java +1 -1
  12. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryUtils.java +203 -222
  13. data/test-server/instrumentation-backend/src/sh/calaba/org/apache/http/entity/mime/version.properties +22 -0
  14. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Base64Variant.java +413 -0
  15. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Base64Variants.java +90 -0
  16. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/FormatSchema.java +29 -0
  17. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonEncoding.java +47 -0
  18. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonFactory.java +937 -0
  19. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonGenerationException.java +28 -0
  20. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonGenerator.java +1197 -0
  21. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonLocation.java +141 -0
  22. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonNode.java +879 -0
  23. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonParseException.java +23 -0
  24. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonParser.java +1434 -0
  25. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java +80 -0
  26. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonStreamContext.java +122 -0
  27. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonToken.java +161 -0
  28. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/ObjectCodec.java +157 -0
  29. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/PrettyPrinter.java +166 -0
  30. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/SerializableString.java +54 -0
  31. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Version.java +90 -0
  32. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/Versioned.java +20 -0
  33. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JacksonAnnotation.java +20 -0
  34. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonAnyGetter.java +25 -0
  35. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonAnySetter.java +24 -0
  36. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonAutoDetect.java +148 -0
  37. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonBackReference.java +41 -0
  38. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonCreator.java +19 -0
  39. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonGetter.java +35 -0
  40. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonIgnore.java +57 -0
  41. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonIgnoreProperties.java +48 -0
  42. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonIgnoreType.java +33 -0
  43. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonManagedReference.java +41 -0
  44. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonMethod.java +90 -0
  45. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonProperty.java +38 -0
  46. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonPropertyOrder.java +46 -0
  47. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonRawValue.java +33 -0
  48. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonSetter.java +33 -0
  49. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonSubTypes.java +44 -0
  50. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonTypeInfo.java +236 -0
  51. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonTypeName.java +28 -0
  52. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonUnwrapped.java +76 -0
  53. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonValue.java +46 -0
  54. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/JsonWriteNullProperties.java +34 -0
  55. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/annotate/package-info.java +16 -0
  56. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/DataFormatDetector.java +176 -0
  57. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/DataFormatMatcher.java +117 -0
  58. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/InputAccessor.java +130 -0
  59. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/MatchStrength.java +64 -0
  60. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/format/package-info.java +8 -0
  61. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/ByteSourceBootstrapper.java +518 -0
  62. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/DefaultPrettyPrinter.java +13 -0
  63. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/Indenter.java +23 -0
  64. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonGeneratorBase.java +570 -0
  65. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonNumericParserBase.java +20 -0
  66. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonParserBase.java +1067 -0
  67. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonParserMinimalBase.java +539 -0
  68. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonReadContext.java +188 -0
  69. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/JsonWriteContext.java +178 -0
  70. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/ReaderBasedParser.java +1815 -0
  71. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/ReaderBasedParserBase.java +228 -0
  72. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/StreamBasedParserBase.java +197 -0
  73. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/Utf8Generator.java +1757 -0
  74. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/Utf8StreamParser.java +2966 -0
  75. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/WriterBasedGenerator.java +1815 -0
  76. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/impl/package-info.java +6 -0
  77. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/BaseReader.java +117 -0
  78. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/CharacterEscapes.java +73 -0
  79. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/IOContext.java +239 -0
  80. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/InputDecorator.java +67 -0
  81. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/JsonStringEncoder.java +408 -0
  82. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/MergedStream.java +145 -0
  83. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/NumberInput.java +303 -0
  84. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/NumberOutput.java +398 -0
  85. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/OutputDecorator.java +40 -0
  86. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/SegmentedStringWriter.java +104 -0
  87. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/SerializedString.java +114 -0
  88. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/UTF32Reader.java +214 -0
  89. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/UTF8Writer.java +387 -0
  90. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/io/package.html +4 -0
  91. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/AbstractTypeResolver.java +63 -0
  92. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/AnnotationIntrospector.java +1485 -0
  93. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/BeanDescription.java +171 -0
  94. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/BeanProperty.java +123 -0
  95. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/BeanPropertyDefinition.java +66 -0
  96. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ClassIntrospector.java +117 -0
  97. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ContextualDeserializer.java +38 -0
  98. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ContextualKeyDeserializer.java +33 -0
  99. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ContextualSerializer.java +38 -0
  100. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializationConfig.java +926 -0
  101. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializationContext.java +262 -0
  102. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializationProblemHandler.java +56 -0
  103. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializerFactory.java +356 -0
  104. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/DeserializerProvider.java +185 -0
  105. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/Deserializers.java +339 -0
  106. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/HandlerInstantiator.java +115 -0
  107. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/InjectableValues.java +85 -0
  108. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonDeserializer.java +166 -0
  109. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonMappingException.java +335 -0
  110. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonSerializable.java +34 -0
  111. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonSerializableWithType.java +22 -0
  112. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/JsonSerializer.java +138 -0
  113. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/KeyDeserializer.java +31 -0
  114. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/KeyDeserializers.java +21 -0
  115. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/MapperConfig.java +1154 -0
  116. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/MappingIterator.java +190 -0
  117. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/MappingJsonFactory.java +81 -0
  118. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/Module.java +255 -0
  119. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ObjectMapper.java +2885 -0
  120. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ObjectReader.java +958 -0
  121. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ObjectWriter.java +554 -0
  122. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/PropertyNamingStrategy.java +258 -0
  123. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ResolvableDeserializer.java +23 -0
  124. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ResolvableSerializer.java +23 -0
  125. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/RuntimeJsonMappingException.java +21 -0
  126. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/SerializationConfig.java +1041 -0
  127. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/SerializerFactory.java +198 -0
  128. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/SerializerProvider.java +552 -0
  129. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/Serializers.java +137 -0
  130. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/TypeDeserializer.java +118 -0
  131. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/TypeSerializer.java +164 -0
  132. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JacksonInject.java +30 -0
  133. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JacksonStdImpl.java +25 -0
  134. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonCachable.java +32 -0
  135. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonDeserialize.java +109 -0
  136. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonFilter.java +31 -0
  137. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonRootName.java +29 -0
  138. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonSerialize.java +216 -0
  139. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonTypeIdResolver.java +35 -0
  140. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonTypeResolver.java +28 -0
  141. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonValueInstantiator.java +26 -0
  142. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/JsonView.java +37 -0
  143. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/NoClass.java +19 -0
  144. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/annotate/package-info.java +5 -0
  145. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/AbstractDeserializer.java +102 -0
  146. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ArrayDeserializer.java +28 -0
  147. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ArrayDeserializers.java +11 -0
  148. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BasicDeserializerFactory.java +894 -0
  149. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializer.java +1537 -0
  150. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializerBuilder.java +277 -0
  151. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializerFactory.java +1474 -0
  152. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/BeanDeserializerModifier.java +58 -0
  153. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/CollectionDeserializer.java +47 -0
  154. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ContainerDeserializer.java +14 -0
  155. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/CustomDeserializerFactory.java +227 -0
  156. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/DateDeserializer.java +9 -0
  157. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/EnumDeserializer.java +15 -0
  158. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/EnumResolver.java +17 -0
  159. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/FromStringDeserializer.java +13 -0
  160. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/JsonNodeDeserializer.java +54 -0
  161. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/MapDeserializer.java +44 -0
  162. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/SettableAnyProperty.java +177 -0
  163. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/SettableBeanProperty.java +827 -0
  164. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializationContext.java +326 -0
  165. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializer.java +94 -0
  166. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializerProvider.java +494 -0
  167. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdDeserializers.java +119 -0
  168. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdKeyDeserializer.java +12 -0
  169. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdKeyDeserializers.java +11 -0
  170. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/StdScalarDeserializer.java +13 -0
  171. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ThrowableDeserializer.java +13 -0
  172. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/UntypedObjectDeserializer.java +9 -0
  173. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ValueInstantiator.java +280 -0
  174. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/ValueInstantiators.java +52 -0
  175. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/BeanPropertyMap.java +257 -0
  176. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/CreatorCollector.java +141 -0
  177. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/CreatorProperty.java +152 -0
  178. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/ExternalTypeHandler.java +173 -0
  179. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/PropertyBasedCreator.java +117 -0
  180. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/PropertyValue.java +117 -0
  181. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/PropertyValueBuffer.java +102 -0
  182. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/UnwrappedPropertyHandler.java +41 -0
  183. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/ValueInjector.java +45 -0
  184. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/impl/package-info.java +9 -0
  185. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/package-info.java +5 -0
  186. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/AtomicBooleanDeserializer.java +22 -0
  187. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/AtomicReferenceDeserializer.java +47 -0
  188. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/CalendarDeserializer.java +47 -0
  189. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ClassDeserializer.java +49 -0
  190. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/CollectionDeserializer.java +265 -0
  191. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ContainerDeserializerBase.java +37 -0
  192. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/DateDeserializer.java +30 -0
  193. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/EnumDeserializer.java +139 -0
  194. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/EnumMapDeserializer.java +90 -0
  195. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/EnumSetDeserializer.java +89 -0
  196. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/FromStringDeserializer.java +265 -0
  197. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/JavaTypeDeserializer.java +38 -0
  198. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/JsonNodeDeserializer.java +314 -0
  199. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/MapDeserializer.java +412 -0
  200. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ObjectArrayDeserializer.java +201 -0
  201. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/PrimitiveArrayDeserializers.java +583 -0
  202. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdDeserializer.java +1136 -0
  203. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdKeyDeserializer.java +340 -0
  204. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdKeyDeserializers.java +108 -0
  205. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdScalarDeserializer.java +34 -0
  206. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StdValueInstantiator.java +392 -0
  207. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StringCollectionDeserializer.java +227 -0
  208. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/StringDeserializer.java +55 -0
  209. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/ThrowableDeserializer.java +164 -0
  210. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/TimestampDeserializer.java +30 -0
  211. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/TokenBufferDeserializer.java +36 -0
  212. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/UntypedObjectDeserializer.java +248 -0
  213. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/package-info.java +15 -0
  214. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/exc/UnrecognizedPropertyException.java +75 -0
  215. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/DOMDeserializer.java +65 -0
  216. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/OptionalHandlerFactory.java +217 -0
  217. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/package-info.java +23 -0
  218. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/Annotated.java +85 -0
  219. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedClass.java +980 -0
  220. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedConstructor.java +143 -0
  221. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedField.java +119 -0
  222. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedMember.java +56 -0
  223. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedMethod.java +188 -0
  224. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedMethodMap.java +85 -0
  225. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedParameter.java +191 -0
  226. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotatedWithParams.java +195 -0
  227. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/AnnotationMap.java +101 -0
  228. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/BasicBeanDescription.java +615 -0
  229. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/BasicClassIntrospector.java +364 -0
  230. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/JacksonAnnotationIntrospector.java +813 -0
  231. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/MemberKey.java +83 -0
  232. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/MethodFilter.java +12 -0
  233. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/NopAnnotationIntrospector.java +209 -0
  234. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/POJOPropertiesCollector.java +713 -0
  235. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/POJOPropertyBuilder.java +648 -0
  236. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/VisibilityChecker.java +424 -0
  237. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/introspect/package-info.java +12 -0
  238. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/NamedType.java +53 -0
  239. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/SubtypeResolver.java +39 -0
  240. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/TypeIdResolver.java +74 -0
  241. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/TypeResolverBuilder.java +151 -0
  242. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsArrayTypeDeserializer.java +126 -0
  243. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsArrayTypeSerializer.java +110 -0
  244. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsExternalTypeDeserializer.java +37 -0
  245. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsExternalTypeSerializer.java +129 -0
  246. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsPropertyTypeDeserializer.java +191 -0
  247. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsPropertyTypeSerializer.java +69 -0
  248. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsWrapperTypeDeserializer.java +103 -0
  249. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/AsWrapperTypeSerializer.java +121 -0
  250. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/ClassNameIdResolver.java +138 -0
  251. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/MinimalClassNameIdResolver.java +66 -0
  252. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/StdSubtypeResolver.java +151 -0
  253. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/StdTypeResolverBuilder.java +202 -0
  254. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeDeserializerBase.java +154 -0
  255. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeIdResolverBase.java +37 -0
  256. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeNameIdResolver.java +154 -0
  257. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/TypeSerializerBase.java +31 -0
  258. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/impl/package-info.java +9 -0
  259. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/jsontype/package-info.java +10 -0
  260. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleAbstractTypeResolver.java +86 -0
  261. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleDeserializers.java +130 -0
  262. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleKeyDeserializers.java +59 -0
  263. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleModule.java +265 -0
  264. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleSerializers.java +206 -0
  265. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java +45 -0
  266. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/package-info.java +16 -0
  267. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/package-info.java +34 -0
  268. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/AnyGetterWriter.java +48 -0
  269. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ArraySerializers.java +7 -0
  270. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BasicSerializerFactory.java +806 -0
  271. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanPropertyFilter.java +30 -0
  272. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanPropertyWriter.java +512 -0
  273. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializer.java +126 -0
  274. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializerBuilder.java +140 -0
  275. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializerFactory.java +780 -0
  276. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/BeanSerializerModifier.java +95 -0
  277. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ContainerSerializers.java +8 -0
  278. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/CustomSerializerFactory.java +293 -0
  279. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/EnumSerializer.java +17 -0
  280. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/FilterProvider.java +23 -0
  281. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/FilteredBeanPropertyWriter.java +96 -0
  282. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/JdkSerializers.java +11 -0
  283. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/MapSerializer.java +58 -0
  284. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/PropertyBuilder.java +372 -0
  285. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ScalarSerializerBase.java +18 -0
  286. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/SerializerBase.java +23 -0
  287. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/StdKeySerializer.java +10 -0
  288. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/StdSerializerProvider.java +852 -0
  289. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/StdSerializers.java +372 -0
  290. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/ToStringSerializer.java +14 -0
  291. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/FailingSerializer.java +43 -0
  292. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/JsonSerializerMap.java +93 -0
  293. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/PropertySerializerMap.java +231 -0
  294. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/ReadOnlyClassToSerializerMap.java +73 -0
  295. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/SerializerCache.java +304 -0
  296. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/SimpleBeanPropertyFilter.java +109 -0
  297. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/SimpleFilterProvider.java +114 -0
  298. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/UnknownSerializer.java +54 -0
  299. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/UnwrappingBeanPropertyWriter.java +99 -0
  300. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/UnwrappingBeanSerializer.java +76 -0
  301. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/impl/package-info.java +5 -0
  302. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/package-info.java +5 -0
  303. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/AsArraySerializerBase.java +185 -0
  304. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/BeanSerializerBase.java +340 -0
  305. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/CalendarSerializer.java +43 -0
  306. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/CollectionSerializer.java +113 -0
  307. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ContainerSerializerBase.java +51 -0
  308. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/DateSerializer.java +42 -0
  309. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/EnumMapSerializer.java +218 -0
  310. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/EnumSerializer.java +84 -0
  311. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/EnumSetSerializer.java +47 -0
  312. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/IndexedStringListSerializer.java +116 -0
  313. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/InetAddressSerializer.java +51 -0
  314. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/IterableSerializer.java +63 -0
  315. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/JsonValueSerializer.java +233 -0
  316. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/MapSerializer.java +422 -0
  317. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/NonTypedScalarSerializerBase.java +34 -0
  318. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/NullSerializer.java +38 -0
  319. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ObjectArraySerializer.java +281 -0
  320. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/RawSerializer.java +52 -0
  321. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ScalarSerializerBase.java +52 -0
  322. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/SerializableSerializer.java +99 -0
  323. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/SerializableWithTypeSerializer.java +90 -0
  324. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/SerializerBase.java +184 -0
  325. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StaticListSerializerBase.java +46 -0
  326. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdArraySerializers.java +476 -0
  327. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdContainerSerializers.java +249 -0
  328. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdJdkSerializers.java +195 -0
  329. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdKeySerializer.java +43 -0
  330. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StdKeySerializers.java +95 -0
  331. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StringCollectionSerializer.java +119 -0
  332. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/StringSerializer.java +36 -0
  333. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/TimeZoneSerializer.java +38 -0
  334. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/ToStringSerializer.java +73 -0
  335. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ser/std/TokenBufferSerializer.java +66 -0
  336. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/ArrayType.java +260 -0
  337. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/ClassKey.java +94 -0
  338. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/CollectionLikeType.java +204 -0
  339. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/CollectionType.java +94 -0
  340. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/HierarchicType.java +88 -0
  341. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/MapLikeType.java +265 -0
  342. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/MapType.java +146 -0
  343. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/SimpleType.java +250 -0
  344. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeBase.java +148 -0
  345. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeBindings.java +351 -0
  346. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeFactory.java +1165 -0
  347. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeModifier.java +38 -0
  348. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/TypeParser.java +134 -0
  349. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/type/package-info.java +10 -0
  350. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Annotations.java +23 -0
  351. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ArrayBuilders.java +293 -0
  352. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/BeanUtil.java +260 -0
  353. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ClassUtil.java +645 -0
  354. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Comparators.java +48 -0
  355. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/EnumResolver.java +108 -0
  356. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/EnumValues.java +82 -0
  357. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ISO8601DateFormat.java +52 -0
  358. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ISO8601Utils.java +230 -0
  359. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/JSONPObject.java +105 -0
  360. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/JSONWrappedObject.java +117 -0
  361. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/LRUMap.java +28 -0
  362. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/LinkedNode.java +45 -0
  363. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Named.java +10 -0
  364. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/ObjectBuffer.java +257 -0
  365. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/PrimitiveArrayBuilder.java +180 -0
  366. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/Provider.java +21 -0
  367. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/RootNameLookup.java +54 -0
  368. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/StdDateFormat.java +348 -0
  369. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/util/package-info.java +4 -0
  370. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ArrayNode.java +758 -0
  371. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BaseJsonNode.java +122 -0
  372. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BigIntegerNode.java +104 -0
  373. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BinaryNode.java +136 -0
  374. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/BooleanNode.java +84 -0
  375. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ContainerNode.java +185 -0
  376. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/DecimalNode.java +96 -0
  377. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/DoubleNode.java +106 -0
  378. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/IntNode.java +122 -0
  379. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/JsonNodeFactory.java +222 -0
  380. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/LongNode.java +99 -0
  381. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/MissingNode.java +97 -0
  382. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/NodeCursor.java +222 -0
  383. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/NullNode.java +58 -0
  384. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/NumericNode.java +72 -0
  385. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ObjectNode.java +696 -0
  386. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/POJONode.java +145 -0
  387. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/TextNode.java +299 -0
  388. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/TreeTraversingParser.java +383 -0
  389. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/ValueNode.java +58 -0
  390. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/node/package-info.java +8 -0
  391. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/package-info.java +30 -0
  392. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/JsonSchema.java +82 -0
  393. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/JsonSerializableSchema.java +46 -0
  394. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/SchemaAware.java +25 -0
  395. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/schema/package-info.java +5 -0
  396. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/BytesToNameCanonicalizer.java +969 -0
  397. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/CharsToNameCanonicalizer.java +578 -0
  398. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name.java +50 -0
  399. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name1.java +44 -0
  400. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name2.java +40 -0
  401. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/Name3.java +39 -0
  402. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/NameN.java +68 -0
  403. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/sym/package-info.java +5 -0
  404. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/type/JavaType.java +503 -0
  405. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/type/TypeReference.java +60 -0
  406. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/type/package-info.java +8 -0
  407. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/BufferRecycler.java +109 -0
  408. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/ByteArrayBuilder.java +294 -0
  409. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/CharTypes.java +237 -0
  410. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/DefaultPrettyPrinter.java +282 -0
  411. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/InternCache.java +49 -0
  412. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/JsonGeneratorDelegate.java +273 -0
  413. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/JsonParserDelegate.java +251 -0
  414. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/JsonParserSequence.java +150 -0
  415. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/MinimalPrettyPrinter.java +152 -0
  416. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/TextBuffer.java +707 -0
  417. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/TokenBuffer.java +1233 -0
  418. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/VersionUtil.java +79 -0
  419. data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/util/package-info.java +4 -0
  420. metadata +409 -5
  421. data/test-server/instrumentation-backend/libs/jackson-annotations-2.2.0-rc2-20130418.042013-1.jar +0 -0
  422. data/test-server/instrumentation-backend/libs/jackson-core-2.2.0-rc2-20130420.041001-2.jar +0 -0
  423. data/test-server/instrumentation-backend/libs/jackson-databind-2.2.0-rc2-20130422.041053-3.jar +0 -0
@@ -0,0 +1,1815 @@
1
+ package sh.calaba.org.codehaus.jackson.impl;
2
+
3
+ import java.io.*;
4
+ import java.math.BigDecimal;
5
+ import java.math.BigInteger;
6
+
7
+ import sh.calaba.org.codehaus.jackson.*;
8
+ import sh.calaba.org.codehaus.jackson.io.*;
9
+ import sh.calaba.org.codehaus.jackson.util.CharTypes;
10
+
11
+ /**
12
+ * {@link JsonGenerator} that outputs JSON content using a {@link java.io.Writer}
13
+ * which handles character encoding.
14
+ */
15
+ public final class WriterBasedGenerator
16
+ extends JsonGeneratorBase
17
+ {
18
+ final protected static int SHORT_WRITE = 32;
19
+
20
+ final protected static char[] HEX_CHARS = CharTypes.copyHexChars();
21
+
22
+ /**
23
+ * This is the default set of escape codes, over 7-bit ASCII range
24
+ * (first 128 character codes), used for single-byte UTF-8 characters.
25
+ */
26
+ protected final static int[] sOutputEscapes = CharTypes.get7BitOutputEscapes();
27
+
28
+ /*
29
+ /**********************************************************
30
+ /* Configuration
31
+ /**********************************************************
32
+ */
33
+
34
+ final protected IOContext _ioContext;
35
+
36
+ final protected Writer _writer;
37
+
38
+ /*
39
+ /**********************************************************
40
+ /* Configuration, output escaping
41
+ /**********************************************************
42
+ */
43
+
44
+ /**
45
+ * Currently active set of output escape code definitions (whether
46
+ * and how to escape or not) for 7-bit ASCII range (first 128
47
+ * character codes). Defined separately to make potentially
48
+ * customizable
49
+ */
50
+ protected int[] _outputEscapes = sOutputEscapes;
51
+
52
+ /**
53
+ * Value between 128 (0x80) and 65535 (0xFFFF) that indicates highest
54
+ * Unicode code point that will not need escaping; or 0 to indicate
55
+ * that all characters can be represented without escaping.
56
+ * Typically used to force escaping of some portion of character set;
57
+ * for example to always escape non-ASCII characters (if value was 127).
58
+ *<p>
59
+ * NOTE: not all sub-classes make use of this setting.
60
+ */
61
+ protected int _maximumNonEscapedChar;
62
+
63
+ /**
64
+ * Definition of custom character escapes to use for generators created
65
+ * by this factory, if any. If null, standard data format specific
66
+ * escapes are used.
67
+ *
68
+ * @since 1.8
69
+ */
70
+ protected CharacterEscapes _characterEscapes;
71
+
72
+ /**
73
+ * When custom escapes are used, this member variable can be used to
74
+ * store escape to use
75
+ *
76
+ * @since 1.8
77
+ */
78
+ protected SerializableString _currentEscape;
79
+
80
+ /*
81
+ /**********************************************************
82
+ /* Output buffering
83
+ /**********************************************************
84
+ */
85
+
86
+ /**
87
+ * Intermediate buffer in which contents are buffered before
88
+ * being written using {@link #_writer}.
89
+ */
90
+ protected char[] _outputBuffer;
91
+
92
+ /**
93
+ * Pointer to the first buffered character to output
94
+ */
95
+ protected int _outputHead = 0;
96
+
97
+ /**
98
+ * Pointer to the position right beyond the last character to output
99
+ * (end marker; may point to position right beyond the end of the buffer)
100
+ */
101
+ protected int _outputTail = 0;
102
+
103
+ /**
104
+ * End marker of the output buffer; one past the last valid position
105
+ * within the buffer.
106
+ */
107
+ protected int _outputEnd;
108
+
109
+ /**
110
+ * Short (14 char) temporary buffer allocated if needed, for constructing
111
+ * escape sequences
112
+ */
113
+ protected char[] _entityBuffer;
114
+
115
+ /*
116
+ /**********************************************************
117
+ /* Life-cycle
118
+ /**********************************************************
119
+ */
120
+
121
+ public WriterBasedGenerator(IOContext ctxt, int features, ObjectCodec codec,
122
+ Writer w)
123
+ {
124
+ super(features, codec);
125
+ _ioContext = ctxt;
126
+ _writer = w;
127
+ _outputBuffer = ctxt.allocConcatBuffer();
128
+ _outputEnd = _outputBuffer.length;
129
+
130
+ if (isEnabled(Feature.ESCAPE_NON_ASCII)) {
131
+ setHighestNonEscapedChar(127);
132
+ }
133
+ }
134
+
135
+ /*
136
+ /**********************************************************
137
+ /* Overridden configuration methods
138
+ /**********************************************************
139
+ */
140
+
141
+ @Override
142
+ public JsonGenerator setHighestNonEscapedChar(int charCode) {
143
+ _maximumNonEscapedChar = (charCode < 0) ? 0 : charCode;
144
+ return this;
145
+ }
146
+
147
+ @Override
148
+ public int getHighestEscapedChar() {
149
+ return _maximumNonEscapedChar;
150
+ }
151
+
152
+ @Override
153
+ public JsonGenerator setCharacterEscapes(CharacterEscapes esc)
154
+ {
155
+ _characterEscapes = esc;
156
+ if (esc == null) { // revert to standard escapes
157
+ _outputEscapes = sOutputEscapes;
158
+ } else {
159
+ _outputEscapes = esc.getEscapeCodesForAscii();
160
+ }
161
+ return this;
162
+ }
163
+
164
+ /**
165
+ * Method for accessing custom escapes factory uses for {@link JsonGenerator}s
166
+ * it creates.
167
+ *
168
+ * @since 1.8
169
+ */
170
+ @Override
171
+ public CharacterEscapes getCharacterEscapes() {
172
+ return _characterEscapes;
173
+ }
174
+
175
+ @Override
176
+ public Object getOutputTarget() {
177
+ return _writer;
178
+ }
179
+
180
+ /*
181
+ /**********************************************************
182
+ /* Overridden methods
183
+ /**********************************************************
184
+ */
185
+
186
+ /* Most overrides in this section are just to make methods final,
187
+ * to allow better inlining...
188
+ */
189
+
190
+ @Override
191
+ public final void writeFieldName(String name) throws IOException, JsonGenerationException
192
+ {
193
+ int status = _writeContext.writeFieldName(name);
194
+ if (status == JsonWriteContext.STATUS_EXPECT_VALUE) {
195
+ _reportError("Can not write a field name, expecting a value");
196
+ }
197
+ _writeFieldName(name, (status == JsonWriteContext.STATUS_OK_AFTER_COMMA));
198
+ }
199
+
200
+ @Override
201
+ public final void writeStringField(String fieldName, String value)
202
+ throws IOException, JsonGenerationException
203
+ {
204
+ writeFieldName(fieldName);
205
+ writeString(value);
206
+ }
207
+
208
+ @Override
209
+ public final void writeFieldName(SerializedString name)
210
+ throws IOException, JsonGenerationException
211
+ {
212
+ // Object is a value, need to verify it's allowed
213
+ int status = _writeContext.writeFieldName(name.getValue());
214
+ if (status == JsonWriteContext.STATUS_EXPECT_VALUE) {
215
+ _reportError("Can not write a field name, expecting a value");
216
+ }
217
+ _writeFieldName(name, (status == JsonWriteContext.STATUS_OK_AFTER_COMMA));
218
+ }
219
+
220
+ @Override
221
+ public final void writeFieldName(SerializableString name)
222
+ throws IOException, JsonGenerationException
223
+ {
224
+ // Object is a value, need to verify it's allowed
225
+ int status = _writeContext.writeFieldName(name.getValue());
226
+ if (status == JsonWriteContext.STATUS_EXPECT_VALUE) {
227
+ _reportError("Can not write a field name, expecting a value");
228
+ }
229
+ _writeFieldName(name, (status == JsonWriteContext.STATUS_OK_AFTER_COMMA));
230
+ }
231
+
232
+ /*
233
+ /**********************************************************
234
+ /* Output method implementations, structural
235
+ /**********************************************************
236
+ */
237
+
238
+ @Override
239
+ public final void writeStartArray() throws IOException, JsonGenerationException
240
+ {
241
+ _verifyValueWrite("start an array");
242
+ _writeContext = _writeContext.createChildArrayContext();
243
+ if (_cfgPrettyPrinter != null) {
244
+ _cfgPrettyPrinter.writeStartArray(this);
245
+ } else {
246
+ if (_outputTail >= _outputEnd) {
247
+ _flushBuffer();
248
+ }
249
+ _outputBuffer[_outputTail++] = '[';
250
+ }
251
+ }
252
+
253
+ @Override
254
+ public final void writeEndArray() throws IOException, JsonGenerationException
255
+ {
256
+ if (!_writeContext.inArray()) {
257
+ _reportError("Current context not an ARRAY but "+_writeContext.getTypeDesc());
258
+ }
259
+ if (_cfgPrettyPrinter != null) {
260
+ _cfgPrettyPrinter.writeEndArray(this, _writeContext.getEntryCount());
261
+ } else {
262
+ if (_outputTail >= _outputEnd) {
263
+ _flushBuffer();
264
+ }
265
+ _outputBuffer[_outputTail++] = ']';
266
+ }
267
+ _writeContext = _writeContext.getParent();
268
+ }
269
+
270
+ @Override
271
+ public final void writeStartObject() throws IOException, JsonGenerationException
272
+ {
273
+ _verifyValueWrite("start an object");
274
+ _writeContext = _writeContext.createChildObjectContext();
275
+ if (_cfgPrettyPrinter != null) {
276
+ _cfgPrettyPrinter.writeStartObject(this);
277
+ } else {
278
+ if (_outputTail >= _outputEnd) {
279
+ _flushBuffer();
280
+ }
281
+ _outputBuffer[_outputTail++] = '{';
282
+ }
283
+ }
284
+
285
+ @Override
286
+ public final void writeEndObject() throws IOException, JsonGenerationException
287
+ {
288
+ if (!_writeContext.inObject()) {
289
+ _reportError("Current context not an object but "+_writeContext.getTypeDesc());
290
+ }
291
+ _writeContext = _writeContext.getParent();
292
+ if (_cfgPrettyPrinter != null) {
293
+ _cfgPrettyPrinter.writeEndObject(this, _writeContext.getEntryCount());
294
+ } else {
295
+ if (_outputTail >= _outputEnd) {
296
+ _flushBuffer();
297
+ }
298
+ _outputBuffer[_outputTail++] = '}';
299
+ }
300
+ }
301
+
302
+ protected void _writeFieldName(String name, boolean commaBefore)
303
+ throws IOException, JsonGenerationException
304
+ {
305
+ if (_cfgPrettyPrinter != null) {
306
+ _writePPFieldName(name, commaBefore);
307
+ return;
308
+ }
309
+ // for fast+std case, need to output up to 2 chars, comma, dquote
310
+ if ((_outputTail + 1) >= _outputEnd) {
311
+ _flushBuffer();
312
+ }
313
+ if (commaBefore) {
314
+ _outputBuffer[_outputTail++] = ',';
315
+ }
316
+
317
+ /* To support [JACKSON-46], we'll do this:
318
+ * (Question: should quoting of spaces (etc) still be enabled?)
319
+ */
320
+ if (!isEnabled(Feature.QUOTE_FIELD_NAMES)) {
321
+ _writeString(name);
322
+ return;
323
+ }
324
+
325
+ // we know there's room for at least one more char
326
+ _outputBuffer[_outputTail++] = '"';
327
+ // The beef:
328
+ _writeString(name);
329
+ // and closing quotes; need room for one more char:
330
+ if (_outputTail >= _outputEnd) {
331
+ _flushBuffer();
332
+ }
333
+ _outputBuffer[_outputTail++] = '"';
334
+ }
335
+
336
+ public void _writeFieldName(SerializableString name, boolean commaBefore)
337
+ throws IOException, JsonGenerationException
338
+ {
339
+ if (_cfgPrettyPrinter != null) {
340
+ _writePPFieldName(name, commaBefore);
341
+ return;
342
+ }
343
+ // for fast+std case, need to output up to 2 chars, comma, dquote
344
+ if ((_outputTail + 1) >= _outputEnd) {
345
+ _flushBuffer();
346
+ }
347
+ if (commaBefore) {
348
+ _outputBuffer[_outputTail++] = ',';
349
+ }
350
+ /* To support [JACKSON-46], we'll do this:
351
+ * (Question: should quoting of spaces (etc) still be enabled?)
352
+ */
353
+ final char[] quoted = name.asQuotedChars();
354
+ if (!isEnabled(Feature.QUOTE_FIELD_NAMES)) {
355
+ writeRaw(quoted, 0, quoted.length);
356
+ return;
357
+ }
358
+ // we know there's room for at least one more char
359
+ _outputBuffer[_outputTail++] = '"';
360
+ // The beef:
361
+ final int qlen = quoted.length;
362
+ if ((_outputTail + qlen + 1) >= _outputEnd) {
363
+ writeRaw(quoted, 0, qlen);
364
+ // and closing quotes; need room for one more char:
365
+ if (_outputTail >= _outputEnd) {
366
+ _flushBuffer();
367
+ }
368
+ _outputBuffer[_outputTail++] = '"';
369
+ } else {
370
+ System.arraycopy(quoted, 0, _outputBuffer, _outputTail, qlen);
371
+ _outputTail += qlen;
372
+ _outputBuffer[_outputTail++] = '"';
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Specialized version of <code>_writeFieldName</code>, off-lined
378
+ * to keep the "fast path" as simple (and hopefully fast) as possible.
379
+ */
380
+ protected final void _writePPFieldName(String name, boolean commaBefore)
381
+ throws IOException, JsonGenerationException
382
+ {
383
+ if (commaBefore) {
384
+ _cfgPrettyPrinter.writeObjectEntrySeparator(this);
385
+ } else {
386
+ _cfgPrettyPrinter.beforeObjectEntries(this);
387
+ }
388
+
389
+ if (isEnabled(Feature.QUOTE_FIELD_NAMES)) { // standard
390
+ if (_outputTail >= _outputEnd) {
391
+ _flushBuffer();
392
+ }
393
+ _outputBuffer[_outputTail++] = '"';
394
+ _writeString(name);
395
+ if (_outputTail >= _outputEnd) {
396
+ _flushBuffer();
397
+ }
398
+ _outputBuffer[_outputTail++] = '"';
399
+ } else { // non-standard, omit quotes
400
+ _writeString(name);
401
+ }
402
+ }
403
+
404
+ protected final void _writePPFieldName(SerializableString name, boolean commaBefore)
405
+ throws IOException, JsonGenerationException
406
+ {
407
+ if (commaBefore) {
408
+ _cfgPrettyPrinter.writeObjectEntrySeparator(this);
409
+ } else {
410
+ _cfgPrettyPrinter.beforeObjectEntries(this);
411
+ }
412
+
413
+ final char[] quoted = name.asQuotedChars();
414
+ if (isEnabled(Feature.QUOTE_FIELD_NAMES)) { // standard
415
+ if (_outputTail >= _outputEnd) {
416
+ _flushBuffer();
417
+ }
418
+ _outputBuffer[_outputTail++] = '"';
419
+ writeRaw(quoted, 0, quoted.length);
420
+ if (_outputTail >= _outputEnd) {
421
+ _flushBuffer();
422
+ }
423
+ _outputBuffer[_outputTail++] = '"';
424
+ } else { // non-standard, omit quotes
425
+ writeRaw(quoted, 0, quoted.length);
426
+ }
427
+ }
428
+
429
+ /*
430
+ /**********************************************************
431
+ /* Output method implementations, textual
432
+ /**********************************************************
433
+ */
434
+
435
+ @Override
436
+ public void writeString(String text)
437
+ throws IOException, JsonGenerationException
438
+ {
439
+ _verifyValueWrite("write text value");
440
+ if (text == null) {
441
+ _writeNull();
442
+ return;
443
+ }
444
+ if (_outputTail >= _outputEnd) {
445
+ _flushBuffer();
446
+ }
447
+ _outputBuffer[_outputTail++] = '"';
448
+ _writeString(text);
449
+ // And finally, closing quotes
450
+ if (_outputTail >= _outputEnd) {
451
+ _flushBuffer();
452
+ }
453
+ _outputBuffer[_outputTail++] = '"';
454
+ }
455
+
456
+ @Override
457
+ public void writeString(char[] text, int offset, int len)
458
+ throws IOException, JsonGenerationException
459
+ {
460
+ _verifyValueWrite("write text value");
461
+ if (_outputTail >= _outputEnd) {
462
+ _flushBuffer();
463
+ }
464
+ _outputBuffer[_outputTail++] = '"';
465
+ _writeString(text, offset, len);
466
+ // And finally, closing quotes
467
+ if (_outputTail >= _outputEnd) {
468
+ _flushBuffer();
469
+ }
470
+ _outputBuffer[_outputTail++] = '"';
471
+ }
472
+
473
+ @Override
474
+ public final void writeString(SerializableString sstr)
475
+ throws IOException, JsonGenerationException
476
+ {
477
+ _verifyValueWrite("write text value");
478
+ if (_outputTail >= _outputEnd) {
479
+ _flushBuffer();
480
+ }
481
+ _outputBuffer[_outputTail++] = '"';
482
+ // Note: copied from writeRaw:
483
+ char[] text = sstr.asQuotedChars();
484
+ final int len = text.length;
485
+ // Only worth buffering if it's a short write?
486
+ if (len < SHORT_WRITE) {
487
+ int room = _outputEnd - _outputTail;
488
+ if (len > room) {
489
+ _flushBuffer();
490
+ }
491
+ System.arraycopy(text, 0, _outputBuffer, _outputTail, len);
492
+ _outputTail += len;
493
+ } else {
494
+ // Otherwise, better just pass through:
495
+ _flushBuffer();
496
+ _writer.write(text, 0, len);
497
+ }
498
+ if (_outputTail >= _outputEnd) {
499
+ _flushBuffer();
500
+ }
501
+ _outputBuffer[_outputTail++] = '"';
502
+ }
503
+
504
+ @Override
505
+ public void writeRawUTF8String(byte[] text, int offset, int length)
506
+ throws IOException, JsonGenerationException
507
+ {
508
+ // could add support for buffering if we really want it...
509
+ _reportUnsupportedOperation();
510
+ }
511
+
512
+ @Override
513
+ public void writeUTF8String(byte[] text, int offset, int length)
514
+ throws IOException, JsonGenerationException
515
+ {
516
+ // could add support for buffering if we really want it...
517
+ _reportUnsupportedOperation();
518
+ }
519
+
520
+ /*
521
+ /**********************************************************
522
+ /* Output method implementations, unprocessed ("raw")
523
+ /**********************************************************
524
+ */
525
+
526
+ @Override
527
+ public void writeRaw(String text)
528
+ throws IOException, JsonGenerationException
529
+ {
530
+ // Nothing to check, can just output as is
531
+ int len = text.length();
532
+ int room = _outputEnd - _outputTail;
533
+
534
+ if (room == 0) {
535
+ _flushBuffer();
536
+ room = _outputEnd - _outputTail;
537
+ }
538
+ // But would it nicely fit in? If yes, it's easy
539
+ if (room >= len) {
540
+ text.getChars(0, len, _outputBuffer, _outputTail);
541
+ _outputTail += len;
542
+ } else {
543
+ writeRawLong(text);
544
+ }
545
+ }
546
+
547
+ @Override
548
+ public void writeRaw(String text, int start, int len)
549
+ throws IOException, JsonGenerationException
550
+ {
551
+ // Nothing to check, can just output as is
552
+ int room = _outputEnd - _outputTail;
553
+
554
+ if (room < len) {
555
+ _flushBuffer();
556
+ room = _outputEnd - _outputTail;
557
+ }
558
+ // But would it nicely fit in? If yes, it's easy
559
+ if (room >= len) {
560
+ text.getChars(start, start+len, _outputBuffer, _outputTail);
561
+ _outputTail += len;
562
+ } else {
563
+ writeRawLong(text.substring(start, start+len));
564
+ }
565
+ }
566
+
567
+ @Override
568
+ public void writeRaw(char[] text, int offset, int len)
569
+ throws IOException, JsonGenerationException
570
+ {
571
+ // Only worth buffering if it's a short write?
572
+ if (len < SHORT_WRITE) {
573
+ int room = _outputEnd - _outputTail;
574
+ if (len > room) {
575
+ _flushBuffer();
576
+ }
577
+ System.arraycopy(text, offset, _outputBuffer, _outputTail, len);
578
+ _outputTail += len;
579
+ return;
580
+ }
581
+ // Otherwise, better just pass through:
582
+ _flushBuffer();
583
+ _writer.write(text, offset, len);
584
+ }
585
+
586
+ @Override
587
+ public void writeRaw(char c)
588
+ throws IOException, JsonGenerationException
589
+ {
590
+ if (_outputTail >= _outputEnd) {
591
+ _flushBuffer();
592
+ }
593
+ _outputBuffer[_outputTail++] = c;
594
+ }
595
+
596
+ private void writeRawLong(String text)
597
+ throws IOException, JsonGenerationException
598
+ {
599
+ int room = _outputEnd - _outputTail;
600
+ // If not, need to do it by looping
601
+ text.getChars(0, room, _outputBuffer, _outputTail);
602
+ _outputTail += room;
603
+ _flushBuffer();
604
+ int offset = room;
605
+ int len = text.length() - room;
606
+
607
+ while (len > _outputEnd) {
608
+ int amount = _outputEnd;
609
+ text.getChars(offset, offset+amount, _outputBuffer, 0);
610
+ _outputHead = 0;
611
+ _outputTail = amount;
612
+ _flushBuffer();
613
+ offset += amount;
614
+ len -= amount;
615
+ }
616
+ // And last piece (at most length of buffer)
617
+ text.getChars(offset, offset+len, _outputBuffer, 0);
618
+ _outputHead = 0;
619
+ _outputTail = len;
620
+ }
621
+
622
+ /*
623
+ /**********************************************************
624
+ /* Output method implementations, base64-encoded binary
625
+ /**********************************************************
626
+ */
627
+
628
+ @Override
629
+ public void writeBinary(Base64Variant b64variant, byte[] data, int offset, int len)
630
+ throws IOException, JsonGenerationException
631
+ {
632
+ _verifyValueWrite("write binary value");
633
+ // Starting quotes
634
+ if (_outputTail >= _outputEnd) {
635
+ _flushBuffer();
636
+ }
637
+ _outputBuffer[_outputTail++] = '"';
638
+ _writeBinary(b64variant, data, offset, offset+len);
639
+ // and closing quotes
640
+ if (_outputTail >= _outputEnd) {
641
+ _flushBuffer();
642
+ }
643
+ _outputBuffer[_outputTail++] = '"';
644
+ }
645
+
646
+ /*
647
+ /**********************************************************
648
+ /* Output method implementations, primitive
649
+ /**********************************************************
650
+ */
651
+
652
+ @Override
653
+ public void writeNumber(int i)
654
+ throws IOException, JsonGenerationException
655
+ {
656
+ _verifyValueWrite("write number");
657
+ if (_cfgNumbersAsStrings) {
658
+ _writeQuotedInt(i);
659
+ return;
660
+ }
661
+ // up to 10 digits and possible minus sign
662
+ if ((_outputTail + 11) >= _outputEnd) {
663
+ _flushBuffer();
664
+ }
665
+ _outputTail = NumberOutput.outputInt(i, _outputBuffer, _outputTail);
666
+ }
667
+
668
+ private final void _writeQuotedInt(int i) throws IOException {
669
+ if ((_outputTail + 13) >= _outputEnd) {
670
+ _flushBuffer();
671
+ }
672
+ _outputBuffer[_outputTail++] = '"';
673
+ _outputTail = NumberOutput.outputInt(i, _outputBuffer, _outputTail);
674
+ _outputBuffer[_outputTail++] = '"';
675
+ }
676
+
677
+ @Override
678
+ public void writeNumber(long l)
679
+ throws IOException, JsonGenerationException
680
+ {
681
+ _verifyValueWrite("write number");
682
+ if (_cfgNumbersAsStrings) {
683
+ _writeQuotedLong(l);
684
+ return;
685
+ }
686
+ if ((_outputTail + 21) >= _outputEnd) {
687
+ // up to 20 digits, minus sign
688
+ _flushBuffer();
689
+ }
690
+ _outputTail = NumberOutput.outputLong(l, _outputBuffer, _outputTail);
691
+ }
692
+
693
+ private final void _writeQuotedLong(long l) throws IOException {
694
+ if ((_outputTail + 23) >= _outputEnd) {
695
+ _flushBuffer();
696
+ }
697
+ _outputBuffer[_outputTail++] = '"';
698
+ _outputTail = NumberOutput.outputLong(l, _outputBuffer, _outputTail);
699
+ _outputBuffer[_outputTail++] = '"';
700
+ }
701
+
702
+ // !!! 05-Aug-2008, tatus: Any ways to optimize these?
703
+
704
+ @Override
705
+ public void writeNumber(BigInteger value)
706
+ throws IOException, JsonGenerationException
707
+ {
708
+ _verifyValueWrite("write number");
709
+ if (value == null) {
710
+ _writeNull();
711
+ } else if (_cfgNumbersAsStrings) {
712
+ _writeQuotedRaw(value);
713
+ } else {
714
+ writeRaw(value.toString());
715
+ }
716
+ }
717
+
718
+
719
+ @Override
720
+ public void writeNumber(double d)
721
+ throws IOException, JsonGenerationException
722
+ {
723
+ if (_cfgNumbersAsStrings ||
724
+ // [JACKSON-139]
725
+ (((Double.isNaN(d) || Double.isInfinite(d))
726
+ && isEnabled(Feature.QUOTE_NON_NUMERIC_NUMBERS)))) {
727
+ writeString(String.valueOf(d));
728
+ return;
729
+ }
730
+ // What is the max length for doubles? 40 chars?
731
+ _verifyValueWrite("write number");
732
+ writeRaw(String.valueOf(d));
733
+ }
734
+
735
+ @Override
736
+ public void writeNumber(float f)
737
+ throws IOException, JsonGenerationException
738
+ {
739
+ if (_cfgNumbersAsStrings ||
740
+ // [JACKSON-139]
741
+ (((Float.isNaN(f) || Float.isInfinite(f))
742
+ && isEnabled(Feature.QUOTE_NON_NUMERIC_NUMBERS)))) {
743
+ writeString(String.valueOf(f));
744
+ return;
745
+ }
746
+ // What is the max length for floats?
747
+ _verifyValueWrite("write number");
748
+ writeRaw(String.valueOf(f));
749
+ }
750
+
751
+ @Override
752
+ public void writeNumber(BigDecimal value)
753
+ throws IOException, JsonGenerationException
754
+ {
755
+ // Don't really know max length for big decimal, no point checking
756
+ _verifyValueWrite("write number");
757
+ if (value == null) {
758
+ _writeNull();
759
+ } else if (_cfgNumbersAsStrings) {
760
+ _writeQuotedRaw(value);
761
+ } else {
762
+ writeRaw(value.toString());
763
+ }
764
+ }
765
+
766
+ @Override
767
+ public void writeNumber(String encodedValue)
768
+ throws IOException, JsonGenerationException
769
+ {
770
+ _verifyValueWrite("write number");
771
+ if (_cfgNumbersAsStrings) {
772
+ _writeQuotedRaw(encodedValue);
773
+ } else {
774
+ writeRaw(encodedValue);
775
+ }
776
+ }
777
+
778
+ private final void _writeQuotedRaw(Object value) throws IOException
779
+ {
780
+ if (_outputTail >= _outputEnd) {
781
+ _flushBuffer();
782
+ }
783
+ _outputBuffer[_outputTail++] = '"';
784
+ writeRaw(value.toString());
785
+ if (_outputTail >= _outputEnd) {
786
+ _flushBuffer();
787
+ }
788
+ _outputBuffer[_outputTail++] = '"';
789
+ }
790
+
791
+ @Override
792
+ public void writeBoolean(boolean state)
793
+ throws IOException, JsonGenerationException
794
+ {
795
+ _verifyValueWrite("write boolean value");
796
+ if ((_outputTail + 5) >= _outputEnd) {
797
+ _flushBuffer();
798
+ }
799
+ int ptr = _outputTail;
800
+ char[] buf = _outputBuffer;
801
+ if (state) {
802
+ buf[ptr] = 't';
803
+ buf[++ptr] = 'r';
804
+ buf[++ptr] = 'u';
805
+ buf[++ptr] = 'e';
806
+ } else {
807
+ buf[ptr] = 'f';
808
+ buf[++ptr] = 'a';
809
+ buf[++ptr] = 'l';
810
+ buf[++ptr] = 's';
811
+ buf[++ptr] = 'e';
812
+ }
813
+ _outputTail = ptr+1;
814
+ }
815
+
816
+ @Override
817
+ public void writeNull()
818
+ throws IOException, JsonGenerationException
819
+ {
820
+ _verifyValueWrite("write null value");
821
+ _writeNull();
822
+ }
823
+
824
+ /*
825
+ /**********************************************************
826
+ /* Implementations for other methods
827
+ /**********************************************************
828
+ */
829
+
830
+ @Override
831
+ protected final void _verifyValueWrite(String typeMsg)
832
+ throws IOException, JsonGenerationException
833
+ {
834
+ int status = _writeContext.writeValue();
835
+ if (status == JsonWriteContext.STATUS_EXPECT_NAME) {
836
+ _reportError("Can not "+typeMsg+", expecting field name");
837
+ }
838
+ if (_cfgPrettyPrinter == null) {
839
+ char c;
840
+ switch (status) {
841
+ case JsonWriteContext.STATUS_OK_AFTER_COMMA:
842
+ c = ',';
843
+ break;
844
+ case JsonWriteContext.STATUS_OK_AFTER_COLON:
845
+ c = ':';
846
+ break;
847
+ case JsonWriteContext.STATUS_OK_AFTER_SPACE:
848
+ c = ' ';
849
+ break;
850
+ case JsonWriteContext.STATUS_OK_AS_IS:
851
+ default:
852
+ return;
853
+ }
854
+ if (_outputTail >= _outputEnd) {
855
+ _flushBuffer();
856
+ }
857
+ _outputBuffer[_outputTail] = c;
858
+ ++_outputTail;
859
+ return;
860
+ }
861
+ // Otherwise, pretty printer knows what to do...
862
+ _verifyPrettyValueWrite(typeMsg, status);
863
+ }
864
+
865
+ protected final void _verifyPrettyValueWrite(String typeMsg, int status)
866
+ throws IOException, JsonGenerationException
867
+ {
868
+ // If we have a pretty printer, it knows what to do:
869
+ switch (status) {
870
+ case JsonWriteContext.STATUS_OK_AFTER_COMMA: // array
871
+ _cfgPrettyPrinter.writeArrayValueSeparator(this);
872
+ break;
873
+ case JsonWriteContext.STATUS_OK_AFTER_COLON:
874
+ _cfgPrettyPrinter.writeObjectFieldValueSeparator(this);
875
+ break;
876
+ case JsonWriteContext.STATUS_OK_AFTER_SPACE:
877
+ _cfgPrettyPrinter.writeRootValueSeparator(this);
878
+ break;
879
+ case JsonWriteContext.STATUS_OK_AS_IS:
880
+ // First entry, but of which context?
881
+ if (_writeContext.inArray()) {
882
+ _cfgPrettyPrinter.beforeArrayValues(this);
883
+ } else if (_writeContext.inObject()) {
884
+ _cfgPrettyPrinter.beforeObjectEntries(this);
885
+ }
886
+ break;
887
+ default:
888
+ _cantHappen();
889
+ break;
890
+ }
891
+ }
892
+
893
+ /*
894
+ /**********************************************************
895
+ /* Low-level output handling
896
+ /**********************************************************
897
+ */
898
+
899
+ @Override
900
+ public final void flush()
901
+ throws IOException
902
+ {
903
+ _flushBuffer();
904
+ if (_writer != null) {
905
+ if (isEnabled(Feature.FLUSH_PASSED_TO_STREAM)) {
906
+ _writer.flush();
907
+ }
908
+ }
909
+ }
910
+
911
+ @Override
912
+ public void close()
913
+ throws IOException
914
+ {
915
+ super.close();
916
+
917
+ /* 05-Dec-2008, tatu: To add [JACKSON-27], need to close open
918
+ * scopes.
919
+ */
920
+ // First: let's see that we still have buffers...
921
+ if (_outputBuffer != null
922
+ && isEnabled(Feature.AUTO_CLOSE_JSON_CONTENT)) {
923
+ while (true) {
924
+ JsonStreamContext ctxt = getOutputContext();
925
+ if (ctxt.inArray()) {
926
+ writeEndArray();
927
+ } else if (ctxt.inObject()) {
928
+ writeEndObject();
929
+ } else {
930
+ break;
931
+ }
932
+ }
933
+ }
934
+ _flushBuffer();
935
+
936
+ /* 25-Nov-2008, tatus: As per [JACKSON-16] we are not to call close()
937
+ * on the underlying Reader, unless we "own" it, or auto-closing
938
+ * feature is enabled.
939
+ * One downside: when using UTF8Writer, underlying buffer(s)
940
+ * may not be properly recycled if we don't close the writer.
941
+ */
942
+ if (_writer != null) {
943
+ if (_ioContext.isResourceManaged() || isEnabled(Feature.AUTO_CLOSE_TARGET)) {
944
+ _writer.close();
945
+ } else if (isEnabled(Feature.FLUSH_PASSED_TO_STREAM)) {
946
+ // If we can't close it, we should at least flush
947
+ _writer.flush();
948
+ }
949
+ }
950
+ // Internal buffer(s) generator has can now be released as well
951
+ _releaseBuffers();
952
+ }
953
+
954
+ @Override
955
+ protected void _releaseBuffers()
956
+ {
957
+ char[] buf = _outputBuffer;
958
+ if (buf != null) {
959
+ _outputBuffer = null;
960
+ _ioContext.releaseConcatBuffer(buf);
961
+ }
962
+ }
963
+
964
+ /*
965
+ /**********************************************************
966
+ /* Internal methods, low-level writing; text, default
967
+ /**********************************************************
968
+ */
969
+
970
+ private void _writeString(String text)
971
+ throws IOException, JsonGenerationException
972
+ {
973
+ /* One check first: if String won't fit in the buffer, let's
974
+ * segment writes. No point in extending buffer to huge sizes
975
+ * (like if someone wants to include multi-megabyte base64
976
+ * encoded stuff or such)
977
+ */
978
+ final int len = text.length();
979
+ if (len > _outputEnd) { // Let's reserve space for entity at begin/end
980
+ _writeLongString(text);
981
+ return;
982
+ }
983
+
984
+ // Ok: we know String will fit in buffer ok
985
+ // But do we need to flush first?
986
+ if ((_outputTail + len) > _outputEnd) {
987
+ _flushBuffer();
988
+ }
989
+ text.getChars(0, len, _outputBuffer, _outputTail);
990
+
991
+ if (_characterEscapes != null) {
992
+ _writeStringCustom(len);
993
+ } else if (_maximumNonEscapedChar != 0) {
994
+ _writeStringASCII(len, _maximumNonEscapedChar);
995
+ } else {
996
+ _writeString2(len);
997
+ }
998
+ }
999
+
1000
+ private void _writeString2(final int len)
1001
+ throws IOException, JsonGenerationException
1002
+ {
1003
+ // And then we'll need to verify need for escaping etc:
1004
+ int end = _outputTail + len;
1005
+ final int[] escCodes = _outputEscapes;
1006
+ final int escLen = escCodes.length;
1007
+
1008
+ output_loop:
1009
+ while (_outputTail < end) {
1010
+ // Fast loop for chars not needing escaping
1011
+ escape_loop:
1012
+ while (true) {
1013
+ char c = _outputBuffer[_outputTail];
1014
+ if (c < escLen && escCodes[c] != 0) {
1015
+ break escape_loop;
1016
+ }
1017
+ if (++_outputTail >= end) {
1018
+ break output_loop;
1019
+ }
1020
+ }
1021
+
1022
+ // Ok, bumped into something that needs escaping.
1023
+ /* First things first: need to flush the buffer.
1024
+ * Inlined, as we don't want to lose tail pointer
1025
+ */
1026
+ int flushLen = (_outputTail - _outputHead);
1027
+ if (flushLen > 0) {
1028
+ _writer.write(_outputBuffer, _outputHead, flushLen);
1029
+ }
1030
+ /* In any case, tail will be the new start, so hopefully
1031
+ * we have room now.
1032
+ */
1033
+ char c = _outputBuffer[_outputTail++];
1034
+ _prependOrWriteCharacterEscape(c, escCodes[c]);
1035
+ }
1036
+ }
1037
+
1038
+ /**
1039
+ * Method called to write "long strings", strings whose length exceeds
1040
+ * output buffer length.
1041
+ */
1042
+ private void _writeLongString(String text)
1043
+ throws IOException, JsonGenerationException
1044
+ {
1045
+ // First things first: let's flush the buffer to get some more room
1046
+ _flushBuffer();
1047
+
1048
+ // Then we can write
1049
+ final int textLen = text.length();
1050
+ int offset = 0;
1051
+ do {
1052
+ int max = _outputEnd;
1053
+ int segmentLen = ((offset + max) > textLen)
1054
+ ? (textLen - offset) : max;
1055
+ text.getChars(offset, offset+segmentLen, _outputBuffer, 0);
1056
+ if (_characterEscapes != null) {
1057
+ _writeSegmentCustom(segmentLen);
1058
+ } else if (_maximumNonEscapedChar != 0) {
1059
+ _writeSegmentASCII(segmentLen, _maximumNonEscapedChar);
1060
+ } else {
1061
+ _writeSegment(segmentLen);
1062
+ }
1063
+ offset += segmentLen;
1064
+ } while (offset < textLen);
1065
+ }
1066
+
1067
+ /**
1068
+ * Method called to output textual context which has been copied
1069
+ * to the output buffer prior to call. If any escaping is needed,
1070
+ * it will also be handled by the method.
1071
+ *<p>
1072
+ * Note: when called, textual content to write is within output
1073
+ * buffer, right after buffered content (if any). That's why only
1074
+ * length of that text is passed, as buffer and offset are implied.
1075
+ */
1076
+ private final void _writeSegment(int end)
1077
+ throws IOException, JsonGenerationException
1078
+ {
1079
+ final int[] escCodes = _outputEscapes;
1080
+ final int escLen = escCodes.length;
1081
+
1082
+ int ptr = 0;
1083
+ int start = ptr;
1084
+
1085
+ output_loop:
1086
+ while (ptr < end) {
1087
+ // Fast loop for chars not needing escaping
1088
+ char c;
1089
+ while (true) {
1090
+ c = _outputBuffer[ptr];
1091
+ if (c < escLen && escCodes[c] != 0) {
1092
+ break;
1093
+ }
1094
+ if (++ptr >= end) {
1095
+ break;
1096
+ }
1097
+ }
1098
+
1099
+ // Ok, bumped into something that needs escaping.
1100
+ /* First things first: need to flush the buffer.
1101
+ * Inlined, as we don't want to lose tail pointer
1102
+ */
1103
+ int flushLen = (ptr - start);
1104
+ if (flushLen > 0) {
1105
+ _writer.write(_outputBuffer, start, flushLen);
1106
+ if (ptr >= end) {
1107
+ break output_loop;
1108
+ }
1109
+ }
1110
+ ++ptr;
1111
+ // So; either try to prepend (most likely), or write directly:
1112
+ start = _prependOrWriteCharacterEscape(_outputBuffer, ptr, end, c, escCodes[c]);
1113
+ }
1114
+ }
1115
+
1116
+ /**
1117
+ * This method called when the string content is already in
1118
+ * a char buffer, and need not be copied for processing.
1119
+ */
1120
+ private final void _writeString(char[] text, int offset, int len)
1121
+ throws IOException, JsonGenerationException
1122
+ {
1123
+ if (_characterEscapes != null) {
1124
+ _writeStringCustom(text, offset, len);
1125
+ return;
1126
+ }
1127
+ if (_maximumNonEscapedChar != 0) {
1128
+ _writeStringASCII(text, offset, len, _maximumNonEscapedChar);
1129
+ return;
1130
+ }
1131
+
1132
+ /* Let's just find longest spans of non-escapable
1133
+ * content, and for each see if it makes sense
1134
+ * to copy them, or write through
1135
+ */
1136
+ len += offset; // -> len marks the end from now on
1137
+ final int[] escCodes = _outputEscapes;
1138
+ final int escLen = escCodes.length;
1139
+ while (offset < len) {
1140
+ int start = offset;
1141
+
1142
+ while (true) {
1143
+ char c = text[offset];
1144
+ if (c < escLen && escCodes[c] != 0) {
1145
+ break;
1146
+ }
1147
+ if (++offset >= len) {
1148
+ break;
1149
+ }
1150
+ }
1151
+
1152
+ // Short span? Better just copy it to buffer first:
1153
+ int newAmount = offset - start;
1154
+ if (newAmount < SHORT_WRITE) {
1155
+ // Note: let's reserve room for escaped char (up to 6 chars)
1156
+ if ((_outputTail + newAmount) > _outputEnd) {
1157
+ _flushBuffer();
1158
+ }
1159
+ if (newAmount > 0) {
1160
+ System.arraycopy(text, start, _outputBuffer, _outputTail, newAmount);
1161
+ _outputTail += newAmount;
1162
+ }
1163
+ } else { // Nope: better just write through
1164
+ _flushBuffer();
1165
+ _writer.write(text, start, newAmount);
1166
+ }
1167
+ // Was this the end?
1168
+ if (offset >= len) { // yup
1169
+ break;
1170
+ }
1171
+ // Nope, need to escape the char.
1172
+ char c = text[offset++];
1173
+ _appendCharacterEscape(c, escCodes[c]);
1174
+ }
1175
+ }
1176
+
1177
+ /*
1178
+ /**********************************************************
1179
+ /* Internal methods, low-level writing, text segment
1180
+ /* with additional escaping (ASCII or such)
1181
+ /* (since 1.8; see [JACKSON-102])
1182
+ /**********************************************************
1183
+ */
1184
+
1185
+ /* Same as "_writeString2()", except needs additional escaping
1186
+ * for subset of characters
1187
+ */
1188
+ private void _writeStringASCII(final int len, final int maxNonEscaped)
1189
+ throws IOException, JsonGenerationException
1190
+ {
1191
+ // And then we'll need to verify need for escaping etc:
1192
+ int end = _outputTail + len;
1193
+ final int[] escCodes = _outputEscapes;
1194
+ final int escLimit = Math.min(escCodes.length, _maximumNonEscapedChar+1);
1195
+ int escCode = 0;
1196
+
1197
+ output_loop:
1198
+ while (_outputTail < end) {
1199
+ char c;
1200
+ // Fast loop for chars not needing escaping
1201
+ escape_loop:
1202
+ while (true) {
1203
+ c = _outputBuffer[_outputTail];
1204
+ if (c < escLimit) {
1205
+ escCode = escCodes[c];
1206
+ if (escCode != 0) {
1207
+ break escape_loop;
1208
+ }
1209
+ } else if (c > maxNonEscaped) {
1210
+ escCode = CharacterEscapes.ESCAPE_STANDARD;
1211
+ break escape_loop;
1212
+ }
1213
+ if (++_outputTail >= end) {
1214
+ break output_loop;
1215
+ }
1216
+ }
1217
+ int flushLen = (_outputTail - _outputHead);
1218
+ if (flushLen > 0) {
1219
+ _writer.write(_outputBuffer, _outputHead, flushLen);
1220
+ }
1221
+ ++_outputTail;
1222
+ _prependOrWriteCharacterEscape(c, escCode);
1223
+ }
1224
+ }
1225
+
1226
+ private final void _writeSegmentASCII(int end, final int maxNonEscaped)
1227
+ throws IOException, JsonGenerationException
1228
+ {
1229
+ final int[] escCodes = _outputEscapes;
1230
+ final int escLimit = Math.min(escCodes.length, _maximumNonEscapedChar+1);
1231
+
1232
+ int ptr = 0;
1233
+ int escCode = 0;
1234
+ int start = ptr;
1235
+
1236
+ output_loop:
1237
+ while (ptr < end) {
1238
+ // Fast loop for chars not needing escaping
1239
+ char c;
1240
+ while (true) {
1241
+ c = _outputBuffer[ptr];
1242
+ if (c < escLimit) {
1243
+ escCode = escCodes[c];
1244
+ if (escCode != 0) {
1245
+ break;
1246
+ }
1247
+ } else if (c > maxNonEscaped) {
1248
+ escCode = CharacterEscapes.ESCAPE_STANDARD;
1249
+ break;
1250
+ }
1251
+ if (++ptr >= end) {
1252
+ break;
1253
+ }
1254
+ }
1255
+ int flushLen = (ptr - start);
1256
+ if (flushLen > 0) {
1257
+ _writer.write(_outputBuffer, start, flushLen);
1258
+ if (ptr >= end) {
1259
+ break output_loop;
1260
+ }
1261
+ }
1262
+ ++ptr;
1263
+ start = _prependOrWriteCharacterEscape(_outputBuffer, ptr, end, c, escCode);
1264
+ }
1265
+ }
1266
+
1267
+ private final void _writeStringASCII(char[] text, int offset, int len,
1268
+ final int maxNonEscaped)
1269
+ throws IOException, JsonGenerationException
1270
+ {
1271
+ len += offset; // -> len marks the end from now on
1272
+ final int[] escCodes = _outputEscapes;
1273
+ final int escLimit = Math.min(escCodes.length, maxNonEscaped+1);
1274
+
1275
+ int escCode = 0;
1276
+
1277
+ while (offset < len) {
1278
+ int start = offset;
1279
+ char c;
1280
+
1281
+ while (true) {
1282
+ c = text[offset];
1283
+ if (c < escLimit) {
1284
+ escCode = escCodes[c];
1285
+ if (escCode != 0) {
1286
+ break;
1287
+ }
1288
+ } else if (c > maxNonEscaped) {
1289
+ escCode = CharacterEscapes.ESCAPE_STANDARD;
1290
+ break;
1291
+ }
1292
+ if (++offset >= len) {
1293
+ break;
1294
+ }
1295
+ }
1296
+
1297
+ // Short span? Better just copy it to buffer first:
1298
+ int newAmount = offset - start;
1299
+ if (newAmount < SHORT_WRITE) {
1300
+ // Note: let's reserve room for escaped char (up to 6 chars)
1301
+ if ((_outputTail + newAmount) > _outputEnd) {
1302
+ _flushBuffer();
1303
+ }
1304
+ if (newAmount > 0) {
1305
+ System.arraycopy(text, start, _outputBuffer, _outputTail, newAmount);
1306
+ _outputTail += newAmount;
1307
+ }
1308
+ } else { // Nope: better just write through
1309
+ _flushBuffer();
1310
+ _writer.write(text, start, newAmount);
1311
+ }
1312
+ // Was this the end?
1313
+ if (offset >= len) { // yup
1314
+ break;
1315
+ }
1316
+ // Nope, need to escape the char.
1317
+ ++offset;
1318
+ _appendCharacterEscape(c, escCode);
1319
+ }
1320
+ }
1321
+
1322
+ /*
1323
+ /**********************************************************
1324
+ /* Internal methods, low-level writing, text segment
1325
+ /* with custom escaping (possibly coupling with ASCII limits)
1326
+ /* (since 1.8; see [JACKSON-106])
1327
+ /**********************************************************
1328
+ */
1329
+
1330
+ /* Same as "_writeString2()", except needs additional escaping
1331
+ * for subset of characters
1332
+ */
1333
+ private void _writeStringCustom(final int len)
1334
+ throws IOException, JsonGenerationException
1335
+ {
1336
+ // And then we'll need to verify need for escaping etc:
1337
+ int end = _outputTail + len;
1338
+ final int[] escCodes = _outputEscapes;
1339
+ final int maxNonEscaped = (_maximumNonEscapedChar < 1) ? 0xFFFF : _maximumNonEscapedChar;
1340
+ final int escLimit = Math.min(escCodes.length, maxNonEscaped+1);
1341
+ int escCode = 0;
1342
+ final CharacterEscapes customEscapes = _characterEscapes;
1343
+
1344
+ output_loop:
1345
+ while (_outputTail < end) {
1346
+ char c;
1347
+ // Fast loop for chars not needing escaping
1348
+ escape_loop:
1349
+ while (true) {
1350
+ c = _outputBuffer[_outputTail];
1351
+ if (c < escLimit) {
1352
+ escCode = escCodes[c];
1353
+ if (escCode != 0) {
1354
+ break escape_loop;
1355
+ }
1356
+ } else if (c > maxNonEscaped) {
1357
+ escCode = CharacterEscapes.ESCAPE_STANDARD;
1358
+ break escape_loop;
1359
+ } else {
1360
+ if ((_currentEscape = customEscapes.getEscapeSequence(c)) != null) {
1361
+ escCode = CharacterEscapes.ESCAPE_CUSTOM;
1362
+ break escape_loop;
1363
+ }
1364
+ }
1365
+ if (++_outputTail >= end) {
1366
+ break output_loop;
1367
+ }
1368
+ }
1369
+ int flushLen = (_outputTail - _outputHead);
1370
+ if (flushLen > 0) {
1371
+ _writer.write(_outputBuffer, _outputHead, flushLen);
1372
+ }
1373
+ ++_outputTail;
1374
+ _prependOrWriteCharacterEscape(c, escCode);
1375
+ }
1376
+ }
1377
+
1378
+ private final void _writeSegmentCustom(int end)
1379
+ throws IOException, JsonGenerationException
1380
+ {
1381
+ final int[] escCodes = _outputEscapes;
1382
+ final int maxNonEscaped = (_maximumNonEscapedChar < 1) ? 0xFFFF : _maximumNonEscapedChar;
1383
+ final int escLimit = Math.min(escCodes.length, _maximumNonEscapedChar+1);
1384
+ final CharacterEscapes customEscapes = _characterEscapes;
1385
+
1386
+ int ptr = 0;
1387
+ int escCode = 0;
1388
+ int start = ptr;
1389
+
1390
+ output_loop:
1391
+ while (ptr < end) {
1392
+ // Fast loop for chars not needing escaping
1393
+ char c;
1394
+ while (true) {
1395
+ c = _outputBuffer[ptr];
1396
+ if (c < escLimit) {
1397
+ escCode = escCodes[c];
1398
+ if (escCode != 0) {
1399
+ break;
1400
+ }
1401
+ } else if (c > maxNonEscaped) {
1402
+ escCode = CharacterEscapes.ESCAPE_STANDARD;
1403
+ break;
1404
+ } else {
1405
+ if ((_currentEscape = customEscapes.getEscapeSequence(c)) != null) {
1406
+ escCode = CharacterEscapes.ESCAPE_CUSTOM;
1407
+ break;
1408
+ }
1409
+ }
1410
+ if (++ptr >= end) {
1411
+ break;
1412
+ }
1413
+ }
1414
+ int flushLen = (ptr - start);
1415
+ if (flushLen > 0) {
1416
+ _writer.write(_outputBuffer, start, flushLen);
1417
+ if (ptr >= end) {
1418
+ break output_loop;
1419
+ }
1420
+ }
1421
+ ++ptr;
1422
+ start = _prependOrWriteCharacterEscape(_outputBuffer, ptr, end, c, escCode);
1423
+ }
1424
+ }
1425
+
1426
+ private final void _writeStringCustom(char[] text, int offset, int len)
1427
+ throws IOException, JsonGenerationException
1428
+ {
1429
+ len += offset; // -> len marks the end from now on
1430
+ final int[] escCodes = _outputEscapes;
1431
+ final int maxNonEscaped = (_maximumNonEscapedChar < 1) ? 0xFFFF : _maximumNonEscapedChar;
1432
+ final int escLimit = Math.min(escCodes.length, maxNonEscaped+1);
1433
+ final CharacterEscapes customEscapes = _characterEscapes;
1434
+
1435
+ int escCode = 0;
1436
+
1437
+ while (offset < len) {
1438
+ int start = offset;
1439
+ char c;
1440
+
1441
+ while (true) {
1442
+ c = text[offset];
1443
+ if (c < escLimit) {
1444
+ escCode = escCodes[c];
1445
+ if (escCode != 0) {
1446
+ break;
1447
+ }
1448
+ } else if (c > maxNonEscaped) {
1449
+ escCode = CharacterEscapes.ESCAPE_STANDARD;
1450
+ break;
1451
+ } else {
1452
+ if ((_currentEscape = customEscapes.getEscapeSequence(c)) != null) {
1453
+ escCode = CharacterEscapes.ESCAPE_CUSTOM;
1454
+ break;
1455
+ }
1456
+ }
1457
+ if (++offset >= len) {
1458
+ break;
1459
+ }
1460
+ }
1461
+
1462
+ // Short span? Better just copy it to buffer first:
1463
+ int newAmount = offset - start;
1464
+ if (newAmount < SHORT_WRITE) {
1465
+ // Note: let's reserve room for escaped char (up to 6 chars)
1466
+ if ((_outputTail + newAmount) > _outputEnd) {
1467
+ _flushBuffer();
1468
+ }
1469
+ if (newAmount > 0) {
1470
+ System.arraycopy(text, start, _outputBuffer, _outputTail, newAmount);
1471
+ _outputTail += newAmount;
1472
+ }
1473
+ } else { // Nope: better just write through
1474
+ _flushBuffer();
1475
+ _writer.write(text, start, newAmount);
1476
+ }
1477
+ // Was this the end?
1478
+ if (offset >= len) { // yup
1479
+ break;
1480
+ }
1481
+ // Nope, need to escape the char.
1482
+ ++offset;
1483
+ _appendCharacterEscape(c, escCode);
1484
+ }
1485
+ }
1486
+
1487
+ /*
1488
+ /**********************************************************
1489
+ /* Internal methods, low-level writing; binary
1490
+ /**********************************************************
1491
+ */
1492
+
1493
+ protected void _writeBinary(Base64Variant b64variant, byte[] input, int inputPtr, final int inputEnd)
1494
+ throws IOException, JsonGenerationException
1495
+ {
1496
+ // Encoding is by chunks of 3 input, 4 output chars, so:
1497
+ int safeInputEnd = inputEnd - 3;
1498
+ // Let's also reserve room for possible (and quoted) lf char each round
1499
+ int safeOutputEnd = _outputEnd - 6;
1500
+ int chunksBeforeLF = b64variant.getMaxLineLength() >> 2;
1501
+
1502
+ // Ok, first we loop through all full triplets of data:
1503
+ while (inputPtr <= safeInputEnd) {
1504
+ if (_outputTail > safeOutputEnd) { // need to flush
1505
+ _flushBuffer();
1506
+ }
1507
+ // First, mash 3 bytes into lsb of 32-bit int
1508
+ int b24 = ((int) input[inputPtr++]) << 8;
1509
+ b24 |= ((int) input[inputPtr++]) & 0xFF;
1510
+ b24 = (b24 << 8) | (((int) input[inputPtr++]) & 0xFF);
1511
+ _outputTail = b64variant.encodeBase64Chunk(b24, _outputBuffer, _outputTail);
1512
+ if (--chunksBeforeLF <= 0) {
1513
+ // note: must quote in JSON value
1514
+ _outputBuffer[_outputTail++] = '\\';
1515
+ _outputBuffer[_outputTail++] = 'n';
1516
+ chunksBeforeLF = b64variant.getMaxLineLength() >> 2;
1517
+ }
1518
+ }
1519
+
1520
+ // And then we may have 1 or 2 leftover bytes to encode
1521
+ int inputLeft = inputEnd - inputPtr; // 0, 1 or 2
1522
+ if (inputLeft > 0) { // yes, but do we have room for output?
1523
+ if (_outputTail > safeOutputEnd) { // don't really need 6 bytes but...
1524
+ _flushBuffer();
1525
+ }
1526
+ int b24 = ((int) input[inputPtr++]) << 16;
1527
+ if (inputLeft == 2) {
1528
+ b24 |= (((int) input[inputPtr++]) & 0xFF) << 8;
1529
+ }
1530
+ _outputTail = b64variant.encodeBase64Partial(b24, inputLeft, _outputBuffer, _outputTail);
1531
+ }
1532
+ }
1533
+
1534
+ /*
1535
+ /**********************************************************
1536
+ /* Internal methods, low-level writing, other
1537
+ /**********************************************************
1538
+ */
1539
+
1540
+ private final void _writeNull() throws IOException
1541
+ {
1542
+ if ((_outputTail + 4) >= _outputEnd) {
1543
+ _flushBuffer();
1544
+ }
1545
+ int ptr = _outputTail;
1546
+ char[] buf = _outputBuffer;
1547
+ buf[ptr] = 'n';
1548
+ buf[++ptr] = 'u';
1549
+ buf[++ptr] = 'l';
1550
+ buf[++ptr] = 'l';
1551
+ _outputTail = ptr+1;
1552
+ }
1553
+
1554
+ /*
1555
+ /**********************************************************
1556
+ /* Internal methods, low-level writing, escapes
1557
+ /**********************************************************
1558
+ */
1559
+
1560
+ /**
1561
+ * Method called to try to either prepend character escape at front of
1562
+ * given buffer; or if not possible, to write it out directly.
1563
+ * Uses head and tail pointers (and updates as necessary)
1564
+ */
1565
+ private final void _prependOrWriteCharacterEscape(char ch, int escCode)
1566
+ throws IOException, JsonGenerationException
1567
+ {
1568
+ if (escCode >= 0) { // \\N (2 char)
1569
+ if (_outputTail >= 2) { // fits, just prepend
1570
+ int ptr = _outputTail - 2;
1571
+ _outputHead = ptr;
1572
+ _outputBuffer[ptr++] = '\\';
1573
+ _outputBuffer[ptr] = (char) escCode;
1574
+ return;
1575
+ }
1576
+ // won't fit, write
1577
+ char[] buf = _entityBuffer;
1578
+ if (buf == null) {
1579
+ buf = _allocateEntityBuffer();
1580
+ }
1581
+ _outputHead = _outputTail;
1582
+ buf[1] = (char) escCode;
1583
+ _writer.write(buf, 0, 2);
1584
+ return;
1585
+ }
1586
+ if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX
1587
+ if (_outputTail >= 6) { // fits, prepend to buffer
1588
+ char[] buf = _outputBuffer;
1589
+ int ptr = _outputTail - 6;
1590
+ _outputHead = ptr;
1591
+ buf[ptr] = '\\';
1592
+ buf[++ptr] = 'u';
1593
+ // We know it's a control char, so only the last 2 chars are non-0
1594
+ if (ch > 0xFF) { // beyond 8 bytes
1595
+ int hi = (ch >> 8) & 0xFF;
1596
+ buf[++ptr] = HEX_CHARS[hi >> 4];
1597
+ buf[++ptr] = HEX_CHARS[hi & 0xF];
1598
+ ch &= 0xFF;
1599
+ } else {
1600
+ buf[++ptr] = '0';
1601
+ buf[++ptr] = '0';
1602
+ }
1603
+ buf[++ptr] = HEX_CHARS[ch >> 4];
1604
+ buf[++ptr] = HEX_CHARS[ch & 0xF];
1605
+ return;
1606
+ }
1607
+ // won't fit, flush and write
1608
+ char[] buf = _entityBuffer;
1609
+ if (buf == null) {
1610
+ buf = _allocateEntityBuffer();
1611
+ }
1612
+ _outputHead = _outputTail;
1613
+ if (ch > 0xFF) { // beyond 8 bytes
1614
+ int hi = (ch >> 8) & 0xFF;
1615
+ int lo = ch & 0xFF;
1616
+ buf[10] = HEX_CHARS[hi >> 4];
1617
+ buf[11] = HEX_CHARS[hi & 0xF];
1618
+ buf[12] = HEX_CHARS[lo >> 4];
1619
+ buf[13] = HEX_CHARS[lo & 0xF];
1620
+ _writer.write(buf, 8, 6);
1621
+ } else { // We know it's a control char, so only the last 2 chars are non-0
1622
+ buf[6] = HEX_CHARS[ch >> 4];
1623
+ buf[7] = HEX_CHARS[ch & 0xF];
1624
+ _writer.write(buf, 2, 6);
1625
+ }
1626
+ return;
1627
+ }
1628
+ String escape;
1629
+
1630
+ if (_currentEscape == null) {
1631
+ escape = _characterEscapes.getEscapeSequence(ch).getValue();
1632
+ } else {
1633
+ escape = _currentEscape.getValue();
1634
+ _currentEscape = null;
1635
+ }
1636
+ int len = escape.length();
1637
+ if (_outputTail >= len) { // fits in, prepend
1638
+ int ptr = _outputTail - len;
1639
+ _outputHead = ptr;
1640
+ escape.getChars(0, len, _outputBuffer, ptr);
1641
+ return;
1642
+ }
1643
+ // won't fit, write separately
1644
+ _outputHead = _outputTail;
1645
+ _writer.write(escape);
1646
+ }
1647
+
1648
+ /**
1649
+ * Method called to try to either prepend character escape at front of
1650
+ * given buffer; or if not possible, to write it out directly.
1651
+ *
1652
+ * @return Pointer to start of prepended entity (if prepended); or 'ptr'
1653
+ * if not.
1654
+ */
1655
+ private final int _prependOrWriteCharacterEscape(char[] buffer, int ptr, int end,
1656
+ char ch, int escCode)
1657
+ throws IOException, JsonGenerationException
1658
+ {
1659
+ if (escCode >= 0) { // \\N (2 char)
1660
+ if (ptr > 1 && ptr < end) { // fits, just prepend
1661
+ ptr -= 2;
1662
+ buffer[ptr] = '\\';
1663
+ buffer[ptr+1] = (char) escCode;
1664
+ } else { // won't fit, write
1665
+ char[] ent = _entityBuffer;
1666
+ if (ent == null) {
1667
+ ent = _allocateEntityBuffer();
1668
+ }
1669
+ ent[1] = (char) escCode;
1670
+ _writer.write(ent, 0, 2);
1671
+ }
1672
+ return ptr;
1673
+ }
1674
+ if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX
1675
+ if (ptr > 5 && ptr < end) { // fits, prepend to buffer
1676
+ ptr -= 6;
1677
+ buffer[ptr++] = '\\';
1678
+ buffer[ptr++] = 'u';
1679
+ // We know it's a control char, so only the last 2 chars are non-0
1680
+ if (ch > 0xFF) { // beyond 8 bytes
1681
+ int hi = (ch >> 8) & 0xFF;
1682
+ buffer[ptr++] = HEX_CHARS[hi >> 4];
1683
+ buffer[ptr++] = HEX_CHARS[hi & 0xF];
1684
+ ch &= 0xFF;
1685
+ } else {
1686
+ buffer[ptr++] = '0';
1687
+ buffer[ptr++] = '0';
1688
+ }
1689
+ buffer[ptr++] = HEX_CHARS[ch >> 4];
1690
+ buffer[ptr] = HEX_CHARS[ch & 0xF];
1691
+ ptr -= 5;
1692
+ } else {
1693
+ // won't fit, flush and write
1694
+ char[] ent = _entityBuffer;
1695
+ if (ent == null) {
1696
+ ent = _allocateEntityBuffer();
1697
+ }
1698
+ _outputHead = _outputTail;
1699
+ if (ch > 0xFF) { // beyond 8 bytes
1700
+ int hi = (ch >> 8) & 0xFF;
1701
+ int lo = ch & 0xFF;
1702
+ ent[10] = HEX_CHARS[hi >> 4];
1703
+ ent[11] = HEX_CHARS[hi & 0xF];
1704
+ ent[12] = HEX_CHARS[lo >> 4];
1705
+ ent[13] = HEX_CHARS[lo & 0xF];
1706
+ _writer.write(ent, 8, 6);
1707
+ } else { // We know it's a control char, so only the last 2 chars are non-0
1708
+ ent[6] = HEX_CHARS[ch >> 4];
1709
+ ent[7] = HEX_CHARS[ch & 0xF];
1710
+ _writer.write(ent, 2, 6);
1711
+ }
1712
+ }
1713
+ return ptr;
1714
+ }
1715
+ String escape;
1716
+ if (_currentEscape == null) {
1717
+ escape = _characterEscapes.getEscapeSequence(ch).getValue();
1718
+ } else {
1719
+ escape = _currentEscape.getValue();
1720
+ _currentEscape = null;
1721
+ }
1722
+ int len = escape.length();
1723
+ if (ptr >= len && ptr < end) { // fits in, prepend
1724
+ ptr -= len;
1725
+ escape.getChars(0, len, buffer, ptr);
1726
+ } else { // won't fit, write separately
1727
+ _writer.write(escape);
1728
+ }
1729
+ return ptr;
1730
+ }
1731
+
1732
+ /**
1733
+ * Method called to append escape sequence for given character, at the
1734
+ * end of standard output buffer; or if not possible, write out directly.
1735
+ */
1736
+ private final void _appendCharacterEscape(char ch, int escCode)
1737
+ throws IOException, JsonGenerationException
1738
+ {
1739
+ if (escCode >= 0) { // \\N (2 char)
1740
+ if ((_outputTail + 2) > _outputEnd) {
1741
+ _flushBuffer();
1742
+ }
1743
+ _outputBuffer[_outputTail++] = '\\';
1744
+ _outputBuffer[_outputTail++] = (char) escCode;
1745
+ return;
1746
+ }
1747
+ if (escCode != CharacterEscapes.ESCAPE_CUSTOM) { // std, \\uXXXX
1748
+ if ((_outputTail + 2) > _outputEnd) {
1749
+ _flushBuffer();
1750
+ }
1751
+ int ptr = _outputTail;
1752
+ char[] buf = _outputBuffer;
1753
+ buf[ptr++] = '\\';
1754
+ buf[ptr++] = 'u';
1755
+ // We know it's a control char, so only the last 2 chars are non-0
1756
+ if (ch > 0xFF) { // beyond 8 bytes
1757
+ int hi = (ch >> 8) & 0xFF;
1758
+ buf[ptr++] = HEX_CHARS[hi >> 4];
1759
+ buf[ptr++] = HEX_CHARS[hi & 0xF];
1760
+ ch &= 0xFF;
1761
+ } else {
1762
+ buf[ptr++] = '0';
1763
+ buf[ptr++] = '0';
1764
+ }
1765
+ buf[ptr++] = HEX_CHARS[ch >> 4];
1766
+ buf[ptr] = HEX_CHARS[ch & 0xF];
1767
+ _outputTail = ptr;
1768
+ return;
1769
+ }
1770
+ String escape;
1771
+ if (_currentEscape == null) {
1772
+ escape = _characterEscapes.getEscapeSequence(ch).getValue();
1773
+ } else {
1774
+ escape = _currentEscape.getValue();
1775
+ _currentEscape = null;
1776
+ }
1777
+ int len = escape.length();
1778
+ if ((_outputTail + len) > _outputEnd) {
1779
+ _flushBuffer();
1780
+ if (len > _outputEnd) { // very very long escape; unlikely but theoretically possible
1781
+ _writer.write(escape);
1782
+ return;
1783
+ }
1784
+ }
1785
+ escape.getChars(0, len, _outputBuffer, _outputTail);
1786
+ _outputTail += len;
1787
+ }
1788
+
1789
+ private char[] _allocateEntityBuffer()
1790
+ {
1791
+ char[] buf = new char[14];
1792
+ // first 2 chars, non-numeric escapes (like \n)
1793
+ buf[0] = '\\';
1794
+ // next 6; 8-bit escapes (control chars mostly)
1795
+ buf[2] = '\\';
1796
+ buf[3] = 'u';
1797
+ buf[4] = '0';
1798
+ buf[5] = '0';
1799
+ // last 6, beyond 8 bits
1800
+ buf[8] = '\\';
1801
+ buf[9] = 'u';
1802
+ _entityBuffer = buf;
1803
+ return buf;
1804
+ }
1805
+
1806
+ protected final void _flushBuffer() throws IOException
1807
+ {
1808
+ int len = _outputTail - _outputHead;
1809
+ if (len > 0) {
1810
+ int offset = _outputHead;
1811
+ _outputTail = _outputHead = 0;
1812
+ _writer.write(_outputBuffer, offset, len);
1813
+ }
1814
+ }
1815
+ }