Skip to content

feat(options): @Compact formats multi-template nested mappings#127

Merged
rawvoid merged 7 commits into
mainfrom
feat/compact-option-format
Jul 24, 2026
Merged

feat(options): @Compact formats multi-template nested mappings#127
rawvoid merged 7 commits into
mainfrom
feat/compact-option-format

Conversation

@rawvoid

@rawvoid rawvoid commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 1 + Phase 2 for compact nested list options:

  • @Compact(formats = {…}) only (no single format); templates tried in order — put more specific first.
  • Field-level @Compact on a list option overrides the element type (registered by option name).
  • Nested DTO lists use element-wise compact parsers; whole-collection name parsers (e.g. int-list2) only apply to scalar element lists.
  • ConvertName NameMapping: /{regex}/->{name} then {token}->{name}.
  • Namespace ns->package / ns->package:prefix; NsPrefix -xmlns=ns->prefix.
  • Structured multi-arg form and scheme C remain supported.

Test plan

  • mvn -pl plugins test -Dtest=AbstractPluginTest,ConvertNamePluginTest,NamespacePluginTest,NsPrefixPluginTest
  • Full module test on CI

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.
@github-actions github-actions Bot added the feature New feature label Jul 24, 2026
rawvoid added 4 commits July 24, 2026 16:38
…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.
@rawvoid rawvoid changed the title feat(options): @Compact single-line nested mapping format feat(options): @Compact formats multi-template nested mappings Jul 24, 2026
rawvoid added 2 commits July 24, 2026 16:51
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
rawvoid force-pushed the feat/compact-option-format branch from d6686f6 to 305550a Compare July 24, 2026 08:51
@sonarqubecloud

Copy link
Copy Markdown

@rawvoid
rawvoid merged commit 306e64d into main Jul 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant