Skip to content

Commit

Permalink
feat: rework the Visitors
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Reichel <[email protected]>
  • Loading branch information
manticore-projects committed Feb 5, 2025
1 parent 1387986 commit d816220
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ def getVersion = { boolean considerSnapshot ->
String snapshot = ""

def versionStr = providers.exec {
commandLine "git", "--no-pager", "describe", "--tags", "--always", "--dirty=-SNAPSHOT"
commandLine "git", "--no-pager", "-C", project(':JSQLParser').projectDir, "describe", "--tags", "--always", "--dirty=-SNAPSHOT"
}.standardOutput.asText.get().trim()

println "Version String: $versionStr"

def pattern = /jsqlparser-(?<major>\d*)\.(?<minor>\d*)(\.(?<patch>\d*))?(-(?<build>\d*)-(?<commit>[a-zA-Z\d]*))?/
def pattern = /(?<major>\d*)\.(?<minor>\d*)(\.(?<patch>\d*))?(-(?<build>\d*)-(?<commit>[a-zA-Z\d]*))?/
def matcher = versionStr =~ pattern

if (matcher.find()) {
Expand Down Expand Up @@ -145,8 +143,6 @@ jar {
}

tasks.register('xmldoc', Javadoc) {
println getVersion( true )

def outFile = reporting.file(
version.endsWith("-SNAPSHOT")
? "xmlDoclet/javadoc_snapshot.xml"
Expand All @@ -166,11 +162,12 @@ tasks.register('xmldoc', Javadoc) {
// source += fileTree(layout.buildDirectory.dir("generated/jjtree/net/sf/jsqlparser/parser").get()) {
// include("**/*.java")
// }

// beware: Gradle deletes this folder automatically and there is no switch-off
destinationDir = reporting.file("xmlDoclet")
options.docletpath = configurations.xmlDoclet.files as List
options.doclet = "com.github.markusbernhardt.xmldoclet.XmlDoclet"
title = "API " + getVersion( !System.getenv("RELEASE") )
title = "API $version"
options.addBooleanOption("rst", true)
options.addBooleanOption("withFloatingToc", Boolean.parseBoolean(System.getenv().getOrDefault("FLOATING_TOC", "true")))
options.addStringOption("basePackage", "net.sf.jsqlparser")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ public <T, S> T accept(SelectVisitor<T> selectVisitor, S context) {
return selectVisitor.visit(this, context);
}

public <T, S> T accept(FromQueryVisitor<T, S> fromQueryVisitor, S context) {
return fromQueryVisitor.visit(this, context);
}

@Override
public StringBuilder appendTo(StringBuilder builder) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package net.sf.jsqlparser.statement.piped;

public interface FromQueryVisitor<T, S> {
T visit(FromQuery fromQuery, S context);
}

0 comments on commit d816220

Please sign in to comment.