slachiewicz opened a new pull request, #1125: URL: https://github.com/apache/maven-doxia/pull/1125
A parser that needs the project properties, directories or its own options injects Maven components today, which ties it to Maven's mojo execution scope (apache/maven-doxia-sitetools#736). This adds `ParserContext`, an immutable description of the document and its surroundings made of JDK types only, and `Parser.parse(ParserContext, Reader, Sink)`, a default method that passes the reference on to `parse(Reader, Sink, String)`. The following points are not visible in the diff: - The context is the first parameter. Calls such as `parse(source, sink, null)` in `AbstractParser` and `AptParser` would be ambiguous with a context as third parameter. - `ParserContext` is a final class with a builder, so getters can be added later without breaking implementers. `toBuilder()` is for a parser that delegates with a changed reference, as `MarkdownParser` does. - `Doxia.parse(...)` is unchanged. A caller that has a context calls the parser it looked up. - A parser that overrides the new method needs this Doxia version at run time. With an older `doxia-core`, reflection on the parser class fails with `NoClassDefFoundError: ParserContext`; I checked that with plain JDK reflection, not under Sisu. - The Javadoc says `@since 2.3.0`, while the POM is still at 2.2.1-SNAPSHOT. The Sitetools change that fills the context follows once this is available as a snapshot. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [x] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [x] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
