Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAnnotatedElementProvider to Access to ArgSpec/OptionSpec setter/getter field/method #2328

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pvlasov
Copy link

@pvlasov pvlasov commented Jul 29, 2024

This pull request introduces IAnnotatedElementProvider interface implemented by FieldBinding and MethodBinding.
This allows to access underlying fields/methods of parameters and options.

See also issue #2325.

Nasdanika CLI operates on top of picocli.
One of its features is generation of HTML documentation site and support
of extended documentation
(https://docs.nasdanika.org/core/cli/index.html#extended-documentation)

Currently this functionality works with CommandSpec by accessing user
object. To extend it to arguments and options it is necessary to be able
to access underlying fields/methods.

This commit introduces IReflector interface implemented by FieldBinding
and Method Binding.
Copy link
Owner

@remkop remkop left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
I put some comments. Can you take a look?


/**
* Provides access to the underlying {@link AnnotatedElement}.
*/
Copy link
Owner

Choose a reason for hiding this comment

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

Can you add a @since 4.8.0 javadoc tag here please?

}

@Test
public void testFieldAccess() throws Exception {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you also add a test for annotated method access?

Copy link
Author

Choose a reason for hiding this comment

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

All done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants