dnault / therapi-runtime-javadoc

Read Javadoc comments at run time.
Apache License 2.0
117 stars 19 forks source link

Comment visitor pattern #48

Closed kirkch closed 3 years ago

kirkch commented 3 years ago

This PR adds the plumbing for the visitor pattern across Comment and CommentElements. It offers two implementations of the callback interface and replaces the internals of the existing CommentFormatter to use one of the new callbacks.

Because this PR adds more classes around comments, I made the call to move the comment classes and support classes into their own package. This might not be popular, so I placed the package move into its own commit; which will make it easier to drop out of the PR.

Resolves #47.

dnault commented 3 years ago

Hi Chris, thanks for this. I'd like to suggest renaming CommentVisitorCallback to CommentVisitor or CommentElementVisitor, would that be okay?

I have to admit I'm lukewarm on moving the comments to a separate package... I'd like to leave them where they are initially (at least until I can get a better feel for it).

kirkch commented 3 years ago

No problem at all. It is getting late here, so I will take a look at this in the morrow.

kirkch commented 3 years ago

Hi Chris, thanks for this. I'd like to suggest renaming CommentVisitorCallback to CommentVisitor or CommentElementVisitor, would that be okay?

I have to admit I'm lukewarm on moving the comments to a separate package... I'd like to leave them where they are initially (at least until I can get a better feel for it).

Done. Apologies for the delay.