├── .github
└── workflows
│ └── maven.yml
├── .gitignore
├── .jenkins
└── settings.xml
├── KEYS
├── LICENSE
├── NOTICE
├── getrelease.sh
├── johnzon-core
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── johnzon
│ │ │ └── core
│ │ │ ├── AbstractJsonFactory.java
│ │ │ ├── BufferStrategy.java
│ │ │ ├── BufferStrategyFactory.java
│ │ │ ├── Buffered.java
│ │ │ ├── CommentsJsonStreamParserImpl.java
│ │ │ ├── DiffBase.java
│ │ │ ├── Experimental.java
│ │ │ ├── HStack.java
│ │ │ ├── JohnzonJsonParser.java
│ │ │ ├── JohnzonJsonParserImpl.java
│ │ │ ├── JsonArrayBuilderImpl.java
│ │ │ ├── JsonArrayImpl.java
│ │ │ ├── JsonBuilderFactoryImpl.java
│ │ │ ├── JsonChars.java
│ │ │ ├── JsonDoubleImpl.java
│ │ │ ├── JsonGeneratorFactoryImpl.java
│ │ │ ├── JsonGeneratorImpl.java
│ │ │ ├── JsonInMemoryParser.java
│ │ │ ├── JsonLocationImpl.java
│ │ │ ├── JsonLongImpl.java
│ │ │ ├── JsonMergePatchDiff.java
│ │ │ ├── JsonMergePatchImpl.java
│ │ │ ├── JsonNumberImpl.java
│ │ │ ├── JsonObjectBuilderImpl.java
│ │ │ ├── JsonObjectImpl.java
│ │ │ ├── JsonParserFactoryImpl.java
│ │ │ ├── JsonPatchBuilderImpl.java
│ │ │ ├── JsonPatchDiff.java
│ │ │ ├── JsonPatchImpl.java
│ │ │ ├── JsonPointerImpl.java
│ │ │ ├── JsonPointerUtil.java
│ │ │ ├── JsonProviderImpl.java
│ │ │ ├── JsonReaderFactoryImpl.java
│ │ │ ├── JsonReaderImpl.java
│ │ │ ├── JsonStreamParserImpl.java
│ │ │ ├── JsonStringImpl.java
│ │ │ ├── JsonWriterFactoryImpl.java
│ │ │ ├── JsonWriterImpl.java
│ │ │ ├── RFC4627AwareInputStreamReader.java
│ │ │ ├── RejectDuplicateKeysMode.java
│ │ │ ├── SerializableValue.java
│ │ │ ├── SimpleStack.java
│ │ │ ├── Snippet.java
│ │ │ ├── Strings.java
│ │ │ ├── ThreadLocalBufferCache.java
│ │ │ ├── Types.java
│ │ │ ├── io
│ │ │ └── BoundedOutputStreamWriter.java
│ │ │ └── util
│ │ │ ├── ArrayUtil.java
│ │ │ └── ClassUtil.java
│ └── resources
│ │ └── META-INF
│ │ └── services
│ │ └── jakarta.json.spi.JsonProvider
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── core
│ │ ├── BrokenDefaultTest.java
│ │ ├── BufferStrategyFactoryTest.java
│ │ ├── HStackTest.java
│ │ ├── JsonArrayBuilderImplTest.java
│ │ ├── JsonArrayImplTest.java
│ │ ├── JsonBuilderFactoryTest.java
│ │ ├── JsonCollectorTest.java
│ │ ├── JsonGeneratorFactoryImplTest.java
│ │ ├── JsonGeneratorImplTest.java
│ │ ├── JsonInMemoryParserTest.java
│ │ ├── JsonMergeBatchDiffTest.java
│ │ ├── JsonMergeBatchTest.java
│ │ ├── JsonNumberTest.java
│ │ ├── JsonObjectBuilderImplTest.java
│ │ ├── JsonObjectImplTest.java
│ │ ├── JsonParserStreamingTest.java
│ │ ├── JsonParserTest.java
│ │ ├── JsonPatchBuilderTest.java
│ │ ├── JsonPatchDiffTest.java
│ │ ├── JsonPatchTest.java
│ │ ├── JsonPointerTest.java
│ │ ├── JsonPointerUtilTest.java
│ │ ├── JsonProviderTest.java
│ │ ├── JsonReaderImplTest.java
│ │ ├── JsonStreamParserImplTest.java
│ │ ├── JsonWriterImplTest.java
│ │ ├── LocationTest.java
│ │ ├── OverflowTest.java
│ │ ├── SerializationTest.java
│ │ ├── SnippetTest.java
│ │ ├── StrictJsonPointerFactoryTest.java
│ │ ├── TypesTest.java
│ │ └── io
│ │ └── BoundedOutputStreamWriterTest.java
│ └── resources
│ ├── bench
│ ├── big_600kb.json
│ ├── huge_1mb.json
│ ├── large_130kb.json
│ ├── medium_11kb.json
│ ├── small_3kb.json
│ ├── tiny_50b.json
│ ├── unicode_chars_1400kb.txt
│ └── unicode_chars_170kb.txt
│ └── json
│ ├── array.json
│ ├── bigdecimal.json
│ ├── comments.json
│ ├── empty.json
│ ├── emptyarray.json
│ ├── escaping.json
│ ├── fails
│ ├── fail1.json
│ ├── fail10.json
│ ├── fail11.json
│ ├── fail12.json
│ ├── fail13.json
│ ├── fail14.json
│ ├── fail15.json
│ ├── fail16.json
│ ├── fail17.json
│ ├── fail18.json
│ ├── fail19.json
│ ├── fail2.json
│ ├── fail20.json
│ ├── fail21.json
│ ├── fail22.json
│ ├── fail23.json
│ ├── fail24.json
│ ├── fail25.json
│ ├── fail26.json
│ ├── fail27.json
│ ├── fail28.json
│ ├── fail29.json
│ ├── fail3.json
│ ├── fail30.json
│ ├── fail31.json
│ ├── fail32.json
│ ├── fail33.json
│ ├── fail34.json
│ ├── fail35.json
│ ├── fail36.json
│ ├── fail37.json
│ ├── fail38.json
│ ├── fail39.json
│ ├── fail4.json
│ ├── fail40.json
│ ├── fail41.json
│ ├── fail42.json
│ ├── fail43.json
│ ├── fail44.json
│ ├── fail45.json
│ ├── fail46.json
│ ├── fail47.json
│ ├── fail48.json
│ ├── fail49.json
│ ├── fail5.json
│ ├── fail50.json
│ ├── fail51.json
│ ├── fail52.json
│ ├── fail53.json
│ ├── fail54.json
│ ├── fail55.json
│ ├── fail56.json
│ ├── fail57.json
│ ├── fail58.json
│ ├── fail59.json
│ ├── fail6.json
│ ├── fail60.json
│ ├── fail61.json
│ ├── fail62.json
│ ├── fail63.json
│ ├── fail64.json
│ ├── fail65.json
│ ├── fail66.json
│ ├── fail67.json
│ ├── fail68.json
│ ├── fail69.json
│ ├── fail7.json
│ ├── fail70.json
│ ├── fail71.json
│ ├── fail72.json
│ ├── fail8.json
│ ├── fail9.json
│ └── numbers.json
│ ├── jsonPointerTest.json
│ ├── nested.json
│ ├── numbers.json
│ ├── simple.json
│ ├── simple2.json
│ ├── simple_utf16le.json
│ ├── special.json
│ ├── stringescape.json
│ └── unicode.json
├── johnzon-distribution
├── pom.xml
└── src
│ └── assembly
│ ├── bin.xml
│ └── src.xml
├── johnzon-jaxrs
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── jaxrs
│ │ ├── ConfigurableJohnzonProvider.java
│ │ ├── DelegateProvider.java
│ │ ├── IgnorableTypes.java
│ │ ├── JohnzonMessageBodyReader.java
│ │ ├── JohnzonMessageBodyWriter.java
│ │ ├── JohnzonProvider.java
│ │ ├── JsrMessageBodyReader.java
│ │ ├── JsrMessageBodyWriter.java
│ │ ├── JsrProvider.java
│ │ ├── NoContentExceptionHandlerReader.java
│ │ ├── WadlDocumentMessageBodyWriter.java
│ │ ├── WildcardConfigurableJohnzonProvider.java
│ │ ├── WildcardJohnzonProvider.java
│ │ ├── WildcardJsrProvider.java
│ │ └── xml
│ │ └── WadlDocumentToJson.java
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── johnzon
│ └── jaxrs
│ ├── ConfigurableJohnzonProviderTest.java
│ ├── JohnzonProviderTest.java
│ ├── JsrProviderTest.java
│ └── xml
│ └── WadlDocumentToJsonTest.java
├── johnzon-json-extras
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── jsonb
│ │ └── extras
│ │ └── polymorphism
│ │ └── Polymorphic.java
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── johnzon
│ └── jsonb
│ └── extras
│ └── polymorphism
│ └── PolymorphicTest.java
├── johnzon-jsonb
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── johnzon
│ │ │ ├── jaxrs
│ │ │ └── jsonb
│ │ │ │ └── jaxrs
│ │ │ │ └── JsonbJaxrsProvider.java
│ │ │ └── jsonb
│ │ │ ├── DefaultPropertyVisibilityStrategy.java
│ │ │ ├── JohnzonBuilder.java
│ │ │ ├── JohnzonJsonb.java
│ │ │ ├── JohnzonProvider.java
│ │ │ ├── JsonValueParserAdapter.java
│ │ │ ├── JsonbAccessMode.java
│ │ │ ├── JsonbMappings.java
│ │ │ ├── PropertyNamingStrategyFactory.java
│ │ │ ├── adapter
│ │ │ └── JsonbEnumAdapter.java
│ │ │ ├── api
│ │ │ └── experimental
│ │ │ │ ├── JsonbExtension.java
│ │ │ │ └── PolymorphicConfig.java
│ │ │ ├── cdi
│ │ │ ├── CDIs.java
│ │ │ └── JohnzonCdiExtension.java
│ │ │ ├── converter
│ │ │ ├── JohnzonJsonbAdapter.java
│ │ │ ├── JsonbDateConverter.java
│ │ │ ├── JsonbDateConverterBase.java
│ │ │ ├── JsonbLocalDateConverter.java
│ │ │ ├── JsonbLocalDateTimeConverter.java
│ │ │ ├── JsonbLocaleParserConverterBase.java
│ │ │ ├── JsonbNumberConverter.java
│ │ │ ├── JsonbOffsetDateTimeConverter.java
│ │ │ ├── JsonbValueConverter.java
│ │ │ └── JsonbZonedDateTimeConverter.java
│ │ │ ├── extension
│ │ │ ├── JsonValueReader.java
│ │ │ └── JsonValueWriter.java
│ │ │ ├── factory
│ │ │ ├── CdiJohnzonAdapterFactory.java
│ │ │ └── SimpleJohnzonAdapterFactory.java
│ │ │ ├── order
│ │ │ └── PerHierarchyAndLexicographicalOrderFieldComparator.java
│ │ │ ├── polymorphism
│ │ │ ├── JsonbPolymorphismHandler.java
│ │ │ └── JsonbPolymorphismTypeInfo.java
│ │ │ ├── reflect
│ │ │ ├── GenericArrayTypeImpl.java
│ │ │ └── Types.java
│ │ │ ├── serializer
│ │ │ ├── JohnzonDeserializationContext.java
│ │ │ └── JohnzonSerializationContext.java
│ │ │ └── spi
│ │ │ └── JohnzonAdapterFactory.java
│ └── resources
│ │ └── META-INF
│ │ └── services
│ │ ├── jakarta.enterprise.inject.spi.Extension
│ │ └── jakarta.json.bind.spi.JsonbProvider
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── johnzon
│ │ ├── RecursivePolymorphismTest.java
│ │ ├── jaxrs
│ │ └── jsonb
│ │ │ └── jaxrs
│ │ │ └── JsonbJaxrsProviderTest.java
│ │ └── jsonb
│ │ ├── AdapterTest.java
│ │ ├── AnnotationOrderTest.java
│ │ ├── AnySupportTest.java
│ │ ├── CdiAdapterTest.java
│ │ ├── ClassConverterTest.java
│ │ ├── ConstructorVisibilityTest.java
│ │ ├── CustomParameterizedTypeTest.java
│ │ ├── DateFormatTest.java
│ │ ├── DefaultMappingTest.java
│ │ ├── DefaultPropertyVisibilityStrategyTest.java
│ │ ├── DeserializationExceptionMessagesTest.java
│ │ ├── DynamicBufferResizingTest.java
│ │ ├── EnumConverterTest.java
│ │ ├── EnumTest.java
│ │ ├── ExceptionAsserts.java
│ │ ├── FailOnUnknownPropertiesTest.java
│ │ ├── FloatTest.java
│ │ ├── GenericAdapterTest.java
│ │ ├── GenericsTest.java
│ │ ├── HidingPublicFieldTest.java
│ │ ├── HierarchySerializationTest.java
│ │ ├── IJsonTest.java
│ │ ├── InterfaceMappingTest.java
│ │ ├── JohnzonConverterInJsonbTest.java
│ │ ├── JohnzonIgnoreNestedTest.java
│ │ ├── JohnzonJsonbTest.java
│ │ ├── JohnzonProviderTest.java
│ │ ├── JsonbAdapterExceptionsTest.java
│ │ ├── JsonbAdapterTest.java
│ │ ├── JsonbBeanConstructorExceptionsTest.java
│ │ ├── JsonbBeanGetterUserExceptionsTest.java
│ │ ├── JsonbBeanSetterUserExceptionsTest.java
│ │ ├── JsonbCreatorExceptionsTest.java
│ │ ├── JsonbJsonValueTest.java
│ │ ├── JsonbReadTest.java
│ │ ├── JsonbRecordTest.java
│ │ ├── JsonbSerializerExceptionsTest.java
│ │ ├── JsonbTransientTest.java
│ │ ├── JsonbTypesTest.java
│ │ ├── JsonbVisitilityTest.java
│ │ ├── JsonbWriteTest.java
│ │ ├── NamingTest.java
│ │ ├── NillableTest.java
│ │ ├── NumberFormatTest.java
│ │ ├── ObjectSerializationTest.java
│ │ ├── OrderTest.java
│ │ ├── OverrideDefaultAdaptersTest.java
│ │ ├── ParserGeneratorMappingTest.java
│ │ ├── PolymorphicConfigTest.java
│ │ ├── PropertyNamingStrategyFactoryTest.java
│ │ ├── SerializerTest.java
│ │ ├── SerializersMapTest.java
│ │ ├── SerializersObjectWithEmbeddedListTest.java
│ │ ├── SerializersRoundTripTest.java
│ │ ├── SnippetMaxLengthTest.java
│ │ ├── TimezoneTest.java
│ │ ├── TransientTest.java
│ │ ├── api
│ │ └── experimental
│ │ │ └── JsonbExtensionTest.java
│ │ ├── jaxrs
│ │ └── JsonbJaxRsTest.java
│ │ ├── model
│ │ ├── Holder.java
│ │ ├── NillableType.java
│ │ ├── nillable
│ │ │ ├── NotNillablePropertyModel.java
│ │ │ ├── notnillable
│ │ │ │ ├── StringHolder.java
│ │ │ │ └── package-info.java
│ │ │ └── package-info.java
│ │ └── packageformat
│ │ │ ├── FormatFromClassModel.java
│ │ │ ├── FormatFromPackageModel.java
│ │ │ ├── FormatOnClassModel.java
│ │ │ └── package-info.java
│ │ ├── polymorphism
│ │ ├── JsonbPolymorphismTest.java
│ │ └── JsonbPolymorphismValidationTest.java
│ │ ├── serializer
│ │ └── DeserializationContextTest.java
│ │ ├── tck
│ │ └── JohnzonOwbCDIProvider.java
│ │ └── test
│ │ └── JsonbRule.java
│ └── resources
│ └── META-INF
│ └── services
│ └── jakarta.enterprise.inject.spi.CDIProvider
├── johnzon-jsonlogic
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── jsonlogic
│ │ ├── JohnzonJsonLogic.java
│ │ └── spi
│ │ ├── AsyncOperator.java
│ │ └── Operator.java
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── johnzon
│ └── jsonlogic
│ └── JohnzonJsonLogicTest.java
├── johnzon-jsonschema
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── jsonschema
│ │ ├── JsonSchemaValidator.java
│ │ ├── JsonSchemaValidatorFactory.java
│ │ ├── ValidationResult.java
│ │ ├── generator
│ │ ├── PojoGenerator.java
│ │ ├── Schema.java
│ │ └── SchemaProcessor.java
│ │ ├── regex
│ │ ├── JavaRegex.java
│ │ ├── JavascriptRegex.java
│ │ └── JoniRegex.java
│ │ └── spi
│ │ ├── ValidationContext.java
│ │ ├── ValidationExtension.java
│ │ └── builtin
│ │ ├── BaseNumberValidation.java
│ │ ├── BaseValidation.java
│ │ ├── ContainsValidation.java
│ │ ├── EnumValidation.java
│ │ ├── ExclusiveMaximumValidation.java
│ │ ├── ExclusiveMinimumValidation.java
│ │ ├── IntegerValidation.java
│ │ ├── ItemsValidation.java
│ │ ├── MaxItemsValidation.java
│ │ ├── MaxLengthValidation.java
│ │ ├── MaxPropertiesValidation.java
│ │ ├── MaximumValidation.java
│ │ ├── MinItemsValidation.java
│ │ ├── MinLengthValidation.java
│ │ ├── MinPropertiesValidation.java
│ │ ├── MinimumValidation.java
│ │ ├── MultipleOfValidation.java
│ │ ├── PatternValidation.java
│ │ ├── RequiredValidation.java
│ │ ├── TypeValidation.java
│ │ └── UniqueItemsValidation.java
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── jsonschema
│ │ ├── JsonSchemaValidatorTest.java
│ │ ├── generator
│ │ └── PojoGeneratorTest.java
│ │ ├── regex
│ │ └── JsRegexTest.java
│ │ └── spi
│ │ └── builtin
│ │ └── EnumValidationTest.java
│ └── resources
│ ├── ConfigMap.json
│ └── Node.json
├── johnzon-mapper
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── mapper
│ │ ├── Adapter.java
│ │ ├── Cleanable.java
│ │ ├── Converter.java
│ │ ├── DynamicMappingGenerator.java
│ │ ├── ExceptionMessages.java
│ │ ├── FactoryCreateException.java
│ │ ├── JohnzonAny.java
│ │ ├── JohnzonConverter.java
│ │ ├── JohnzonCores.java
│ │ ├── JohnzonDeduplicateObjects.java
│ │ ├── JohnzonIgnore.java
│ │ ├── JohnzonIgnoreNested.java
│ │ ├── JohnzonProperty.java
│ │ ├── JohnzonRecord.java
│ │ ├── JohnzonVirtualObject.java
│ │ ├── JohnzonVirtualObjects.java
│ │ ├── JsonObjectGenerator.java
│ │ ├── Mapper.java
│ │ ├── MapperBuilder.java
│ │ ├── MapperConfig.java
│ │ ├── MapperConverter.java
│ │ ├── MapperException.java
│ │ ├── MappingGenerator.java
│ │ ├── MappingGeneratorImpl.java
│ │ ├── MappingParser.java
│ │ ├── MappingParserImpl.java
│ │ ├── Mappings.java
│ │ ├── MissingFactoryException.java
│ │ ├── ObjectConverter.java
│ │ ├── SerializeValueFilter.java
│ │ ├── SetterMappingException.java
│ │ ├── SnippetFactory.java
│ │ ├── TypeAwareAdapter.java
│ │ ├── access
│ │ ├── AccessMode.java
│ │ ├── BaseAccessMode.java
│ │ ├── FieldAccessMode.java
│ │ ├── FieldAndMethodAccessMode.java
│ │ ├── KnownNotOpenedJavaTypesAccessMode.java
│ │ ├── Meta.java
│ │ └── MethodAccessMode.java
│ │ ├── converter
│ │ ├── BigDecimalConverter.java
│ │ ├── BigIntegerConverter.java
│ │ ├── BooleanConverter.java
│ │ ├── ByteConverter.java
│ │ ├── CachedDelegateConverter.java
│ │ ├── CharacterConverter.java
│ │ ├── ClassConverter.java
│ │ ├── DateConverter.java
│ │ ├── DateWithCopyConverter.java
│ │ ├── DoubleConverter.java
│ │ ├── EnumConverter.java
│ │ ├── FloatConverter.java
│ │ ├── IntegerConverter.java
│ │ ├── LocaleConverter.java
│ │ ├── LongConverter.java
│ │ ├── ReversedAdapter.java
│ │ ├── ShortConverter.java
│ │ ├── StringConverter.java
│ │ ├── TimestampAdapter.java
│ │ ├── URIConverter.java
│ │ ├── URLConverter.java
│ │ └── UUIDConverter.java
│ │ ├── internal
│ │ ├── AdapterKey.java
│ │ ├── ConverterAdapter.java
│ │ ├── DelegatingInputStream.java
│ │ ├── DelegatingOutputStream.java
│ │ ├── DelegatingReader.java
│ │ ├── DelegatingWriter.java
│ │ ├── JsonPointerTracker.java
│ │ └── Streams.java
│ │ ├── jsonp
│ │ └── RewindableJsonParser.java
│ │ ├── map
│ │ └── LazyConverterMap.java
│ │ ├── number
│ │ └── Validator.java
│ │ ├── reflection
│ │ ├── Converters.java
│ │ ├── Generics.java
│ │ ├── JohnzonCollectionType.java
│ │ ├── JohnzonListType.java
│ │ ├── JohnzonParameterizedType.java
│ │ └── Records.java
│ │ └── util
│ │ ├── ArrayUtil.java
│ │ ├── BeanUtil.java
│ │ ├── DateUtil.java
│ │ └── JsonProviderUtil.java
│ └── test
│ ├── java
│ └── org
│ │ ├── apache
│ │ └── johnzon
│ │ │ ├── core
│ │ │ ├── TestBufferProvider.java
│ │ │ └── TestJsonGeneratorFactory.java
│ │ │ └── mapper
│ │ │ ├── AdapterTest.java
│ │ │ ├── AdderTest.java
│ │ │ ├── AdvancedGenericsTest.java
│ │ │ ├── CircularExceptionTest.java
│ │ │ ├── CircularObjectsTest.java
│ │ │ ├── CustomEnumCodecTest.java
│ │ │ ├── DeserializationExceptionMessagesTest.java
│ │ │ ├── EnumTest.java
│ │ │ ├── ExceptionAsserts.java
│ │ │ ├── GenericsTest.java
│ │ │ ├── GetterSetterRespectTest.java
│ │ │ ├── IndirectAdapterTest.java
│ │ │ ├── JPATest.java
│ │ │ ├── JohnzonAnyMappingTest.java
│ │ │ ├── JohnzonIgnoreNestedTest.java
│ │ │ ├── JsonGeneratorCloseTest.java
│ │ │ ├── JsonpIntegrationTest.java
│ │ │ ├── LiteralTest.java
│ │ │ ├── LocaleTest.java
│ │ │ ├── MapingsKeyCacheForParameterizedTypesTest.java
│ │ │ ├── MapperAdapterExceptionsTest.java
│ │ │ ├── MapperBeanConstructorExceptionsTest.java
│ │ │ ├── MapperBeanGetterUserExceptionsTest.java
│ │ │ ├── MapperBeanSetterUserExceptionsTest.java
│ │ │ ├── MapperConfigTest.java
│ │ │ ├── MapperConverterExceptionsTest.java
│ │ │ ├── MapperEnhancedTest.java
│ │ │ ├── MapperGenericsTest.java
│ │ │ ├── MapperPerformanceTest.java
│ │ │ ├── MapperTest.java
│ │ │ ├── MapperVersionTest.java
│ │ │ ├── MetaMapperTest.java
│ │ │ ├── NoWarningTest.java
│ │ │ ├── NullTest.java
│ │ │ ├── NumberSerializationTest.java
│ │ │ ├── ObjectConverterTest.java
│ │ │ ├── ObjectConverterWithAnnotationTest.java
│ │ │ ├── ObjectSerializationTest.java
│ │ │ ├── ObjectTypeTest.java
│ │ │ ├── OverflowTest.java
│ │ │ ├── ReadPrimitiveTest.java
│ │ │ ├── RecordTest.java
│ │ │ ├── SerializeValueFilterTest.java
│ │ │ ├── StreamTest.java
│ │ │ ├── TypeSimpleNameTest.java
│ │ │ ├── access
│ │ │ └── FieldAndMethodAccessModeTest.java
│ │ │ ├── converter
│ │ │ ├── EnumConverterTest.java
│ │ │ ├── StringerTest.java
│ │ │ ├── TimestampAdapterTest.java
│ │ │ └── UUIDConverterTest.java
│ │ │ └── internal
│ │ │ ├── BeanUtilTest.java
│ │ │ └── JsonPointerTrackerTest.java
│ │ └── superbiz
│ │ ├── ExtendMappingTest.java
│ │ ├── Model.java
│ │ ├── ModelBase.java
│ │ ├── ModelSuperBase.java
│ │ ├── ModelSuperSuperBase.java
│ │ └── MultiStructureObject.java
│ └── resources
│ └── JPATest.xml
├── johnzon-maven-plugin
├── .gitattributes
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── maven
│ │ └── plugin
│ │ ├── ExampleToModelMojo.java
│ │ ├── JsonSchemaToPojoMojo.java
│ │ └── PojoToJsonSchemaMojo.java
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── maven
│ │ └── plugin
│ │ ├── ExampleToModelMojoTest.java
│ │ └── PojoToJsonSchemaMojoTest.java
│ └── resources
│ ├── SomeValue.java
│ └── SomeValue.record.java
├── johnzon-osgi
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── apache
│ └── johnzon
│ └── osgi
│ ├── Activator.java
│ ├── Config.java
│ ├── cdi
│ ├── CdiExtensionFactory.java
│ ├── RegisterCdiExtension.java
│ └── package-info.java
│ └── package-info.java
├── johnzon-websocket
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── websocket
│ │ ├── internal
│ │ ├── TypeAwareDecoder.java
│ │ ├── jsr
│ │ │ ├── FactoryLocator.java
│ │ │ ├── JsrDecoder.java
│ │ │ ├── JsrEncoder.java
│ │ │ └── package-info.java
│ │ ├── lazy
│ │ │ └── LazySupplier.java
│ │ ├── mapper
│ │ │ ├── MapperLocator.java
│ │ │ ├── MapperLocatorDelegate.java
│ │ │ └── package-info.java
│ │ └── servlet
│ │ │ └── IgnoreIfMissing.java
│ │ ├── jsonb
│ │ ├── JsonbLocator.java
│ │ ├── JsonbLocatorDelegate.java
│ │ ├── JsonbTextDecoder.java
│ │ └── JsonbTextEncoder.java
│ │ ├── jsr
│ │ ├── JsrArrayDecoder.java
│ │ ├── JsrArrayEncoder.java
│ │ ├── JsrObjectDecoder.java
│ │ ├── JsrObjectEncoder.java
│ │ ├── JsrStructureDecoder.java
│ │ ├── JsrStructureEncoder.java
│ │ └── package-info.java
│ │ └── mapper
│ │ ├── JohnzonTextDecoder.java
│ │ ├── JohnzonTextEncoder.java
│ │ └── package-info.java
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── johnzon
│ │ └── websocket
│ │ ├── JsrCodecTest.java
│ │ ├── MapperCodecTest.java
│ │ └── endpoint
│ │ ├── ClientEndpointImpl.java
│ │ ├── JsrClientEndpointImpl.java
│ │ ├── JsrServerEndpointImpl.java
│ │ ├── Message.java
│ │ ├── ServerEndpointImpl.java
│ │ └── ServerReport.java
│ └── resources
│ └── arquillian.xml
├── pom.xml
├── siteDeploy.sh
└── src
└── site
├── apt
└── privacy-policy.apt
├── markdown
├── download.md
├── index.md
└── security.md
├── resources
└── images
│ └── johnzon_logo.png
└── site.xml
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | name: Maven
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | name: Test with Java ${{ matrix.jdk }}
8 | runs-on: ubuntu-latest
9 | strategy:
10 | fail-fast: false
11 | matrix:
12 | jdk: [ '11', '17', '21', '22' ]
13 | dist: [ 'zulu' ]
14 |
15 | steps:
16 | - uses: actions/checkout@v4
17 | with:
18 | persist-credentials: false
19 |
20 | - name: Set up JDK ${{ matrix.jdk }}
21 | uses: actions/setup-java@v4
22 | with:
23 | java-version: ${{ matrix.jdk }}
24 | distribution: ${{ matrix.dist }}
25 | cache: 'maven'
26 |
27 | - name: Maven Package
28 | env:
29 | MAVEN_OPTS: -Dmaven.artifact.threads=64
30 | run: mvn -V package --no-transfer-progress
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .site-content
2 | .idea
3 | *.iml
4 | *.ipr
5 | *.iws
6 | .classpath
7 | .project
8 | .settings
9 | target
10 | .DS_Store
11 | .checkstyle
12 | *.sig
13 | *.patch
14 |
--------------------------------------------------------------------------------
/.jenkins/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Johnzon
2 | Copyright 2014-2019 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/getrelease.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # small script to download the release binaries to store in the dist area
5 | #
6 | # Usage (for default release repo):
7 | # first param is the release verion, second param is optional and a download repository.
8 | # $> ./getrelease.sh 1.1.0
9 | # or during a VOTE e.g. :
10 | # $> ./getrelease.sh 1.1.0 https://repository.apache.org/content/repositories/orgapachejohnzon-1016/
11 |
12 |
13 | mkdir -p target/dist/johnzon-$1
14 | cd target/dist/johnzon-$1
15 |
16 | if [[ -z $2 ]]; then
17 | repo_path=https://repository.apache.org/content/groups/public
18 | else
19 | repo_path=$2
20 | fi
21 |
22 | echo "Fetching artifacts from " ${repo_path}
23 | curl -O ${repo_path}/org/apache/johnzon/johnzon/${1}/johnzon-${1}-source-release.zip
24 | curl -O ${repo_path}/org/apache/johnzon/johnzon/${1}/johnzon-${1}-source-release.zip.asc
25 | curl -O ${repo_path}/org/apache/johnzon/johnzon/${1}/johnzon-${1}-source-release.zip.md5
26 | curl -O ${repo_path}/org/apache/johnzon/johnzon/${1}/johnzon-${1}-source-release.zip.sha1
27 |
28 | curl -O ${repo_path}/org/apache/johnzon/apache-johnzon/${1}/apache-johnzon-${1}-bin.zip
29 | curl -O ${repo_path}/org/apache/johnzon/apache-johnzon/${1}/apache-johnzon-${1}-bin.zip.asc
30 | curl -O ${repo_path}/org/apache/johnzon/apache-johnzon/${1}/apache-johnzon-${1}-bin.zip.md5
31 | curl -O ${repo_path}/org/apache/johnzon/apache-johnzon/${1}/apache-johnzon-${1}-bin.zip.sha1
32 |
--------------------------------------------------------------------------------
/johnzon-core/src/main/java/org/apache/johnzon/core/BufferStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.core;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * Plugable way to hold various buffers for reading and writing json
25 | */
26 | public interface BufferStrategy {
27 | BufferProvider newCharProvider(int size);
28 |
29 | interface BufferProvider extends Serializable {
30 | T newBuffer();
31 |
32 | void release(T value);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/johnzon-core/src/main/java/org/apache/johnzon/core/Buffered.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.johnzon.core;
18 |
19 | /**
20 | * A Buffered
is a source or destination of data that is buffered
21 | * before writing or reading. The bufferSize method allows all participants
22 | * in the underlying stream to align on this buffer size for optimization.
23 | *
24 | * This interface is designed in the spirit of {@code java.io.Flushable} and
25 | * {@code java.io.Closeable}
26 | *
27 | * @since 1.2.17
28 | */
29 | public interface Buffered { // https://github.com/apache/johnzon/pull/84#discussion_r860563179 for the naming ;)
30 |
31 | /**
32 | * The buffer size used by this stream while reading input or before writing
33 | * output to the underlying stream.
34 | * @return the size of the buffer
35 | */
36 | int bufferSize();
37 | }
38 |
--------------------------------------------------------------------------------
/johnzon-core/src/main/java/org/apache/johnzon/core/DiffBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.johnzon.core;
18 |
19 | import jakarta.json.JsonArray;
20 | import jakarta.json.JsonObject;
21 | import jakarta.json.JsonValue;
22 | import java.io.Serializable;
23 |
24 | /**
25 | * Commonly used methods for diffs
26 | */
27 | class DiffBase implements Serializable {
28 | protected boolean isJsonObject(JsonValue jsonValue) {
29 | return jsonValue instanceof JsonObject;
30 | }
31 |
32 | protected boolean isJsonArray(JsonValue targetValue) {
33 | return targetValue instanceof JsonArray;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/johnzon-core/src/main/java/org/apache/johnzon/core/Experimental.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.core;
20 |
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.Target;
23 |
24 | import static java.lang.annotation.ElementType.TYPE;
25 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
26 |
27 | /**
28 | * Marker for experimental API.
29 | */
30 | @Target(TYPE)
31 | @Retention(RUNTIME)
32 | public @interface Experimental {
33 | }
34 |
--------------------------------------------------------------------------------
/johnzon-core/src/main/java/org/apache/johnzon/core/SimpleStack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.core;
20 |
21 | class SimpleStack {
22 |
23 | private Element head;
24 |
25 | void push(final T element) {
26 |
27 | final Element tmp = new Element();
28 | tmp.payload = element;
29 | tmp.previous = head;
30 | head = tmp;
31 |
32 | }
33 |
34 | T pop() {
35 |
36 | final T tmp = head.payload;
37 | head = head.previous;
38 | return tmp;
39 |
40 | }
41 |
42 | T peek() {
43 | return head.payload;
44 | }
45 |
46 | boolean isEmpty() {
47 | return head == null;
48 | }
49 |
50 | private static class Element {
51 |
52 | public Element() {
53 |
54 | }
55 |
56 | private Element previous;
57 | private T payload;
58 |
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/johnzon-core/src/main/resources/META-INF/services/jakarta.json.spi.JsonProvider:
--------------------------------------------------------------------------------
1 | org.apache.johnzon.core.JsonProviderImpl
2 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/java/org/apache/johnzon/core/JsonBuilderFactoryTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.johnzon.core;
18 |
19 | import java.util.Collections;
20 |
21 | import jakarta.json.Json;
22 | import jakarta.json.JsonBuilderFactory;
23 | import jakarta.json.JsonObject;
24 |
25 | import org.junit.Assert;
26 | import org.junit.Test;
27 |
28 |
29 | public class JsonBuilderFactoryTest {
30 |
31 | @Test
32 | public void testCreateBuilderFactory() {
33 | JsonBuilderFactory factory = Json.createBuilderFactory(Collections.emptyMap());
34 | JsonObject jsonObject = factory.createObjectBuilder().
35 | add("name", "home").
36 | add("city", "Vienna")
37 | .build();
38 |
39 | //JsonObject
40 | Assert.assertEquals("home", jsonObject.getString("name"));
41 | Assert.assertEquals("Vienna", jsonObject.getString("city"));
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/bench/tiny_50b.json:
--------------------------------------------------------------------------------
1 | {
2 | "debug": "false\ttrue",
3 | "number" : 1.4E10
4 |
5 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/array.json:
--------------------------------------------------------------------------------
1 | [
2 | "a",
3 | 1,
4 | {
5 | "b": "c"
6 | },
7 | 5
8 | ]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/bigdecimal.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1.23E3,
3 | "b": 1.23E-3,
4 | "c": 1.23E+3
5 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/comments.json:
--------------------------------------------------------------------------------
1 | /* super header comment
2 | dont put the brace on another line
3 | it is part of the test */{
4 | "foo": "//bar//but//not//a/comment",
5 | // a comment
6 | // on multiple lines
7 | //even without space at the beginning;
8 | /* a long comment */
9 | "another": 5,
10 | "//object": {
11 | // another comment
12 | "sub": "fdmcd"
13 | /*
14 | super long comment
15 | */
16 | }
17 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/empty.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/emptyarray.json:
--------------------------------------------------------------------------------
1 | [
2 |
3 | ]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/escaping.json:
--------------------------------------------------------------------------------
1 | [
2 | "\"",
3 | "\\",
4 | "\/",
5 | "\b",
6 | "\f",
7 | "\n",
8 | "\r",
9 | "\t",
10 | "\u0044"
11 | ]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail1.json:
--------------------------------------------------------------------------------
1 | {,
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail10.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail11.json:
--------------------------------------------------------------------------------
1 |
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail12.json:
--------------------------------------------------------------------------------
1 | { q
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail13.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": nul,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail14.json:
--------------------------------------------------------------------------------
1 | { "x":
2 | "a": "b",
3 | "c": 4,
4 | "d"": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail15.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | true,
4 | "a": "b",
5 | "c": {
6 | "d": [
7 | 1,
8 | 2
9 | ]
10 | }
11 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail16.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": {
4 | d: [
5 | 1,
6 | 2
7 | ]
8 | }
9 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail17.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": true {
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
9 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail18.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | true
4 | "a": "b",
5 | "c": {
6 | "d": [
7 | 1,
8 | 2
9 | ]
10 | }
11 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail19.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | "a": "b",
4 | "c": {
5 | "d": [
6 | 1,
7 | 2
8 | ]
9 | }
10 | ]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail2.json:
--------------------------------------------------------------------------------
1 | {
2 | "a":: "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail20.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | "a": "b",
4 | "c": {
5 | "d": [
6 | 01,
7 | 2
8 | ]
9 | }
10 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail21.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | "a": "b",
4 | "c": {
5 | "d": [
6 | 1.24ee-20,
7 | 2
8 | ]
9 | }
10 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail22.json:
--------------------------------------------------------------------------------
1 | garbage in garbage out
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail23.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "\u6565",
3 | "c": "\u123",
4 | "d": [
5 |
6 | -2, "\u0048"
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail24.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "a",
3 | "c": \u0074\u0072\u0075\u0065
4 |
5 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail25.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "\u6565",
3 | "c": "\up000",
4 | "d": [
5 |
6 | -2, "\u0044"
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail26.json:
--------------------------------------------------------------------------------
1 | ,{
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail27.json:
--------------------------------------------------------------------------------
1 | "{
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail28.json:
--------------------------------------------------------------------------------
1 | true, {
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail29.json:
--------------------------------------------------------------------------------
1 | : {
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail3.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": , "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail30.json:
--------------------------------------------------------------------------------
1 | null{
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail31.json:
--------------------------------------------------------------------------------
1 | "string":{
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail32.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, 20e-1.2
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail33.json:
--------------------------------------------------------------------------------
1 | 14{
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail34.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, 2.0e-1.2
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail35.json:
--------------------------------------------------------------------------------
1 | , {
2 | "a": "\u6565",
3 | "d": [
4 |
5 | -2, "\u0044"
6 | ]
7 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail36.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": " "
3 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail37.json:
--------------------------------------------------------------------------------
1 | {
2 | "a
3 | ": "x"
4 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail38.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 12.2e-
3 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail39.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 12.2e
3 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail4.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",,
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail40.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "v"
3 | }
4 | some garbage
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail41.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "\vbadescape"
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail42.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": -055
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail43.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": -01.55
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail44.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": -00001.55
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail45.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": " before this word the is a u+0001 char"
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail46.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "before this is a u+00031 char"
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail47.json:
--------------------------------------------------------------------------------
1 | [1,]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail48.json:
--------------------------------------------------------------------------------
1 | [1,
2 | 2,
3 | 3,
4 | 4,
5 | 5,
6 | ]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail49.json:
--------------------------------------------------------------------------------
1 | {"a":1,}
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail5.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1 2,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail50.json:
--------------------------------------------------------------------------------
1 | {
2 | "a":1,
3 | "b":2,
4 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail51.json:
--------------------------------------------------------------------------------
1 | ["\uDFAA (missing high surrogate)"]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail52.json:
--------------------------------------------------------------------------------
1 | ["\uD888\u3210 (invalid second surrogate)"]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail53.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": 0,
3 | "0": -0,
4 | "1": 1,
5 | "-1": -1,
6 | "9": 9,
7 | "-9": -9,
8 | "10": 10,
9 | "-10", -10,
10 | "100": 100
11 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail54.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": 0,
3 | "0": -0,
4 | "1": 1,
5 | "-1": -1,
6 | "9": 9,
7 | "-9": -9,
8 | "10": 10,
9 | "-10" -10,
10 | "100": 100,
11 | "-100", -100
12 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail55.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": 0,
3 | "0": -0,
4 | "1": 1,
5 | "-1": -1,
6 | "9": 9,
7 | "-9": -9,
8 | "10": 10,
9 | -10 -10,
10 | "100": 100,
11 | "-100", -100
12 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail56.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": 0,
3 | "0": -0,
4 | "1": 1,
5 | "-1": -1,
6 | "9": 9,
7 | "-9": -9,
8 | "10": 10,
9 | "-10", "-10",
10 | "100": 100
11 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail57.json:
--------------------------------------------------------------------------------
1 | ["a":3]
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail58.json:
--------------------------------------------------------------------------------
1 | {
2 | "0":["a":3]
3 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail59.json:
--------------------------------------------------------------------------------
1 | {
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail6.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | 2
7 | ]]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail60.json:
--------------------------------------------------------------------------------
1 | [ {}, [] }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail61.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": -
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail62.json:
--------------------------------------------------------------------------------
1 | {
2 | "a":
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail63.json:
--------------------------------------------------------------------------------
1 | {
2 | "a"
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail64.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1.,
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail65.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": .5,
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail66.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1-,
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail67.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1.-,
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail68.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1.9e-1.2,
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail69.json:
--------------------------------------------------------------------------------
1 | {
2 | 12
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail7.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1..56,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail70.json:
--------------------------------------------------------------------------------
1 | {
2 | null null
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail71.json:
--------------------------------------------------------------------------------
1 | {
2 | null
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail72.json:
--------------------------------------------------------------------------------
1 | {
2 | "a","b"
3 | }
4 |
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail8.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | +1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/fail9.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d"": [
5 | 1,
6 | 2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/fails/numbers.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": 0,
3 | "0": -0,
4 | "1": 1,
5 | "-1": -1,
6 | "9": 9,
7 | "-9": -9,
8 | "10": 10,
9 | "-10", -10,
10 | "100": 100,
11 | "-100", -100,
12 | "456": 456,
13 | "-456": -456,
14 | "123.12345": 123.12345,
15 | "-123.12345": -123.12345,
16 | "999999999999999999999999999999": 999999999999999999999999999999,
17 | "-999999999999999999999999999999": -999999999999999999999999999999
18 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/jsonPointerTest.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": [
3 | "bar",
4 | "baz"
5 | ],
6 | "": 0,
7 | "a/b": 1,
8 | "c%d": 2,
9 | "e^f": 3,
10 | "g|h": 4,
11 | "i\\j": 5,
12 | "k\"l": 6,
13 | " ": 7,
14 | "m~n": 8
15 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/nested.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": {
4 | "d": [
5 | 1,
6 | 2
7 | ]
8 | }
9 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/numbers.json:
--------------------------------------------------------------------------------
1 | {
2 | "0": 0,
3 | "0": -0,
4 | "1": 1,
5 | "-1": -1,
6 | "9": 9,
7 | "-9": -9,
8 | "10": 10,
9 | "-10": -10,
10 | "100": 100,
11 | "-100": -100,
12 | "456": 456,
13 | "-456": -456,
14 | "123.12345": 123.12345,
15 | "-123.12345": -123.12345,
16 | "999999999999999999999999999999": 999999999999999999999999999999,
17 | "-999999999999999999999999999999": -999999999999999999999999999999
18 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/simple.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | -2
7 | ],
8 | "e": {
9 | "x": 1,
10 | "y": 2
11 | }
12 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/simple2.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "b",
3 | "c": 4,
4 | "d": [
5 | 1,
6 | -2
7 | ]
8 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/simple_utf16le.json:
--------------------------------------------------------------------------------
1 | {
2 | " a " : " b " ,
3 | " c " : 4 ,
4 | " d " : [
5 | 1 ,
6 | - 2
7 | ] ,
8 | " e " : {
9 | " x " : 1 ,
10 | " y " : 2
11 | }
12 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/special.json:
--------------------------------------------------------------------------------
1 | {
2 | "a{": "b,,",
3 | "c::::": ":4::,[{",
4 | "d": [
5 | 1,
6 | 2,
7 | null,
8 | false,
9 | true,
10 | 4.2
11 | ],
12 | "w":4.6676123,
13 | "r": 0.001,
14 | "1.4312":110,
15 | "\u0044":null,
16 | "\"":"\"",
17 | "থii:üäöÖ.,;.-<>!§$%&()=?ß´'`*+#": "ন:4::,[{"
18 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/stringescape.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "s\"mit\""
3 | }
--------------------------------------------------------------------------------
/johnzon-core/src/test/resources/json/unicode.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": "\u6565",
3 | "z": "",
4 | "c": "\u0000",
5 | "f": "\u0070\u0070\u0070a\u0070+++\u0070",
6 | "d": [
7 |
8 | -2, "\u0020",""
9 | ]
10 | }
--------------------------------------------------------------------------------
/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/IgnorableTypes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jaxrs;
20 |
21 | import java.util.Collection;
22 | import java.util.HashSet;
23 |
24 | public class IgnorableTypes {
25 | private final Collection ignores;
26 |
27 | protected IgnorableTypes(final Collection ignores) {
28 | this.ignores = ignores == null ? null : new HashSet(ignores);
29 | }
30 |
31 | public boolean isIgnored(final Class> type) {
32 | return ignores != null && ignores.contains(type.getName());
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jaxrs;
20 |
21 | import org.apache.johnzon.mapper.Mapper;
22 | import org.apache.johnzon.mapper.MapperBuilder;
23 |
24 | import jakarta.ws.rs.Consumes;
25 | import jakarta.ws.rs.Produces;
26 | import jakarta.ws.rs.ext.Provider;
27 | import java.util.Collection;
28 |
29 | @Provider
30 | @Produces("application/json")
31 | @Consumes("application/json")
32 | public class JohnzonProvider extends DelegateProvider {
33 | public JohnzonProvider(final Mapper mapper, final Collection ignores) {
34 | super(new JohnzonMessageBodyReader<>(mapper, ignores), new JohnzonMessageBodyWriter<>(mapper, ignores));
35 | }
36 |
37 | public JohnzonProvider() {
38 | this(new MapperBuilder().setDoCloseOnStreams(false).build(), null);
39 | }
40 |
41 | protected boolean shouldThrowNoContentExceptionOnEmptyStreams() {
42 | return Boolean.getBoolean("johnzon.jaxrs.johnzon.throwNoContentExceptionOnEmptyStreams");
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/WildcardJsrProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jaxrs;
20 |
21 | import jakarta.json.JsonStructure;
22 | import jakarta.ws.rs.Consumes;
23 | import jakarta.ws.rs.Produces;
24 |
25 | // @Provider // don't let it be scanned, it would conflict with JsrProvider
26 | @Produces({
27 | "*/json",
28 | "*/*+json", "*/x-json",
29 | "*/javascript", "*/x-javascript"
30 | })
31 | @Consumes({
32 | "*/json",
33 | "*/*+json", "*/x-json",
34 | "*/javascript", "*/x-javascript"
35 | })
36 | public class WildcardJsrProvider extends DelegateProvider {
37 | public WildcardJsrProvider() {
38 | super(new JsrMessageBodyReader(), new JsrMessageBodyWriter());
39 | }
40 |
41 | protected boolean shouldThrowNoContentExceptionOnEmptyStreams() {
42 | return Boolean.getBoolean("johnzon.jaxrs.jsr.wildcard.throwNoContentExceptionOnEmptyStreams");
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb;
20 |
21 | import jakarta.json.bind.JsonbBuilder;
22 | import jakarta.json.bind.spi.JsonbProvider;
23 |
24 | public class JohnzonProvider extends JsonbProvider {
25 | @Override
26 | public JsonbBuilder create() {
27 | return new JohnzonBuilder();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/api/experimental/JsonbExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.api.experimental;
20 |
21 | import java.lang.reflect.Type;
22 |
23 | import jakarta.json.JsonValue;
24 | import jakarta.json.stream.JsonGenerator;
25 | import jakarta.json.stream.JsonParser;
26 |
27 | public interface JsonbExtension {
28 | // https://github.com/eclipse-ee4j/jsonb-api/issues/111
29 |
30 | T fromJsonValue(JsonValue json, Class type);
31 |
32 | T fromJsonValue(JsonValue json, Type runtimeType);
33 |
34 | JsonValue toJsonValue(Object object);
35 |
36 | JsonValue toJsonValue(Object object, Type runtimeType);
37 |
38 | // https://github.com/eclipse-ee4j/jsonb-api/issues/224
39 |
40 |
41 |
42 | T fromJson(JsonParser json, Class type);
43 |
44 | T fromJson(JsonParser json, Type runtimeType);
45 |
46 | void toJson(Object object, JsonGenerator jsonGenerator);
47 |
48 | void toJson(Object object, Type runtimeType, JsonGenerator jsonGenerator);
49 | }
50 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/converter/JsonbDateConverterBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.converter;
20 |
21 | import jakarta.json.bind.annotation.JsonbDateFormat;
22 | import java.time.format.DateTimeFormatter;
23 |
24 | public abstract class JsonbDateConverterBase extends JsonbLocaleParserConverterBase {
25 | protected final DateTimeFormatter formatter;
26 |
27 | protected JsonbDateConverterBase(final JsonbDateFormat dateFormat) {
28 | final String value = dateFormat.value();
29 | final String locale = dateFormat.locale();
30 | final boolean ms = value.equals(JsonbDateFormat.TIME_IN_MILLIS);
31 | formatter = ms ? null :
32 | (!locale.equals(JsonbDateFormat.DEFAULT_LOCALE) ?
33 | DateTimeFormatter.ofPattern(value).withLocale(newLocale(locale)) : DateTimeFormatter.ofPattern(value));
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/converter/JsonbLocalDateConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.converter;
20 |
21 | import jakarta.json.bind.annotation.JsonbDateFormat;
22 | import java.time.LocalDate;
23 | import java.util.concurrent.TimeUnit;
24 |
25 | public class JsonbLocalDateConverter extends JsonbDateConverterBase {
26 | public JsonbLocalDateConverter(final JsonbDateFormat dateFormat) {
27 | super(dateFormat);
28 | }
29 |
30 | @Override
31 | public String toString(final LocalDate instance) {
32 | return formatter == null ? Long.toString(TimeUnit.DAYS.toMillis(instance.toEpochDay())) : instance.format(formatter);
33 | }
34 |
35 | @Override
36 | public LocalDate fromString(final String text) {
37 | return formatter == null ? LocalDate.ofEpochDay(TimeUnit.MILLISECONDS.toDays(Long.parseLong(text))) : LocalDate.parse(text, formatter);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/converter/JsonbLocalDateTimeConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.converter;
20 |
21 | import jakarta.json.bind.annotation.JsonbDateFormat;
22 | import java.time.Instant;
23 | import java.time.LocalDateTime;
24 | import java.time.ZoneOffset;
25 |
26 | public class JsonbLocalDateTimeConverter extends JsonbDateConverterBase {
27 | public JsonbLocalDateTimeConverter(final JsonbDateFormat dateFormat) {
28 | super(dateFormat);
29 | }
30 |
31 | @Override
32 | public String toString(final LocalDateTime instance) {
33 | return formatter == null ? Long.toString(instance.toInstant(ZoneOffset.UTC).toEpochMilli()) : instance.format(formatter);
34 | }
35 |
36 | @Override
37 | public LocalDateTime fromString(final String text) {
38 | return formatter == null ? LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(text)), ZoneOffset.UTC) : LocalDateTime.parse(text, formatter);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/converter/JsonbLocaleParserConverterBase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.converter;
20 |
21 | import org.apache.johnzon.mapper.Converter;
22 | import org.apache.johnzon.mapper.converter.LocaleConverter;
23 |
24 | import java.util.Locale;
25 |
26 | public abstract class JsonbLocaleParserConverterBase implements Converter {
27 | private final LocaleConverter delegate = new LocaleConverter();
28 |
29 | protected Locale newLocale(final String locale) {
30 | return delegate.to(locale);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/converter/JsonbOffsetDateTimeConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.converter;
20 |
21 | import jakarta.json.bind.annotation.JsonbDateFormat;
22 | import java.time.Instant;
23 | import java.time.OffsetDateTime;
24 | import java.time.ZoneId;
25 |
26 | public class JsonbOffsetDateTimeConverter extends JsonbDateConverterBase {
27 | private static final ZoneId UTC = ZoneId.of("UTC");
28 |
29 | public JsonbOffsetDateTimeConverter(final JsonbDateFormat dateFormat) {
30 | super(dateFormat);
31 | }
32 |
33 | @Override
34 | public String toString(final OffsetDateTime instance) {
35 | return formatter == null ? instance.toString() : instance.format(formatter);
36 | }
37 |
38 | @Override
39 | public OffsetDateTime fromString(final String text) {
40 | return formatter == null ? OffsetDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(text)), UTC) : OffsetDateTime.parse(text, formatter);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/converter/JsonbValueConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.johnzon.jsonb.converter;
20 |
21 | import org.apache.johnzon.mapper.Converter;
22 |
23 | // TODO?
24 | public class JsonbValueConverter implements Converter