Skip to content

[#1440] handle adapters in mark-generated plugin (w/ refacto)#1902

Open
laurentschoelens wants to merge 1 commit intomasterfrom
gh-1440
Open

[#1440] handle adapters in mark-generated plugin (w/ refacto)#1902
laurentschoelens wants to merge 1 commit intomasterfrom
gh-1440

Conversation

@laurentschoelens
Copy link
Copy Markdown
Contributor

@laurentschoelens laurentschoelens commented Feb 9, 2026

Fixes #1440

Also add JModule as handled by mark-generated plugin

New implementation that doesn't add extra properties on Outline / Model
Added test case too

Copy link
Copy Markdown
Member

@lukasj lukasj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, this is better, yet I see no reason, why the PackageOutline couldn't have the adapters() method to make the life for plugin authors easier - there is already objectFacory() method.

Note that PackageOutline is XJC specific model, so adapters method makes sense there, while JCodeModel is - sort of - 3rd party library and as such has no knowledge about types it generates or about their purpose, so putting the method there is wrong

@laurentschoelens
Copy link
Copy Markdown
Contributor Author

well, this is better, yet I see no reason, why the PackageOutline couldn't have the adapters() method to make the life for plugin authors easier - there is already objectFacory() method.

Note that PackageOutline is XJC specific model, so adapters method makes sense there, while JCodeModel is - sort of - 3rd party library and as such has no knowledge about types it generates or about their purpose, so putting the method there is wrong

Adding the adapters() section in PackageOutline could be done seperatly I guess ? Plugin has been reworked in order to treat each package and each class in package, whatever sort it is (enum or pure class)

@laurentschoelens
Copy link
Copy Markdown
Contributor Author

well, this is better, yet I see no reason, why the PackageOutline couldn't have the adapters() method to make the life for plugin authors easier - there is already objectFacory() method.
Note that PackageOutline is XJC specific model, so adapters method makes sense there, while JCodeModel is - sort of - 3rd party library and as such has no knowledge about types it generates or about their purpose, so putting the method there is wrong

Adding the adapters() section in PackageOutline could be done seperatly I guess ? Plugin has been reworked in order to treat each package and each class in package, whatever sort it is (enum or pure class)

Well after digging more into this, I can't find a way to access PackageOutline where the adapter is created in order to reference it in new property adapters in the PackageOutline when creating the adapter. The only thing available is the JPackage

@laurentschoelens
Copy link
Copy Markdown
Contributor Author

@lukasj : added also JModule for this plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugin xjc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mark-generated does not work on generated XmlAdapter

2 participants