feat(options): @Compact formats multi-template nested mappings#127
Merged
Conversation
Introduce type-level @compact(format) so nested mapping types get an auto-registered TextParser (e.g. {token}->{name}). Structured multi-arg form remains supported. ConvertNamePlugin.NameMapping uses the compact form; document usage and cover unit/XJC tests.
…ride Replace single format() with formats[]; try templates in order (more specific first). Allow field-level @compact on list options (option-name parser). Nested DTO lists no longer treat name-registered parsers as whole-collection parsers.
Use formats = {"/{regex}/->{name}", "{token}->{name}"} and cover compact
regex class rename in XJC tests.
NamespaceMappingConfig supports ns->package and ns->package:prefix. XmlNsConfig supports ns->prefix for -xmlns=… compact form.
Update README and develop-plugin skill for formats[], template order, field override, and convert-name/namespace/xmlns compact CLI samples.
Rename to parseRepeatedEqualsValues: the helper handles any consecutive -name=value list elements, including Compact nested DTOs, not only scalars.
Extract parseCollectionOption so retain/remove/continue is written once for whole-collection and nested/repeated equals list paths.
rawvoid
force-pushed
the
feat/compact-option-format
branch
from
July 24, 2026 08:51
d6686f6 to
305550a
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Phase 1 + Phase 2 for compact nested list options:
@Compact(formats = {…})only (no singleformat); templates tried in order — put more specific first.@Compacton a list option overrides the element type (registered by option name).int-list2) only apply to scalar element lists.NameMapping:/{regex}/->{name}then{token}->{name}.ns->package/ns->package:prefix; NsPrefix-xmlns=ns->prefix.Test plan
mvn -pl plugins test -Dtest=AbstractPluginTest,ConvertNamePluginTest,NamespacePluginTest,NsPrefixPluginTest