Refactor encoders and normalizers, add utilities and tests, and enhance Gradle build #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR restructures the
jtoonpackage into clearer subpackages, introduces new utilities, significantly expands test coverage, and improves the Gradle build with publishing and verification. It also refactors several core components for readability, maintainability, and performance.Changes
Constantstoutil(src/main/java/com/felipestanzani/jtoon/util/Constants.java).encoderpackage:ArrayEncoder,ListItemEncoder,ObjectEncoder,PrimitiveEncoder,TabularArrayEncoder,ValueEncoder,HeaderFormatter,LineWriter(moved).normalizerpackage:JsonNormalizerand package docs.JToon.javato align with refactors.JsonNormalizer.java(old path),PrimitiveEncoder.java(old path),ValueEncoder.java(old path).package-info.javafiles forjtoon,encoder,normalizer, andutil.StringEscaperandStringValidatorunderutil.HeaderFormatterTest,JsonNormalizerTest,LineWriterTest,PrimitiveEncoderTest,StringEscaperTest,StringValidatorTest.build.gradle.gradle/publishing.gradleandgradle/verification.gradlefor publishing and verification configurations..idea/dictionaries/project.xml(note: typically excluded; see Notes).Commits
Motivation
Impact and Compatibility
com.felipestanzani.jtoon.Constants→com.felipestanzani.jtoon.util.Constantscom.felipestanzani.jtoon.encoder.*com.felipestanzani.jtoon.normalizer.*Migration Guide
Constants→com.felipestanzani.jtoon.util.Constantscom.felipestanzani.jtoon.encoder.*JsonNormalizer→com.felipestanzani.jtoon.normalizer.JsonNormalizerLineWriter, usecom.felipestanzani.jtoon.encoder.LineWriter.StringEscaperandStringValidatorfromutilwhere applicable.Testing
CI/CD and Publishing
publishing.gradleconfigures artifact publishing.verification.gradleconfigures additional verification tasks.check,test, and publishing dry-runs as needed.Documentation
package-info.javaadded across key packages to clarify responsibilities.build/docs/javadoc.Notes
.idea/dictionaries/project.xmlis added; typically IDE files are excluded via.gitignore. If undesired in VCS, I can remove it from this PR and update.gitignore.Checklist
package-info.java.idea) or remove from PRRelease Notes
com.felipestanzani.jtoon.encoder.*, normalizer tocom.felipestanzani.jtoon.normalizer.*, constants tocom.felipestanzani.jtoon.util.Constants.StringEscaperandStringValidatorutilities.