feat: Allow direct rendering of Visitable
objects.
#554
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes the
org.neo4j.cypherdsl.core.renderer.Renderer#render
method to accept anyVisitable
so that an intermediate representation can be retrieved.Reluctant use is suggested, as the intermediate representation won't be cached in the renderer.
In addition, an overload of
toString
has been added to manyVisitable
types. While I would liked to have added this to theVisitable
interface as suggested by @lukaseder, this is not possible as specified in the JLS 9.4.1.2. "Requirements in Overriding" (https://docs.oracle.com/javase/specs/jls/se17/html/jls-9.html#jls-9.4.1.2) (more background here https://mail.openjdk.org/pipermail/lambda-dev/2013-March/008435.html)Closes #552.