feat(jsqlparser): 首次提交
This commit is contained in:
3
.codacy.yml
Normal file
3
.codacy.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- "site/**"
|
||||
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: https://paypal.me/wumpz
|
||||
41
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: @ SQL Parser Error
|
||||
about: Create a report to help us improve
|
||||
title: '[BUG] JSQLParser Version : RDBMS : failing feature description'
|
||||
labels: 'Parser Error', 'Feature Request', 'Documentation', 'Java API', 'RDBMS support'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Note: Please search to see if an issue already exists for the bug you encountered.
|
||||
-->
|
||||
|
||||
### Failing SQL Feature:
|
||||
<!--
|
||||
- Brief description of the failing SQL feature
|
||||
- Example: `WITH ROLLUP` can't be parsed
|
||||
-->
|
||||
|
||||
### SQL Example:
|
||||
<!--
|
||||
- Simplified Query Example, focusing on the failing feature
|
||||
```sql
|
||||
-- Replace with your ACTUAL example
|
||||
select 1
|
||||
from dual
|
||||
```
|
||||
-->
|
||||
|
||||
### Software Information:
|
||||
<!--
|
||||
- JSqlParser version
|
||||
- Database (e. g. Oracle, MS SQL Server, H2, PostgreSQL, IBM DB2 )
|
||||
-->
|
||||
|
||||
### Tips:
|
||||
<!--
|
||||
Please write in English and avoid Screenshots (as we can't copy and paste content from it).
|
||||
[Try your example online with the latest JSQLParser](http://217.160.215.75:8080/jsqlformatter/demo.html) and share the link in the error report.
|
||||
Do provide Links or References to the specific Grammar and Syntax you are trying to use.
|
||||
-->
|
||||
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an unsupported Statement or Expression
|
||||
title: "[FEATURE] missing feature description"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
### Grammar or Syntax Description
|
||||
- Brief description of the failing SQL feature and the EBNF
|
||||
- Example: `WITH ROLLUP` clause is not supported yet
|
||||
|
||||
### SQL Example
|
||||
- Simplified Query Example, focusing on the failing feature
|
||||
```sql
|
||||
-- Replace with your ACTUAL example
|
||||
select 1
|
||||
from dual
|
||||
```
|
||||
- Please don't send screen shots
|
||||
|
||||
### Additional context
|
||||
The used JSQLParser Version (please test the latest SNAPSHOT version before submitting).
|
||||
State the applicable RDBMS and version
|
||||
Links to the reference documentation
|
||||
|
||||
### Tips:
|
||||
<!--
|
||||
Please write in English and avoid Screenshots (as we can't copy and paste content from it).
|
||||
-->
|
||||
31
.github/ISSUE_TEMPLATE/sql-parser-error.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/sql-parser-error.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: SQL Parser Error
|
||||
about: Report a Parser Error
|
||||
title: "[BUG] JSQLParser Version : RDBMS : failing feature description"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Always check against the **Latest SNAPSHOT of JSQLParser** and the [Syntax Diagram](https://jsqlparser.github.io/JSqlParser/syntax_snapshot.html)
|
||||
|
||||
### Failing SQL Feature:
|
||||
- Brief description of the failing SQL feature
|
||||
- Example: `WITH ROLLUP` can't be parsed
|
||||
|
||||
### SQL Example:
|
||||
- Simplified Query Example, focusing on the failing feature
|
||||
```sql
|
||||
-- Replace with your ACTUAL example
|
||||
select 1
|
||||
from dual
|
||||
```
|
||||
|
||||
### Software Information:
|
||||
- JSqlParser version
|
||||
- Database (e. g. Oracle, MS SQL Server, H2, PostgreSQL, IBM DB2 )
|
||||
|
||||
### Tips:
|
||||
Please write in English and avoid Screenshots (as we can't copy and paste content from it).
|
||||
[Try your example online with the latest JSQLParser](http://jsqlformatter.manticore-projects.com) and share the link in the error report.
|
||||
Do provide Links or References to the specific Grammar and Syntax you are trying to use.
|
||||
8
.github/release.yml
vendored
Normal file
8
.github/release.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
changelog:
|
||||
categories:
|
||||
- title: Bugs solved
|
||||
labels:
|
||||
- "bug"
|
||||
- title: Changes and new Features
|
||||
labels:
|
||||
- "*"
|
||||
35
.github/workflows/gradle.yml
vendored
Normal file
35
.github/workflows/gradle.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
||||
|
||||
name: Gradle CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'temurin'
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@v2.6.0
|
||||
with:
|
||||
arguments: check
|
||||
env:
|
||||
ossrhUsername: ${{ secrets.OSSRHPASSWORD }}
|
||||
ossrhPassword: ${{ secrets.OSSRHUSERNAME }}
|
||||
37
.github/workflows/gradle_publish.yml
vendored
Normal file
37
.github/workflows/gradle_publish.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
||||
|
||||
name: Gradle publish Snapshot
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'temurin'
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@v2.6.0
|
||||
with:
|
||||
arguments: publish
|
||||
# arguments: build check publish
|
||||
env:
|
||||
ossrhUsername: ${{ secrets.OSSRHPASSWORD }}
|
||||
ossrhPassword: ${{ secrets.OSSRHUSERNAME }}
|
||||
36
.github/workflows/maven.yml
vendored
Normal file
36
.github/workflows/maven.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Maven CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
package:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [11]
|
||||
name: Java ${{ matrix.java }} building ...
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Java ${{ matrix.java }}
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
server-id: sonatype-nexus-snapshots
|
||||
server-username: MAVEN_USERNAME
|
||||
server-password: MAVEN_PASSWORD
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml -DdisableXmlReport=true -Djacoco.skip=true -Dpmd.skip=true
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
|
||||
31
.github/workflows/maven_deploy.yml
vendored
Normal file
31
.github/workflows/maven_deploy.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Maven deploy snapshot
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [11]
|
||||
name: Java ${{ matrix.java }} building ...
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Java ${{ matrix.java }}
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
server-id: sonatype-nexus-snapshots
|
||||
server-username: MAVEN_USERNAME
|
||||
server-password: MAVEN_PASSWORD
|
||||
- name: Build with Maven
|
||||
run: mvn -B deploy --file pom.xml -DdisableXmlReport=true -Djacoco.skip=true -Dpmd.skip=true
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
|
||||
34
.github/workflows/sphinx.yml
vendored
Normal file
34
.github/workflows/sphinx.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Sphinx Pages
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
|
||||
permissions: write-all
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-python@v4
|
||||
- name: Install XSLT Processor
|
||||
run: sudo apt-get install xsltproc sphinx-common
|
||||
- name: Install dependencies
|
||||
run: pip install furo myst_parser sphinx-prompt sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
|
||||
- name: Checkout project sources
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: master
|
||||
fetch-depth: 0
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2.4.2
|
||||
- name: Run build with Gradle Wrapper
|
||||
run: FLOATING_TOC=false gradle --no-build-cache clean xmldoc sphinx
|
||||
- name: Deploy
|
||||
uses: actions/configure-pages@v2
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
# Upload entire repository
|
||||
path: 'build/sphinx'
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1
|
||||
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# Generated by maven
|
||||
/target
|
||||
/build
|
||||
|
||||
# Sphinx Theme related stuff, which shall be downloaded separately
|
||||
/src/site/sphinx/_themes
|
||||
|
||||
# Exclude the Auto-generated Changelog
|
||||
/src/site/sphinx/changelog.rst
|
||||
/src/site/sphinx/javadoc_stable.rst
|
||||
/src/site/sphinx/syntax_stable.rst
|
||||
/src/site/sphinx/javadoc_snapshot.rst
|
||||
/src/site/sphinx/syntax_snapshot.rst
|
||||
|
||||
# Generated by javacc-maven-plugin
|
||||
/bin
|
||||
/src/net
|
||||
|
||||
# Eclipse configuration files
|
||||
/.project
|
||||
/.settings
|
||||
/.classpath
|
||||
|
||||
#IntelliJ
|
||||
/.idea
|
||||
*.iml
|
||||
|
||||
*.jj~
|
||||
*.java~
|
||||
*.yml~
|
||||
/nbproject/
|
||||
|
||||
/.gradle
|
||||
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk8
|
||||
- openjdk11
|
||||
|
||||
after_success:
|
||||
- mvn clean cobertura:cobertura coveralls:report
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
201
LICENSE_APACHEV2
Normal file
201
LICENSE_APACHEV2
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
504
LICENSE_LGPLV21
Normal file
504
LICENSE_LGPLV21
Normal file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
(This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.)
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{description}
|
||||
Copyright (C) {year} {fullname}
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random
|
||||
Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
76
README.md
Normal file
76
README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# [JSqlParser 4.9 Website](https://jsqlparser.github.io/JSqlParser) <img src="src/site/sphinx/_images/logo-no-background.svg" alt="drawing" width="200" align="right"/>
|
||||
|
||||

|
||||
[](https://travis-ci.com/JSQLParser/JSqlParser) [](https://coveralls.io/r/JSQLParser/JSqlParser?branch=master) [](https://www.codacy.com/gh/JSQLParser/JSqlParser/dashboard?utm_source=github.com&utm_medium=referral&utm_content=JSQLParser/JSqlParser&utm_campaign=Badge_Grade)
|
||||
[](http://maven-badges.herokuapp.com/maven-central/com.github.jsqlparser/jsqlparser) [](https://www.javadoc.io/doc/com.github.jsqlparser/jsqlparser)
|
||||
[](https://gitter.im/JSQLParser/JSqlParser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
## Summary
|
||||
|
||||
Please visit the [WebSite](https://jsqlparser.github.io/JSqlParser). **JSqlParser** is a RDBMS agnostic SQL statement parser. It translates SQL statements into a traversable hierarchy of Java classes (see [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#parse-a-sql-statements)):
|
||||
|
||||
```sql
|
||||
SELECT 1 FROM dual WHERE a = b
|
||||
```
|
||||
|
||||
```text
|
||||
SQL Text
|
||||
└─Statements: statement.select.PlainSelect
|
||||
├─selectItems: statement.select.SelectItem
|
||||
│ └─LongValue: 1
|
||||
├─Table: dual
|
||||
└─where: expression.operators.relational.EqualsTo
|
||||
├─Column: a
|
||||
└─Column: b
|
||||
```
|
||||
|
||||
```java
|
||||
String sqlStr = "select 1 from dual where a=b";
|
||||
|
||||
PlainSelect select = (PlainSelect) CCJSqlParserUtil.parse(sqlStr);
|
||||
|
||||
SelectItem selectItem =
|
||||
select.getSelectItems().get(0);
|
||||
Assertions.assertEquals(
|
||||
new LongValue(1)
|
||||
, selectItem.getExpression());
|
||||
|
||||
Table table = (Table) select.getFromItem();
|
||||
Assertions.assertEquals("dual", table.getName());
|
||||
|
||||
EqualsTo equalsTo = (EqualsTo) select.getWhere();
|
||||
Column a = (Column) equalsTo.getLeftExpression();
|
||||
Column b = (Column) equalsTo.getRightExpression();
|
||||
Assertions.assertEquals("a", a.getColumnName());
|
||||
Assertions.assertEquals("b", b.getColumnName());
|
||||
}
|
||||
```
|
||||
|
||||
JSQLParser-4.9 is the last JDK8 compatible version. The upcoming JSQLParser-5.0 will depend on JDK11 and introduces API breaking changes to the AST Visitors. Please see the Migration Guide for the details.
|
||||
|
||||
## [Supported Grammar and Syntax](https://jsqlparser.github.io/JSqlParser/syntax.html)
|
||||
|
||||
**JSqlParser** aims to support the SQL standard as well as all major RDBMS. Any missing syntax or features can be added on demand.
|
||||
|
||||
| RDBMS | Statements |
|
||||
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Oracle<br>MS SQL Server and Sybase<br>Postgres<br>MySQL and MariaDB<br>DB2<br>H2 and HSQLDB and Derby<br>SQLite | `SELECT`<br>`INSERT`, `UPDATE`, `UPSERT`, `MERGE`<br>`DELETE`, `TRUNCATE TABLE`<br>`CREATE ...`, `ALTER ....`, `DROP ...`<br>`WITH ...` |
|
||||
| Salesforce SOQL | `INCLUDES`, `EXCLUDES` |
|
||||
|
||||
**JSqlParser** can also be used to create SQL Statements from Java Code with a fluent API (see [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#build-a-sql-statements)).
|
||||
|
||||
## Alternatives to JSqlParser?
|
||||
[**General SQL Parser**](http://www.sqlparser.com/features/introduce.php?utm_source=github-jsqlparser&utm_medium=text-general) looks pretty good, with extended SQL syntax (like PL/SQL and T-SQL) and java + .NET APIs. The tool is commercial (license available online), with a free download option.
|
||||
|
||||
Alternatively the dual-licensed [JOOQ](https://www.jooq.org/doc/latest/manual/sql-building/sql-parser/) provides a hand-written Parser supporting a lot of RDBMS, translation between dialects, SQL transformation, can be used as a JDBC proxy for translation and transformation purposes.
|
||||
|
||||
## [Documentation](https://jsqlparser.github.io/JSqlParser)
|
||||
1. [Samples](https://jsqlparser.github.io/JSqlParser/usage.html#parse-a-sql-statements)
|
||||
2. [Build Instructions](https://jsqlparser.github.io/JSqlParser/usage.html) and [Maven Artifact](https://jsqlparser.github.io/JSqlParser/usage.html#build-dependencies)
|
||||
3. [Contribution](https://jsqlparser.github.io/JSqlParser/contribution.html)
|
||||
4. [Change Log](https://jsqlparser.github.io/JSqlParser/changelog.html#latest-changes-since-jsqlparser-version)
|
||||
5. [Issues](https://github.com/JSQLParser/JSqlParser/issues)
|
||||
|
||||
## License
|
||||
|
||||
**JSqlParser** is dual licensed under **LGPL V2.1** or **Apache Software License, Version 2.0**.
|
||||
610
build.gradle
Normal file
610
build.gradle
Normal file
@@ -0,0 +1,610 @@
|
||||
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
|
||||
id "org.javacc.javacc" version "latest.release"
|
||||
id 'jacoco'
|
||||
id 'com.github.kt3k.coveralls' version "latest.release"
|
||||
id "com.github.spotbugs" version "latest.release"
|
||||
id "com.diffplug.spotless" version "latest.release"
|
||||
id 'pmd'
|
||||
id 'checkstyle'
|
||||
|
||||
// download the RR tools which have no Maven Repository
|
||||
id "de.undercouch.download" version "latest.release"
|
||||
id 'org.hidetake.ssh' version "latest.release"
|
||||
|
||||
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "latest.release"
|
||||
id "me.champeau.jmh" version "latest.release"
|
||||
id "com.nwalsh.gradle.saxon.saxon-gradle" version "0.9.6"
|
||||
}
|
||||
|
||||
def getVersion = { boolean considerSnapshot ->
|
||||
Integer major = 0
|
||||
Integer minor = 0
|
||||
Integer patch = null
|
||||
Integer build = null
|
||||
def commit = null
|
||||
def snapshot = ""
|
||||
new ByteArrayOutputStream().withStream { os ->
|
||||
exec {
|
||||
args = [
|
||||
"--no-pager"
|
||||
, "describe"
|
||||
, "--tags"
|
||||
, "--always"
|
||||
, "--dirty=-SNAPSHOT"
|
||||
]
|
||||
executable "git"
|
||||
standardOutput = os
|
||||
}
|
||||
def versionStr = os.toString().trim()
|
||||
def pattern = /(?<major>\d*)\.(?<minor>\d*)(\.(?<patch>\d*))?(-(?<build>\d*)-(?<commit>[a-zA-Z\d]*))?/
|
||||
def matcher = versionStr =~ pattern
|
||||
if (matcher.find()) {
|
||||
major = matcher.group('major') as Integer
|
||||
minor = matcher.group('minor') as Integer
|
||||
patch = matcher.group('patch') as Integer
|
||||
build = matcher.group('build') as Integer
|
||||
commit = matcher.group('commit')
|
||||
}
|
||||
|
||||
if (considerSnapshot && ( versionStr.endsWith('SNAPSHOT') || build!=null) ) {
|
||||
minor++
|
||||
if (patch!=null) patch = 0
|
||||
snapshot = "-SNAPSHOT"
|
||||
}
|
||||
}
|
||||
return patch!=null
|
||||
? "${major}.${minor}.${patch}${snapshot}"
|
||||
: "${major}.${minor}${snapshot}"
|
||||
}
|
||||
|
||||
// for publishing a release, call Gradle with Environment Variable RELEASE:
|
||||
// RELEASE=true gradle JSQLParser:publish
|
||||
version = getVersion( !System.getenv("RELEASE") )
|
||||
group = 'com.github.jsqlparser'
|
||||
description = 'JSQLParser library'
|
||||
archivesBaseName = "JSQLParser"
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
|
||||
// Sonatype OSSRH
|
||||
maven {
|
||||
url = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
xmlDoclet
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'commons-io:commons-io:2.+'
|
||||
testImplementation 'org.apache.commons:commons-text:+'
|
||||
testImplementation 'org.mockito:mockito-core:+'
|
||||
testImplementation 'org.assertj:assertj-core:+'
|
||||
testImplementation 'org.hamcrest:hamcrest-core:+'
|
||||
testImplementation 'org.apache.commons:commons-lang3:+'
|
||||
testImplementation 'com.h2database:h2:+'
|
||||
|
||||
// for JaCoCo Reports
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:+'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:+'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-params:+'
|
||||
|
||||
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
|
||||
testImplementation 'org.mockito:mockito-junit-jupiter:+'
|
||||
|
||||
// Performance Benchmark
|
||||
testImplementation 'org.openjdk.jmh:jmh-core:+'
|
||||
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:+'
|
||||
|
||||
// Java Doc in XML Format
|
||||
xmlDoclet 'com.manticore-projects.tools:xml-doclet:+'
|
||||
|
||||
// enforce latest version of JavaCC
|
||||
testImplementation 'net.java.dev.javacc:javacc:+'
|
||||
javacc 'net.java.dev.javacc:javacc:+'
|
||||
}
|
||||
|
||||
compileJavacc {
|
||||
arguments = [grammar_encoding: 'UTF-8', static: 'false', java_template_type: 'modern']
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
|
||||
sourceCompatibility = '11'
|
||||
targetCompatibility = '11'
|
||||
// needed for XML-Doclet to work (since Doclet changed again with Java 13)
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(11))
|
||||
}
|
||||
}
|
||||
|
||||
compileJava {
|
||||
options.release = 11
|
||||
}
|
||||
|
||||
javadoc {
|
||||
include("build/generated/javacc/net/sf/jsqlparser/parser/*.java" )
|
||||
if(JavaVersion.current().isJava9Compatible()) {
|
||||
options.addBooleanOption('html5', true)
|
||||
}
|
||||
options.addBooleanOption("Xdoclint:none", true)
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes (
|
||||
"Automatic-Module-Name": "net.sf.jsqlparser"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('xmldoc', Javadoc) {
|
||||
def outFile = reporting.file(
|
||||
version.endsWith("-SNAPSHOT")
|
||||
? "xmlDoclet/javadoc_snapshot.xml"
|
||||
: "xmlDoclet/javadoc_stable.xml"
|
||||
)
|
||||
|
||||
def rstFile = reporting.file(
|
||||
version.endsWith("-SNAPSHOT")
|
||||
? "xmlDoclet/javadoc_snapshot.rst"
|
||||
: "xmlDoclet/javadoc_stable.rst"
|
||||
)
|
||||
|
||||
source = sourceSets.main.allJava
|
||||
// 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 $version"
|
||||
options.addBooleanOption("rst", true)
|
||||
options.addBooleanOption("withFloatingToc", Boolean.parseBoolean(System.getenv().getOrDefault("FLOATING_TOC", "true")))
|
||||
options.addStringOption("basePackage", "net.sf.jsqlparser")
|
||||
options.addStringOption("filename", outFile.getName())
|
||||
|
||||
dependsOn(compileJava)
|
||||
doLast {
|
||||
copy {
|
||||
from rstFile
|
||||
into "${projectDir}/src/site/sphinx/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
environment = [ 'EXPORT_TEST_TO_FILE': 'True' ]
|
||||
useJUnitPlatform()
|
||||
|
||||
// set heap size for the test JVM(s)
|
||||
minHeapSize = "128m"
|
||||
maxHeapSize = "1G"
|
||||
}
|
||||
|
||||
coveralls {
|
||||
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
// Jacoco can't handle the TokenManager class
|
||||
afterEvaluate {
|
||||
classDirectories.setFrom(files(classDirectories.files.collect {
|
||||
fileTree(dir: it, exclude: [
|
||||
"**CCJSqlParserTokenManager**"
|
||||
])
|
||||
}))
|
||||
}
|
||||
dependsOn test // tests are required to run before generating the report
|
||||
reports {
|
||||
xml.required = false
|
||||
csv.required = false
|
||||
html.outputLocation = layout.buildDirectory.dir('reports/jacoco')
|
||||
}
|
||||
}
|
||||
jacocoTestCoverageVerification {
|
||||
// Jacoco can't handle the TokenManager class
|
||||
afterEvaluate {
|
||||
classDirectories.setFrom(files(classDirectories.files.collect {
|
||||
fileTree(dir: it, exclude: [
|
||||
"**CCJSqlParserTokenManager**"
|
||||
])
|
||||
}))
|
||||
}
|
||||
violationRules {
|
||||
rule {
|
||||
//element = 'CLASS'
|
||||
limit {
|
||||
//@todo: temporarily reduced it 80%, we need to bring that back to 84% accepting the Keywords PR
|
||||
minimum = 0.50
|
||||
}
|
||||
excludes = [
|
||||
'net.sf.jsqlparser.util.validation.*',
|
||||
'net.sf.jsqlparser.**.*Adapter',
|
||||
'net.sf.jsqlparser.parser.**'
|
||||
]
|
||||
}
|
||||
rule {
|
||||
//element = 'CLASS'
|
||||
limit {
|
||||
counter = 'LINE'
|
||||
value = 'MISSEDCOUNT'
|
||||
|
||||
//@todo: temporarily increased to 7000, we need to bring that down to 5500 after accepting the Keywords PR
|
||||
maximum = 20000
|
||||
}
|
||||
excludes = [
|
||||
'net.sf.jsqlparser.util.validation.*',
|
||||
'net.sf.jsqlparser.**.*Adapter',
|
||||
'net.sf.jsqlparser.parser.**'
|
||||
]
|
||||
}
|
||||
// rule {
|
||||
// element = 'CLASS'
|
||||
// limit {
|
||||
// counter = 'LINE'
|
||||
// value = 'MISSEDRATIO'
|
||||
// maximum = 0.3
|
||||
// }
|
||||
// excludes = [
|
||||
// 'net.sf.jsqlparser.util.validation.*',
|
||||
// 'net.sf.jsqlparser.**.*Adapter',
|
||||
// 'net.sf.jsqlparser.parser.**'
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
spotbugsMain {
|
||||
reports {
|
||||
html {
|
||||
enabled = true
|
||||
destination = file("build/reports/spotbugs/main/spotbugs.html")
|
||||
stylesheet = 'fancy-hist.xsl'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spotbugs {
|
||||
// fail only on P1 and without the net.sf.jsqlparser.parser.*
|
||||
excludeFilter = file("config/spotbugs/spotBugsExcludeFilter.xml")
|
||||
|
||||
// do not run over the test, although we should do that eventually
|
||||
spotbugsTest.enabled = false
|
||||
}
|
||||
|
||||
pmd {
|
||||
consoleOutput = true
|
||||
sourceSets = [sourceSets.main]
|
||||
|
||||
// clear the ruleset in order to use configured rules only
|
||||
ruleSets = []
|
||||
|
||||
//rulesMinimumPriority = 1
|
||||
ruleSetFiles = files("config/pmd/ruleset.xml")
|
||||
|
||||
pmdMain {
|
||||
excludes = [
|
||||
"build/generated/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
sourceSets = [sourceSets.main, sourceSets.test]
|
||||
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
|
||||
}
|
||||
|
||||
spotless {
|
||||
// optional: limit format enforcement to just the files changed by this feature branch
|
||||
ratchetFrom 'origin/master'
|
||||
|
||||
format 'misc', {
|
||||
// define the files to apply `misc` to
|
||||
target '*.rst', '*.md', '.gitignore'
|
||||
|
||||
// define the steps to apply to those files
|
||||
trimTrailingWhitespace()
|
||||
indentWithSpaces(4) // or spaces. Takes an integer argument if you don't like 4
|
||||
endWithNewline()
|
||||
}
|
||||
java {
|
||||
indentWithSpaces(4)
|
||||
eclipse().configFile('config/formatter/eclipse-java-google-style.xml')
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(Checkstyle).configureEach {
|
||||
reports {
|
||||
xml.required = false
|
||||
html.required = true
|
||||
}
|
||||
excludes = [ "**/module-info.java" ]
|
||||
}
|
||||
|
||||
tasks.register('renderRR') {
|
||||
dependsOn(compileJavacc)
|
||||
doLast {
|
||||
// these WAR files have been provided as a courtesy by Gunther Rademacher
|
||||
// and belong to the RR - Railroad Diagram Generator Project
|
||||
// https://github.com/GuntherRademacher/rr
|
||||
//
|
||||
// Hosting at manticore-projects.com is temporary until a better solution is found
|
||||
// Please do not use these files without Gunther's permission
|
||||
download.run {
|
||||
src 'http://manticore-projects.com/download/convert.war'
|
||||
dest "$buildDir/rr/convert.war"
|
||||
overwrite false
|
||||
onlyIfModified true
|
||||
}
|
||||
|
||||
download.run {
|
||||
src 'http://manticore-projects.com/download/rr.war'
|
||||
dest "$buildDir/rr/rr.war"
|
||||
overwrite false
|
||||
onlyIfModified true
|
||||
tempAndMove true
|
||||
}
|
||||
|
||||
javaexec {
|
||||
standardOutput = new FileOutputStream("${buildDir}/rr/JSqlParserCC.ebnf")
|
||||
main = "-jar"
|
||||
args = [
|
||||
"$buildDir/rr/convert.war",
|
||||
"$buildDir/generated/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jj"
|
||||
]
|
||||
}
|
||||
|
||||
javaexec {
|
||||
main = "-jar"
|
||||
args = [
|
||||
"$buildDir/rr/rr.war",
|
||||
"-noepsilon",
|
||||
"-color:#4D88FF",
|
||||
"-offset:0",
|
||||
"-width:800",
|
||||
//"-png",
|
||||
//"-out:${buildDir}/rr/JSqlParserCC.zip",
|
||||
"-out:${buildDir}/rr/JSqlParserCC.xhtml",
|
||||
"${buildDir}/rr/JSqlParserCC.ebnf"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('gitChangelogTask', GitChangelogTask) {
|
||||
fromRepo = file("$projectDir")
|
||||
file = new File("${projectDir}/src/site/sphinx/changelog.rst")
|
||||
fromRef = "4.0"
|
||||
//toRef = "1.1";
|
||||
|
||||
// switch off the formatter since the indentation matters for Mark-down
|
||||
// @formatter:off
|
||||
templateContent ="""
|
||||
************************
|
||||
Changelog
|
||||
************************
|
||||
|
||||
|
||||
{{#tags}}
|
||||
{{#ifMatches name "^Unreleased.*"}}
|
||||
Latest Changes since |JSQLPARSER_VERSION|
|
||||
{{/ifMatches}}
|
||||
{{#ifMatches name "^(?!Unreleased).*"}}
|
||||
Version {{name}}
|
||||
{{/ifMatches}}
|
||||
=============================================================
|
||||
|
||||
{{#issues}}
|
||||
|
||||
{{#commits}}
|
||||
{{#ifMatches messageTitle "^(?!Merge).*"}}
|
||||
* **{{{messageTitle}}}**
|
||||
|
||||
{{authorName}}, {{commitDate}}
|
||||
{{/ifMatches}}
|
||||
{{/commits}}
|
||||
|
||||
{{/issues}}
|
||||
{{/tags}}
|
||||
"""
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
tasks.register('updateKeywords', JavaExec) {
|
||||
group = "Execution"
|
||||
description = "Run the main class with JavaExecTask"
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
args = [
|
||||
file('src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt').absolutePath
|
||||
, file('src/site/sphinx/keywords.rst').absolutePath
|
||||
]
|
||||
main("net.sf.jsqlparser.parser.ParserKeywordsUtils")
|
||||
|
||||
dependsOn(compileJava)
|
||||
}
|
||||
|
||||
xslt {
|
||||
def outFile = version.endsWith("-SNAPSHOT")
|
||||
? file("src/site/sphinx/syntax_snapshot.rst")
|
||||
: file("src/site/sphinx/syntax_stable.rst")
|
||||
|
||||
dependsOn(renderRR)
|
||||
stylesheet 'src/main/resources/rr/xhtml2rst.xsl'
|
||||
|
||||
parameters (
|
||||
"withFloatingToc": System.getenv().getOrDefault("FLOATING_TOC", "true"),
|
||||
"isSnapshot": Boolean.toString(version.endsWith("-SNAPSHOT"))
|
||||
)
|
||||
|
||||
// Transform every .xml file in the "input" directory.
|
||||
input "$buildDir/rr/JSqlParserCC.xhtml"
|
||||
output outFile
|
||||
}
|
||||
|
||||
tasks.register('sphinx', Exec) {
|
||||
dependsOn(gitChangelogTask, renderRR, xslt, xmldoc)
|
||||
|
||||
String PROLOG = """
|
||||
.. |_| unicode:: U+00A0
|
||||
:trim:
|
||||
|
||||
.. |JSQLPARSER_EMAIL| replace:: support@manticore-projects.com
|
||||
.. |JSQLPARSER_VERSION| replace:: ${getVersion(false)}
|
||||
.. |JSQLPARSER_SNAPSHOT_VERSION| replace:: ${getVersion(true)}
|
||||
.. |JSQLPARSER_STABLE_VERSION_LINK| raw:: html
|
||||
|
||||
<a href='http://manticore-projects.com/download/${project.name}-${getVersion(false)}/${project.name}-${getVersion(false)}.jar'>${project.name}-${getVersion(false)}.jar</a>
|
||||
|
||||
.. |JSQLPARSER_SNAPSHOT_VERSION_LINK| raw:: html
|
||||
|
||||
<a href='http://manticore-projects.com/download/${project.name}-${getVersion(false)}/${project.name}-${getVersion(true)}.jar'>${project.name}-${getVersion(true)}.jar</a>
|
||||
|
||||
"""
|
||||
|
||||
args = [
|
||||
"-Dproject=JSQLParser"
|
||||
, "-Dcopyright=Tobias Warneke, 2022"
|
||||
, "-Dauthor=Tobias Warneke"
|
||||
, "-Drelease=${getVersion(false)}"
|
||||
, "-Drst_prolog=$PROLOG"
|
||||
, "${projectDir}/src/site/sphinx"
|
||||
, "${project.buildDir}/sphinx"
|
||||
]
|
||||
|
||||
executable "sphinx-build"
|
||||
|
||||
//store the output instead of printing to the console:
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
|
||||
//extension method stopTomcat.output() can be used to obtain the output:
|
||||
ext.output = {
|
||||
return standardOutput.toString()
|
||||
}
|
||||
}
|
||||
|
||||
publish {
|
||||
dependsOn(check, gitChangelogTask, renderRR, xslt, xmldoc)
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId = 'jsqlparser'
|
||||
|
||||
from components.java
|
||||
versionMapping {
|
||||
usage('java-api') {
|
||||
fromResolutionOf('runtimeClasspath')
|
||||
}
|
||||
usage('java-runtime') {
|
||||
fromResolutionResult()
|
||||
}
|
||||
}
|
||||
pom {
|
||||
name = 'JSQLParser library'
|
||||
description = 'Parse SQL Statements into Abstract Syntax Trees (AST)'
|
||||
url = 'https://github.com/JSQLParser/JSqlParser'
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU Library or Lesser General Public License (LGPL) V2.1'
|
||||
url = 'http://www.gnu.org/licenses/lgpl-2.1.html'
|
||||
}
|
||||
license {
|
||||
name = 'The Apache Software License, Version 2.0'
|
||||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = 'twa'
|
||||
name = 'Tobias Warneke'
|
||||
email = 't.warneke@gmx.net'
|
||||
}
|
||||
developer {
|
||||
id = 'are'
|
||||
name = 'Andreas Reichel'
|
||||
email = 'andreas@manticore-projects.com'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection = 'scm:git:https://github.com/JSQLParser/JSqlParser.git'
|
||||
developerConnection = 'scm:git:ssh://git@github.com:JSQLParser/JSqlParser.git'
|
||||
url = 'https://github.com/JSQLParser/JSqlParser.git'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
name "ossrh"
|
||||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||
def snapshotsRepoUrl= "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||
credentials {
|
||||
username = System.getenv("ossrhUsername")
|
||||
password = System.getenv("ossrhPassword")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
//def signingKey = findProperty("signingKey")
|
||||
//def signingPassword = findProperty("signingPassword")
|
||||
//useInMemoryPgpKeys(signingKey, signingPassword)
|
||||
|
||||
// don't sign SNAPSHOTS
|
||||
if (!version.endsWith('SNAPSHOT')) {
|
||||
sign publishing.publications.mavenJava
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
remotes {
|
||||
webServer {
|
||||
host = findProperty("${project.name}.host")
|
||||
user = findProperty("${project.name}.username")
|
||||
identity = new File("${System.properties['user.home']}/.ssh/id_rsa")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('upload') {
|
||||
doFirst {
|
||||
if (findProperty("${project.name}.host") == null) {
|
||||
println(
|
||||
"""
|
||||
Property \"${project.name}.host\' not found.
|
||||
Please define \"${project.name}.host\" in the Gradle configuration (e. g. \$HOME/.gradle/gradle.properties.
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
doLast {
|
||||
ssh.run {
|
||||
session(remotes.webServer) {
|
||||
def versionStable = getVersion(false)
|
||||
execute "mkdir -p download/${project.name}-${versionStable}"
|
||||
for (File file: fileTree(include:['*.jar'], dir:"${project.buildDir}/libs").collect()) {
|
||||
put from: file, into: "download/${project.name}-${versionStable}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
check.dependsOn jacocoTestCoverageVerification
|
||||
upload.dependsOn(check, assemble, gitChangelogTask, renderRR, xslt, xmldoc)
|
||||
|
||||
36
config/checkstyle/checkstyle.xml
Normal file
36
config/checkstyle/checkstyle.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<module name="SuppressWarningsFilter" />
|
||||
<module name="FileTabCharacter" />
|
||||
<!-- git checkout may change linefeeds on the fly
|
||||
<module name="RegexpMultiline">
|
||||
<property name="format" value="(?s:(\r\n|\r).*)" />
|
||||
<property name="message" value="CRLF and CR line endings are prohibited, but this file uses them." />
|
||||
</module>
|
||||
-->
|
||||
<module name="TreeWalker">
|
||||
<module name="AvoidNestedBlocks" />
|
||||
<module name="ConstantName" />
|
||||
<module name="EmptyCatchBlock" />
|
||||
<module name="EmptyStatement" />
|
||||
<module name="MissingOverride" />
|
||||
<module name="MultipleVariableDeclarations" />
|
||||
<module name="ParameterAssignment" />
|
||||
<module name="StringLiteralEquality" />
|
||||
<module name="RedundantImport" />
|
||||
<module name="UnusedImports" />
|
||||
|
||||
<module name="WhitespaceAfter" />
|
||||
|
||||
<module name="NeedBraces" />
|
||||
<module name="UnnecessaryParentheses" />
|
||||
<module name="LeftCurly" />
|
||||
<module name="RightCurly" />
|
||||
|
||||
<module name="SuppressWarningsHolder" />
|
||||
</module>
|
||||
</module>
|
||||
879
config/checkstyle/checkstyle_checks.xml
Normal file
879
config/checkstyle/checkstyle_checks.xml
Normal file
@@ -0,0 +1,879 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<!--
|
||||
If you set the basedir property below, then all reported file
|
||||
names will be relative to the specified directory. See
|
||||
https://checkstyle.org/config.html#Checker
|
||||
|
||||
<property name="basedir" value="${basedir}"/>
|
||||
-->
|
||||
|
||||
<metadata name="org.checkstyle.principle" value="Practice What You Preach"/>
|
||||
<metadata name="org.checkstyle.principle.description"
|
||||
value="In our config we should use all Checks that Checkstyle has"/>
|
||||
|
||||
<property name="cacheFile" value="${checkstyle.cache.file}"/>
|
||||
|
||||
<property name="severity" value="error"/>
|
||||
|
||||
<property name="fileExtensions" value="java, properties, xml, vm, g, g4, dtd"/>
|
||||
|
||||
<!-- BeforeExecutionFileFilters is required for sources that are based on java9 -->
|
||||
<module name="BeforeExecutionExclusionFileFilter">
|
||||
<property name="fileNamePattern" value="module\-info\.java$" />
|
||||
</module>
|
||||
|
||||
<!-- Filters -->
|
||||
<module name="SeverityMatchFilter">
|
||||
<!-- report all violations except ignore -->
|
||||
<property name="severity" value="ignore"/>
|
||||
<property name="acceptOnMatch" value="false"/>
|
||||
</module>
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="${checkstyle.suppressions.file}"/>
|
||||
</module>
|
||||
<!-- Tone down the checking for test code -->
|
||||
<module name="SuppressionSingleFilter">
|
||||
<property name="checks" value="JavadocPackage"/>
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
</module>
|
||||
<module name="SuppressionSingleFilter">
|
||||
<property name="checks" value="JavadocMethod"/>
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/].*(?<!Support)\.java"/>
|
||||
</module>
|
||||
<module name="SuppressWarningsFilter"/>
|
||||
<module name="SuppressWithPlainTextCommentFilter">
|
||||
<!--
|
||||
Use suppressions.xml for suppressions, this is only example.
|
||||
checkFormat will prevent suppression comments from being valid.
|
||||
-->
|
||||
<property name="checkFormat" value="IGNORETHIS"/>
|
||||
<property name="offCommentFormat" value="CSOFF\: .*"/>
|
||||
<property name="onCommentFormat" value="CSON\: .*"/>
|
||||
</module>
|
||||
|
||||
<!-- Headers -->
|
||||
<module name="Header">
|
||||
<property name="headerFile" value="${checkstyle.header.file}"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="id" value="header"/>
|
||||
</module>
|
||||
<module name="RegexpHeader">
|
||||
<property name="id" value="regexpHeader"/>
|
||||
<property name="headerFile" value="${checkstyle.regexp.header.file}"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
</module>
|
||||
|
||||
<!-- Javadoc Comments -->
|
||||
<module name="JavadocPackage">
|
||||
<property name="allowLegacy" value="false"/>
|
||||
</module>
|
||||
|
||||
<!-- Miscellaneous -->
|
||||
<module name="NewlineAtEndOfFile"/>
|
||||
<module name="Translation">
|
||||
<property name="requiredTranslations" value="de, fr, fi, es, pt, ja, tr, zh"/>
|
||||
</module>
|
||||
<module name="UniqueProperties"/>
|
||||
<module name="OrderedProperties" />
|
||||
|
||||
<!-- Regexp -->
|
||||
<module name="RegexpMultiline">
|
||||
<property name="id" value="regexpMultilineDefault"/>
|
||||
</module>
|
||||
<module name="RegexpMultiline">
|
||||
<property name="id" value="noIndentationConfigExamples"/>
|
||||
<property name="format" value="<source>\r?\n\s+"/>
|
||||
<property name="fileExtensions" value="xml"/>
|
||||
<property name="message" value="Content of source tag should not be Indented"/>
|
||||
</module>
|
||||
<module name="RegexpMultiline">
|
||||
<property name="id" value="noConsecutiveLines"/>
|
||||
<property name="format" value="\r?\n[\t ]*\r?\n[\t ]*\r?\n"/>
|
||||
<property name="fileExtensions" value="java,xml,properties"/>
|
||||
<property name="message" value="Unnecessary consecutive lines"/>
|
||||
</module>
|
||||
<module name="RegexpMultiline">
|
||||
<property name="id" value="commentFirstSentenceMultiline"/>
|
||||
<property name="format" value="/\*\*\W+\* +\p{javaLowerCase}"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="message"
|
||||
value="First sentence in a comment should start with a capital letter"/>
|
||||
</module>
|
||||
<module name="RegexpMultiline">
|
||||
<property name="id" value="noEmptyFile"/>
|
||||
<property name="format" value="^\s*$" />
|
||||
<property name="matchAcrossLines" value="true" />
|
||||
<property name="message" value="Empty file is not allowed" />
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="noTrailingWhitespace"/>
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="minimum" value="0"/>
|
||||
<property name="maximum" value="0"/>
|
||||
<property name="message" value="Trailing whitespace is not allowed"/>
|
||||
</module>
|
||||
<!-- This is needed for correct metadata generation -->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="propertyTypeOnNewLine"/>
|
||||
<property name="format" value="^ \* .+(Type|Default value|Validation type) is \{@code "/>
|
||||
<property name="minimum" value="0"/>
|
||||
<property name="maximum" value="0"/>
|
||||
<property name="message" value="Property attributeExpression should be on new javadoc line"/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="commentFirstSentenceSingleline"/>
|
||||
<property name="format" value="/\*\* +\p{javaLowerCase}"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="message"
|
||||
value="First sentence in a comment should start with a capital letter"/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="lineLengthGrammar"/>
|
||||
<property name="format" value="^(?!(.*http|import)).{101,}$"/>
|
||||
<property name="fileExtensions" value="g, g4"/>
|
||||
<property name="message" value="Line should not be longer than 100 symbols"/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="lineLengthXml"/>
|
||||
<property name="format"
|
||||
value="^(?!(\s*,?\s*<a href="[^"]+">|.*http)).{101,}$"/>
|
||||
<property name="fileExtensions" value="xml, vm"/>
|
||||
<property name="message" value="Line should not be longer than 100 symbols"/>
|
||||
</module>
|
||||
<!--
|
||||
Links to .dtd files should start with "/", "http://" or "https://",
|
||||
otherwise they will be broken after archiving the documentation.
|
||||
See https://github.com/checkstyle/checkstyle/issues/7340 for details.
|
||||
-->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="noRelativeLinks"/>
|
||||
<property name="format" value="href="(?!\/|https?:\/\/).*?\.dtd""/>
|
||||
<property name="fileExtensions" value="xml, vm"/>
|
||||
<property name="message"
|
||||
value="Relative links to DTD files are prohibited. Please use absolute path or uri instead."/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="noSourceforgeNetLinks"/>
|
||||
<property name="format" value="checkstyle\.sourceforge\.net"/>
|
||||
<property name="message"
|
||||
value="Old site links should not be used, please use https://checkstyle.org"/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="noSourceforgeIoLinks"/>
|
||||
<property name="format" value="checkstyle\.sourceforge\.io"/>
|
||||
<property name="message"
|
||||
value="Old site links should not be used, please use https://checkstyle.org"/>
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="id" value="noPackageCommentWithOtherVisibility"/>
|
||||
<property name="format" value="/\*\s+package\s+\*/\s+(private|protected|public)"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="message"
|
||||
value="Package comment marker should not be used if other visibility is defined"/>
|
||||
</module>
|
||||
<module name="RegexpOnFilename">
|
||||
<property name="id" value="regexpOnFilenameWithSpace"/>
|
||||
</module>
|
||||
<module name="RegexpOnFilename">
|
||||
<property name="id" value="javaFileLocation"/>
|
||||
<property name="folderPattern" value="[\\/]src[\\/]\w+[\\/]java[\\/]"/>
|
||||
<property name="fileNamePattern" value="\.java$"/>
|
||||
<property name="match" value="false"/>
|
||||
<message key="regexp.filepath.mismatch"
|
||||
value="Only java files should be located in the ''src/*/java'' folders."/>
|
||||
</module>
|
||||
<module name="RegexpOnFilename">
|
||||
<property name="id" value="xmlFileLocation"/>
|
||||
<property name="folderPattern" value="[\\/]src[\\/]xdocs[\\/]"/>
|
||||
<property name="fileNamePattern" value="\.(xml)|(vm)$"/>
|
||||
<property name="match" value="false"/>
|
||||
<message key="regexp.filepath.mismatch"
|
||||
value="All files in the ''src/xdocs'' folder should have the ''xml'' or ''vm'' extension."/>
|
||||
</module>
|
||||
<module name="RegexpOnFilename">
|
||||
<property name="id" value="testFileLocation"/>
|
||||
<property name="folderPattern" value="[\\/]src[\\/]it[\\/]java[\\/]"/>
|
||||
<property name="fileNamePattern" value="^((\w+Test)|(\w+TestSupport)|(Abstract\w+))\.java$"/>
|
||||
<property name="match" value="false"/>
|
||||
<message key="regexp.filepath.mismatch"
|
||||
value="All files in the ''src/it/java'' folder
|
||||
should be named ''*Test.java'' or ''Abstract*.java''."/>
|
||||
</module>
|
||||
|
||||
<!-- Size Violations -->
|
||||
<module name="FileLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
</module>
|
||||
<module name="LineLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="max" value="100"/>
|
||||
<property name="ignorePattern" value="^ *\* *([^ ]+|\{@code .*|<a href="[^"]+">)$"/>
|
||||
</module>
|
||||
|
||||
<!-- Whitespace -->
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="false"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<property name="tabWidth" value="4"/>
|
||||
|
||||
<!-- Annotations -->
|
||||
<module name="AnnotationLocation">
|
||||
<property name="tokens" value="ANNOTATION_DEF"/>
|
||||
<property name="tokens" value="ANNOTATION_FIELD_DEF"/>
|
||||
<property name="tokens" value="PACKAGE_DEF"/>
|
||||
<property name="tokens" value="ENUM_CONSTANT_DEF"/>
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="allowSamelineSingleParameterlessAnnotation" value="false"/>
|
||||
</module>
|
||||
<module name="AnnotationOnSameLine">
|
||||
<!-- we can not use it as it conflicts with AnnotationLocation -->
|
||||
<property name="severity" value="ignore"/>
|
||||
<property name="tokens" value="METHOD_DEF"/>
|
||||
<property name="tokens" value="CTOR_DEF"/>
|
||||
<property name="tokens" value="TYPECAST"/>
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="tokens" value="CLASS_DEF"/>
|
||||
<property name="tokens" value="ENUM_DEF"/>
|
||||
<property name="tokens" value="INTERFACE_DEF"/>
|
||||
<property name="tokens" value="TYPE_ARGUMENT"/>
|
||||
<property name="tokens" value="ANNOTATION_DEF"/>
|
||||
<property name="tokens" value="LITERAL_NEW"/>
|
||||
<property name="tokens" value="LITERAL_THROWS"/>
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="tokens" value="PARAMETER_DEF"/>
|
||||
<property name="tokens" value="IMPLEMENTS_CLAUSE"/>
|
||||
<property name="tokens" value="ANNOTATION_FIELD_DEF"/>
|
||||
<property name="tokens" value="RECORD_DEF"/>
|
||||
<property name="tokens" value="COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="AnnotationUseStyle"/>
|
||||
<module name="MissingDeprecated"/>
|
||||
<module name="MissingOverride"/>
|
||||
<module name="PackageAnnotation"/>
|
||||
<module name="SuppressWarnings">
|
||||
<property name="format" value="^((?!unchecked|deprecation|rawtypes|resource).)*$"/>
|
||||
<message key="suppressed.warning.not.allowed"
|
||||
value="The warning ''{0}'' cannot be suppressed at this location.
|
||||
Only few javac warnings are allowed to suppress.
|
||||
If try to suppress checkstyle/pmd/..... violation please do this in their config file.
|
||||
If you try to suppress IntelliJ IDEA inspection,
|
||||
please use javadoc block tag @noinspection"
|
||||
/>
|
||||
</module>
|
||||
<module name="SuppressWarningsHolder"/>
|
||||
|
||||
<!-- Block Checks -->
|
||||
<module name="AvoidNestedBlocks">
|
||||
<property name="allowInSwitchCase" value="true"/>
|
||||
</module>
|
||||
<module name="EmptyBlock">
|
||||
<property name="tokens" value="LITERAL_CATCH"/>
|
||||
<property name="tokens" value="ARRAY_INIT"/>
|
||||
<property name="tokens" value="LITERAL_DEFAULT"/>
|
||||
<property name="tokens" value="LITERAL_CASE"/>
|
||||
<property name="tokens" value="INSTANCE_INIT"/>
|
||||
<property name="tokens" value="LITERAL_DO"/>
|
||||
<property name="tokens" value="LITERAL_ELSE"/>
|
||||
<property name="tokens" value="LITERAL_FINALLY"/>
|
||||
<property name="tokens" value="LITERAL_FOR"/>
|
||||
<property name="tokens" value="LITERAL_IF"/>
|
||||
<property name="tokens" value="LITERAL_SWITCH"/>
|
||||
<property name="tokens" value="LITERAL_SYNCHRONIZED"/>
|
||||
<property name="tokens" value="LITERAL_TRY"/>
|
||||
<property name="tokens" value="LITERAL_WHILE"/>
|
||||
<property name="tokens" value="STATIC_INIT"/>
|
||||
<property name="option" value="text"/>
|
||||
</module>
|
||||
<module name="EmptyCatchBlock"/>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="NeedBraces">
|
||||
<property name="tokens" value="LAMBDA"/>
|
||||
<property name="allowSingleLineStatement" value="true"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="tokens" value="METHOD_DEF"/>
|
||||
<property name="tokens" value="CTOR_DEF"/>
|
||||
<property name="tokens" value="CLASS_DEF"/>
|
||||
<property name="tokens" value="INSTANCE_INIT"/>
|
||||
<property name="tokens" value="LITERAL_FOR"/>
|
||||
<property name="tokens" value="STATIC_INIT"/>
|
||||
<property name="tokens" value="LITERAL_WHILE"/>
|
||||
<property name="tokens" value="LITERAL_CATCH"/>
|
||||
<property name="tokens" value="LITERAL_ELSE"/>
|
||||
<property name="tokens" value="LITERAL_FINALLY"/>
|
||||
<property name="tokens" value="LITERAL_IF"/>
|
||||
<property name="tokens" value="LITERAL_TRY"/>
|
||||
<property name="tokens" value="ANNOTATION_DEF"/>
|
||||
<property name="tokens" value="ENUM_DEF"/>
|
||||
<property name="tokens" value="RECORD_DEF"/>
|
||||
<property name="tokens" value="COMPACT_CTOR_DEF"/>
|
||||
<property name="option" value="alone"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="tokens" value="LITERAL_DO"/>
|
||||
<property name="option" value="same"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="tokens" value="INTERFACE_DEF"/>
|
||||
<property name="option" value="alone_or_singleline"/>
|
||||
</module>
|
||||
|
||||
<!-- Class Design -->
|
||||
<module name="DesignForExtension">
|
||||
<property name="ignoredAnnotations"
|
||||
value="Override, Test, Before, After, BeforeClass, AfterClass"/>
|
||||
<property name="ignoredAnnotations"
|
||||
value="BeforeAll, AfterAll, BeforeEach, AfterEach"/>
|
||||
</module>
|
||||
<module name="FinalClass"/>
|
||||
<module name="HideUtilityClassConstructor"/>
|
||||
<module name="InnerTypeLast"/>
|
||||
<module name="InterfaceIsType"/>
|
||||
<module name="MutableException"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
<module name="ThrowsCount">
|
||||
<property name="max" value="2"/>
|
||||
</module>
|
||||
<module name="VisibilityModifier">
|
||||
<property name="ignoreAnnotationCanonicalNames"
|
||||
value="org.junit.Rule, org.junit.jupiter.api.io.TempDir"/>
|
||||
</module>
|
||||
|
||||
<!-- Coding -->
|
||||
<module name="ArrayTrailingComma"/>
|
||||
<module name="AvoidDoubleBraceInitialization"/>
|
||||
<module name="AvoidInlineConditionals"/>
|
||||
<module name="AvoidNoArgumentSuperConstructorCall"/>
|
||||
<module name="CovariantEquals"/>
|
||||
<module name="DeclarationOrder"/>
|
||||
<module name="DefaultComesLast"/>
|
||||
<module name="EmptyStatement"/>
|
||||
<module name="EqualsAvoidNull"/>
|
||||
<module name="EqualsHashCode"/>
|
||||
<module name="ExplicitInitialization"/>
|
||||
<module name="FallThrough"/>
|
||||
<module name="FinalLocalVariable"/>
|
||||
<module name="HiddenField">
|
||||
<property name="ignoreConstructorParameter" value="true"/>
|
||||
<property name="ignoreSetter" value="true"/>
|
||||
<property name="setterCanReturnItsClass" value="true"/>
|
||||
</module>
|
||||
<module name="IllegalCatch">
|
||||
<property name="illegalClassNames"
|
||||
value="java.lang.Exception,
|
||||
java.lang.Throwable,
|
||||
java.lang.RuntimeException,
|
||||
java.lang.NullPointerException"/>
|
||||
</module>
|
||||
<module name="IllegalInstantiation">
|
||||
<property name="classes"
|
||||
value="org.xml.sax.SAXException, org.xml.sax.SAXParseException,
|
||||
org.apache.commons.beanutils.ConversionException,
|
||||
org.antlr.v4.runtime.misc.ParseCancellationException,
|
||||
java.lang.StringBuffer"/>
|
||||
</module>
|
||||
<module name="IllegalThrows"/>
|
||||
<module name="IllegalToken">
|
||||
<property name="tokens" value="LABELED_STAT"/>
|
||||
<property name="tokens" value="LITERAL_NATIVE"/>
|
||||
<property name="tokens" value="LITERAL_VOLATILE"/>
|
||||
<property name="tokens" value="LITERAL_ASSERT"/>
|
||||
</module>
|
||||
<module name="IllegalTokenText">
|
||||
<property name="tokens" value="STRING_LITERAL"/>
|
||||
<property name="format" value="^(US-ASCII|ISO-8859-1|UTF-8|UTF-16BE|UTF-16LE|UTF-16)$"/>
|
||||
<property name="ignoreCase" value="true"/>
|
||||
</module>
|
||||
<module name="IllegalType">
|
||||
<property name="illegalClassNames"
|
||||
value="java.util.HashSet, HashSet, java.util.LinkedHashMap, LinkedHashMap,
|
||||
java.util.TreeMap, TreeMap, java.util.HashMap, HashMap,
|
||||
java.util.LinkedHashSet, LinkedHashSet, java.util.TreeSet, TreeSet,
|
||||
java.lang.StringBuffer, StringBuffer"/>
|
||||
</module>
|
||||
<module name="InnerAssignment"/>
|
||||
<module name="MagicNumber"/>
|
||||
<module name="MatchXpath">
|
||||
<property name="query" value="//CLASS_DEF[@text!='Checker' and @text!='Main']
|
||||
//LITERAL_CATCH//METHOD_CALL[.//IDENT[@text = 'printStackTrace']]/.."/>
|
||||
<message key="matchxpath.match" value="Avoid using 'printStackTrace'."/>
|
||||
</module>
|
||||
<module name="MatchXpath">
|
||||
<property name="query" value="//METHOD_DEF/MODIFIERS//
|
||||
ANNOTATION[./IDENT[@text='Test']]/ANNOTATION_MEMBER_VALUE_PAIR
|
||||
[./IDENT[@text='expected']]"/>
|
||||
<message key="matchxpath.match" value="Avoid using 'expected' attributeExpression in Test annotation."/>
|
||||
</module>
|
||||
<module name="MatchXpath">
|
||||
<property name="query" value="//ANNOTATION[./IDENT[@text='Issue']]"/>
|
||||
<message key="matchxpath.match" value="Avoid using @Issue annotation."/>
|
||||
</module>
|
||||
<!-- until https://github.com/checkstyle/checkstyle/issues/5234 -->
|
||||
<module name="MatchXpath">
|
||||
<property name="id" value="MatchXPathBranchContains"/>
|
||||
<property name="query" value="//METHOD_CALL//DOT[.//IDENT[@text = 'branchContains']]"/>
|
||||
<message key="matchxpath.match"
|
||||
value="Avoid using deprecated method 'DetailAst.branchContains()'."/>
|
||||
</module>
|
||||
<module name="MatchXpath">
|
||||
<property name="id" value="singleLineCommentStartWithSpace"/>
|
||||
<property name="query"
|
||||
value="//SINGLE_LINE_COMMENT[./COMMENT_CONTENT[not(starts-with(@text, ' '))
|
||||
and not(@text = '\n') and not(ends-with(@text, '//\n'))
|
||||
and not(@text = '\r') and not(ends-with(@text, '//\r'))
|
||||
and not(@text = '\r\n') and not(ends-with(@text, '//\r\n'))]]"/>
|
||||
<message key="matchxpath.match" value="Single line comment text should start with space."/>
|
||||
</module>
|
||||
<module name="MatchXpath">
|
||||
<property name="id" value="blockCommentStartWithSpace"/>
|
||||
<property name="query"
|
||||
value="//BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT[matches(@text, '\\n+ *\*[^\\n ]\S')
|
||||
or matches(@text, '^[^\* \\n]') or matches(@text, '\\r+ *\*[^\\r ]\S')
|
||||
or matches(@text, '^[^\* \\r]') or matches(@text, '\\r\\n+ *\*[^\\r\\n ]\S')
|
||||
or matches(@text, '^[^\* \\r\\n]') and not(starts-with(@text, '*'))]]"/>
|
||||
<message key="matchxpath.match"
|
||||
value="Block comment text should start with space after asterisk."/>
|
||||
</module>
|
||||
<module name="MissingCtor">
|
||||
<!--
|
||||
we will not use that fanatic validation, extra code is not good
|
||||
But this Check will exists as it was created by community demand.
|
||||
-->
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="ModifiedControlVariable"/>
|
||||
<module name="MultipleStringLiterals"/>
|
||||
<module name="MultipleVariableDeclarations"/>
|
||||
<module name="NestedForDepth">
|
||||
<property name="max" value="2"/>
|
||||
</module>
|
||||
<module name="NestedIfDepth">
|
||||
<property name="max" value="3"/>
|
||||
</module>
|
||||
<module name="NestedTryDepth"/>
|
||||
<module name="NoArrayTrailingComma">
|
||||
<!-- This Check is conflicting with ArrayTrailingComma -->
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="NoClone"/>
|
||||
<module name="NoCodeInFile"/>
|
||||
<module name="NoEnumTrailingComma">
|
||||
<!-- This Check is conflicting with our vision of code
|
||||
to be same as ArrayTrailingComma requires it -->
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="NoFinalizer"/>
|
||||
<module name="OneStatementPerLine"/>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="PackageDeclaration"/>
|
||||
<module name="ParameterAssignment"/>
|
||||
<module name="RequireThis"/>
|
||||
<module name="ReturnCount">
|
||||
<property name="max" value="1"/>
|
||||
<property name="maxForVoid" value="0"/>
|
||||
</module>
|
||||
<module name="SimplifyBooleanExpression"/>
|
||||
<module name="SimplifyBooleanReturn"/>
|
||||
<module name="StringLiteralEquality"/>
|
||||
<module name="SuperClone"/>
|
||||
<module name="SuperFinalize"/>
|
||||
<module name="UnnecessaryParentheses"/>
|
||||
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
|
||||
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
|
||||
<module name="UnnecessarySemicolonInEnumeration"/>
|
||||
<module name="UnnecessarySemicolonInTryWithResources"/>
|
||||
<module name="VariableDeclarationUsageDistance"/>
|
||||
|
||||
<!-- Filters -->
|
||||
<module name="SuppressionCommentFilter">
|
||||
<!--
|
||||
Use suppressions.xml for suppressions, this is only example.
|
||||
checkFormat will prevent suppression comments from being valid.
|
||||
-->
|
||||
<property name="checkFormat" value="IGNORETHIS"/>
|
||||
<property name="offCommentFormat" value="CSOFF\: .*"/>
|
||||
<property name="onCommentFormat" value="CSON\: .*"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathFilter">
|
||||
<property name="file" value="${checkstyle.suppressions-xpath.file}"/>
|
||||
</module>
|
||||
<!-- Tone down the checking for test code -->
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value="[\\/]internal[\\/].*[\\/]\w+Util\.java"/>
|
||||
<property name="checks" value="IllegalCatch"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/]test[\\/]"/>
|
||||
<property name="checks" value="EmptyBlock"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="JavadocVariable"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="JavadocType"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="MagicNumber"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="AvoidStaticImport"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="WriteTag"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="MethodCount"/>
|
||||
</module>
|
||||
<!-- Fixing these cases will decrease code readability -->
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<property name="files" value=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<property name="checks" value="MultipleStringLiterals"/>
|
||||
</module>
|
||||
<module name="SuppressWithNearbyCommentFilter">
|
||||
<property name="commentFormat"
|
||||
value="-@cs\[(\w{8,}(\|\w{8,})*)\] \w[\(\)\-\.\'\`\,\:\;\w ]{10,}"/>
|
||||
<property name="checkFormat" value="$1"/>
|
||||
<property name="influenceFormat" value="3"/>
|
||||
</module>
|
||||
|
||||
<!-- Imports -->
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="AvoidStaticImport"/>
|
||||
<module name="CustomImportOrder">
|
||||
<property name="customImportOrderRules"
|
||||
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
|
||||
<property name="standardPackageRegExp" value="^java\."/>
|
||||
<property name="specialImportsRegExp" value="^javax\."/>
|
||||
<property name="thirdPartyPackageRegExp" value="^org\."/>
|
||||
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||
<property name="separateLineBetweenGroups" value="true"/>
|
||||
</module>
|
||||
<module name="IllegalImport"/>
|
||||
<module name="ImportControl">
|
||||
<property name="id" value="ImportControlMain"/>
|
||||
<property name="file" value="${checkstyle.importcontrol.file}"/>
|
||||
<property name="path" value="^.*[\\/]src[\\/]main[\\/].*$"/>
|
||||
</module>
|
||||
<module name="ImportControl">
|
||||
<property name="id" value="ImportControlTest"/>
|
||||
<property name="file" value="${checkstyle.importcontroltest.file}"/>
|
||||
<property name="path" value="^.*[\\/]src[\\/](test|it)[\\/].*$"/>
|
||||
</module>
|
||||
<module name="ImportOrder">
|
||||
<property name="groups" value="/^java\./,javax,org"/>
|
||||
<property name="ordered" value="true"/>
|
||||
<property name="separated" value="true"/>
|
||||
<property name="option" value="top"/>
|
||||
<property name="sortStaticImportsAlphabetically" value="true"/>
|
||||
</module>
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports"/>
|
||||
|
||||
<!-- Javadoc Comments -->
|
||||
<module name="AtclauseOrder"/>
|
||||
<module name="InvalidJavadocPosition"/>
|
||||
<module name="JavadocBlockTagLocation">
|
||||
<!-- default tags -->
|
||||
<property name="tags" value="author, deprecated, exception, hidden, param, provides"/>
|
||||
<property name="tags" value="return, see, serial, serialData, serialField, since, throws"/>
|
||||
<property name="tags" value="uses, version"/>
|
||||
<!-- additional tags used in the project -->
|
||||
<property name="tags" value="noinspection"/>
|
||||
</module>
|
||||
<module name="JavadocContentLocation"/>
|
||||
<module name="JavadocMethod">
|
||||
<property name="validateThrows" value="true"/>
|
||||
</module>
|
||||
<module name="JavadocMissingLeadingAsterisk"/>
|
||||
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
|
||||
<module name="JavadocParagraph"/>
|
||||
<module name="JavadocStyle">
|
||||
<property name="scope" value="public"/>
|
||||
</module>
|
||||
<module name="JavadocTagContinuationIndentation"/>
|
||||
<module name="JavadocType">
|
||||
<!-- avoid errors on tag '@noinspection' -->
|
||||
<property name="allowUnknownTags" value="true"/>
|
||||
</module>
|
||||
<module name="JavadocVariable"/>
|
||||
<module name="MissingJavadocMethod">
|
||||
<property name="allowMissingPropertyJavadoc" value="true"/>
|
||||
<property name="scope" value="private"/>
|
||||
</module>
|
||||
<module name="MissingJavadocPackage"/>
|
||||
<module name="MissingJavadocType">
|
||||
<property name="scope" value="private"/>
|
||||
</module>
|
||||
<module name="NonEmptyAtclauseDescription"/>
|
||||
<module name="SingleLineJavadoc"/>
|
||||
<module name="WriteTag"/>
|
||||
<module name="SummaryJavadoc"/>
|
||||
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
|
||||
|
||||
<!-- Metrics -->
|
||||
<module name="BooleanExpressionComplexity">
|
||||
<property name="max" value="7"/>
|
||||
</module>
|
||||
<module name="ClassDataAbstractionCoupling">
|
||||
<!-- Default classes are also listed -->
|
||||
<property name="excludedClasses"
|
||||
value="boolean, byte, char, double, float, int, long, short, void,
|
||||
Boolean, Byte, Character, Double, Float, Integer, Long, Short, Void,
|
||||
Object, Class, String, StringBuffer, StringBuilder,
|
||||
ArrayIndexOutOfBoundsException, Exception, RuntimeException,
|
||||
IllegalArgumentException, IllegalStateException,
|
||||
IndexOutOfBoundsException, NullPointerException, Throwable,
|
||||
SecurityException, UnsupportedOperationException, List, ArrayList,
|
||||
Deque, Queue, LinkedList, Set, HashSet, SortedSet, TreeSet, Map,
|
||||
HashMap, SortedMap, TreeMap, DetailsAST, CheckstyleException,
|
||||
UnsupportedEncodingException, BuildException, ConversionException,
|
||||
FileNotFoundException, TestException"/>
|
||||
</module>
|
||||
<module name="ClassFanOutComplexity">
|
||||
<property name="max" value="25"/>
|
||||
<!-- Default classes are also listed -->
|
||||
<property name="excludedClasses"
|
||||
value="boolean, byte, char, double, float, int, long, short,
|
||||
void, Boolean, Byte, Character, Double, Float, Integer,
|
||||
Long, Short, Void, Object, Class, String, StringBuffer,
|
||||
StringBuilder, ArrayIndexOutOfBoundsException, Exception,
|
||||
RuntimeException, IllegalArgumentException, IllegalStateException,
|
||||
IndexOutOfBoundsException, NullPointerException, Throwable,
|
||||
SecurityException, UnsupportedOperationException, List, ArrayList,
|
||||
Deque, Queue, LinkedList, Set, HashSet, SortedSet, TreeSet, Map,
|
||||
HashMap, SortedMap, TreeMap, DetailsAST, CheckstyleException,
|
||||
UnsupportedEncodingException, BuildException, ConversionException,
|
||||
FileNotFoundException, TestException, Log, Sets, Multimap,
|
||||
TokenStreamRecognitionException, RecognitionException,
|
||||
TokenStreamException, IOException, Override, Deprecated, SafeVarargs,
|
||||
SuppressWarnings, FunctionalInterface"/>
|
||||
</module>
|
||||
<module name="CyclomaticComplexity">
|
||||
<property name="switchBlockAsSingleDecisionPoint" value="true"/>
|
||||
</module>
|
||||
<module name="JavaNCSS"/>
|
||||
<module name="NPathComplexity"/>
|
||||
|
||||
<!-- Misc -->
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<module name="AvoidEscapedUnicodeCharacters">
|
||||
<property name="allowIfAllCharactersEscaped" value="true"/>
|
||||
</module>
|
||||
<module name="CommentsIndentation"/>
|
||||
<module name="DescendantToken"/>
|
||||
<module name="FinalParameters">
|
||||
<!--
|
||||
we will not use that fanatic validation, extra modifiers pollute a code
|
||||
it is better to use extra validation(Check) that argument is reassigned
|
||||
But this Check will exists as it was created by community demand.
|
||||
-->
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="Indentation">
|
||||
<property name="basicOffset" value="4"/>
|
||||
<property name="braceAdjustment" value="0"/>
|
||||
<property name="caseIndent" value="4"/>
|
||||
<property name="throwsIndent" value="8"/>
|
||||
</module>
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="TodoComment">
|
||||
<property name="format" value="(TODO)|(FIXME)" />
|
||||
</module>
|
||||
<module name="TrailingComment"/>
|
||||
<module name="UncommentedMain">
|
||||
<property name="excludedClasses" value="\.(Main|JavadocPropertiesGenerator)$"/>
|
||||
</module>
|
||||
<module name="UpperEll"/>
|
||||
|
||||
<!-- Modifiers -->
|
||||
<module name="ClassMemberImpliedModifier">
|
||||
<!-- effectively the opposite of RedundantModifier, so output must be ignored -->
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="InterfaceMemberImpliedModifier">
|
||||
<!-- effectively the opposite of RedundantModifier, so output must be ignored -->
|
||||
<property name="severity" value="ignore"/>
|
||||
</module>
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="RedundantModifier"/>
|
||||
|
||||
<!-- Naming Conventions -->
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="false"/>
|
||||
<property name="allowedAbbreviationLength" value="0"/>
|
||||
<property name="allowedAbbreviations" value="AST"/>
|
||||
</module>
|
||||
<module name="AbstractClassName"/>
|
||||
<module name="ClassTypeParameterName"/>
|
||||
<module name="RecordTypeParameterName"/>
|
||||
<module name="RecordComponentName"/>
|
||||
<module name="ConstantName"/>
|
||||
<module name="InterfaceTypeParameterName"/>
|
||||
<module name="LocalFinalVariableName"/>
|
||||
<module name="LocalVariableName">
|
||||
<property name="format" value="^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"/>
|
||||
<property name="allowOneCharVarInForLoop" value="true"/>
|
||||
</module>
|
||||
<module name="MemberName">
|
||||
<property name="format" value="^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"/>
|
||||
</module>
|
||||
<module name="MethodName"/>
|
||||
<module name="MethodTypeParameterName"/>
|
||||
<module name="PackageName"/>
|
||||
<module name="ParameterName">
|
||||
<property name="format" value="^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"/>
|
||||
<property name="ignoreOverridden" value="true"/>
|
||||
</module>
|
||||
<module name="LambdaParameterName">
|
||||
<property name="format" value="^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"/>
|
||||
</module>
|
||||
<module name="CatchParameterName">
|
||||
<property name="format" value="^(ex|[a-z][a-z][a-zA-Z]+)$"/>
|
||||
</module>
|
||||
<module name="StaticVariableName">
|
||||
<property name="format" value="^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"/>
|
||||
</module>
|
||||
<module name="TypeName"/>
|
||||
<module name="PatternVariableName"/>
|
||||
<module name="IllegalIdentifierName"/>
|
||||
|
||||
<!-- Regexp -->
|
||||
<module name="Regexp">
|
||||
<property name="id" value="regexpDefault"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="id" value="regexpSingleLineDefault"/>
|
||||
</module>
|
||||
<module name="RegexpSinglelineJava">
|
||||
<property name="id" value="checkASCII"/>
|
||||
<property name="format" value="[^\p{ASCII}]"/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
|
||||
<!-- Size Violations -->
|
||||
<module name="AnonInnerLength"/>
|
||||
<module name="ExecutableStatementCount">
|
||||
<property name="max" value="30"/>
|
||||
</module>
|
||||
<module name="LambdaBodyLength"/>
|
||||
<module name="MethodCount">
|
||||
<property name="maxTotal" value="34"/>
|
||||
</module>
|
||||
<module name="MethodLength"/>
|
||||
<module name="OuterTypeNumber"/>
|
||||
<module name="ParameterNumber"/>
|
||||
<module name="RecordComponentNumber"/>
|
||||
|
||||
<!-- Whitespace -->
|
||||
<module name="EmptyForInitializerPad"/>
|
||||
<module name="EmptyForIteratorPad"/>
|
||||
<module name="EmptyLineSeparator">
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
|
||||
</module>
|
||||
<module name="GenericWhitespace"/>
|
||||
<module name="MethodParamPad"/>
|
||||
<module name="NoLineWrap"/>
|
||||
<module name="NoWhitespaceAfter">
|
||||
<property name="tokens" value="ARRAY_INIT"/>
|
||||
<property name="tokens" value="AT"/>
|
||||
<property name="tokens" value="BNOT"/>
|
||||
<property name="tokens" value="DEC"/>
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="tokens" value="INC"/>
|
||||
<property name="tokens" value="LNOT"/>
|
||||
<property name="tokens" value="UNARY_MINUS"/>
|
||||
<property name="tokens" value="UNARY_PLUS"/>
|
||||
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||
<property name="tokens" value="INDEX_OP"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
</module>
|
||||
<module name="NoWhitespaceBefore"/>
|
||||
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
|
||||
<module name="NoWhitespaceBefore">
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
<property name="allowLineBreaks" value="true"/>
|
||||
</module>
|
||||
<module name="OperatorWrap">
|
||||
<property name="tokens" value="QUESTION"/>
|
||||
<property name="tokens" value="COLON"/>
|
||||
<property name="tokens" value="EQUAL"/>
|
||||
<property name="tokens" value="NOT_EQUAL"/>
|
||||
<property name="tokens" value="DIV"/>
|
||||
<property name="tokens" value="PLUS"/>
|
||||
<property name="tokens" value="MINUS"/>
|
||||
<property name="tokens" value="STAR"/>
|
||||
<property name="tokens" value="MOD"/>
|
||||
<property name="tokens" value="SR"/>
|
||||
<property name="tokens" value="BSR"/>
|
||||
<property name="tokens" value="GE"/>
|
||||
<property name="tokens" value="GT"/>
|
||||
<property name="tokens" value="SL"/>
|
||||
<property name="tokens" value="LE"/>
|
||||
<property name="tokens" value="LT"/>
|
||||
<property name="tokens" value="BXOR"/>
|
||||
<property name="tokens" value="BOR"/>
|
||||
<property name="tokens" value="LOR"/>
|
||||
<property name="tokens" value="BAND"/>
|
||||
<property name="tokens" value="LAND"/>
|
||||
<property name="tokens" value="TYPE_EXTENSION_AND"/>
|
||||
<property name="tokens" value="LITERAL_INSTANCEOF"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="OperatorWrap">
|
||||
<property name="tokens" value="ASSIGN"/>
|
||||
<property name="tokens" value="DIV_ASSIGN"/>
|
||||
<property name="tokens" value="PLUS_ASSIGN"/>
|
||||
<property name="tokens" value="MINUS_ASSIGN"/>
|
||||
<property name="tokens" value="STAR_ASSIGN"/>
|
||||
<property name="tokens" value="MOD_ASSIGN"/>
|
||||
<property name="tokens" value="SR_ASSIGN"/>
|
||||
<property name="tokens" value="BSR_ASSIGN"/>
|
||||
<property name="tokens" value="SL_ASSIGN"/>
|
||||
<property name="tokens" value="BXOR_ASSIGN"/>
|
||||
<property name="tokens" value="BOR_ASSIGN"/>
|
||||
<property name="tokens" value="BAND_ASSIGN"/>
|
||||
<property name="option" value="eol"/>
|
||||
</module>
|
||||
<module name="ParenPad"/>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="tokens" value="AT"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="tokens" value="COMMA"/>
|
||||
<property name="tokens" value="RBRACK"/>
|
||||
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||
<property name="tokens" value="ELLIPSIS"/>
|
||||
<property name="tokens" value="SEMI"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SingleSpaceSeparator">
|
||||
<property name="validateComments" value="false"/>
|
||||
</module>
|
||||
<module name="TypecastParenPad"/>
|
||||
<module name="WhitespaceAfter"/>
|
||||
<module name="WhitespaceAround"/>
|
||||
|
||||
</module>
|
||||
|
||||
</module>
|
||||
358
config/checkstyle/google_checks.xml
Normal file
358
config/checkstyle/google_checks.xml
Normal file
@@ -0,0 +1,358 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!--
|
||||
Checkstyle configuration that checks the Google coding conventions from Google Java Style
|
||||
that can be found at https://google.github.io/styleguide/javaguide.html
|
||||
|
||||
Checkstyle is very configurable. Be sure to read the documentation at
|
||||
http://checkstyle.org (or in your downloaded distribution).
|
||||
|
||||
To completely disable a check, just comment it out or delete it from the file.
|
||||
To suppress certain violations please review suppression filters.
|
||||
|
||||
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
||||
-->
|
||||
|
||||
<module name = "Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
|
||||
<property name="severity" value="warning"/>
|
||||
|
||||
<property name="fileExtensions" value="java, properties, xml"/>
|
||||
<!-- Excludes all 'module-info.java' files -->
|
||||
<!-- See https://checkstyle.org/config_filefilters.html -->
|
||||
<module name="BeforeExecutionExclusionFileFilter">
|
||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
||||
</module>
|
||||
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="suppressions.xml"
|
||||
default="checkstyle-suppressions.xml" />
|
||||
<property name="optional" value="true"/>
|
||||
</module>
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.org/config_whitespace.html -->
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="LineLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="max" value="100"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||
<property name="format"
|
||||
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
||||
<property name="message"
|
||||
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
|
||||
</module>
|
||||
<module name="AvoidEscapedUnicodeCharacters">
|
||||
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||
<property name="allowByTailComment" value="true"/>
|
||||
<property name="allowNonPrintableEscapes" value="true"/>
|
||||
</module>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
<module name="NoLineWrap">
|
||||
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
|
||||
</module>
|
||||
<module name="EmptyBlock">
|
||||
<property name="option" value="TEXT"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||
</module>
|
||||
<module name="NeedBraces">
|
||||
<property name="tokens"
|
||||
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE"/>
|
||||
</module>
|
||||
<module name="LeftCurly">
|
||||
<property name="tokens"
|
||||
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
|
||||
INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
|
||||
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
|
||||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
|
||||
OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlySame"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
|
||||
LITERAL_DO"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlyAlone"/>
|
||||
<property name="option" value="alone"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
|
||||
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF,
|
||||
COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="SuppressionXpathSingleFilter">
|
||||
<!-- suppresion is required till https://github.com/checkstyle/checkstyle/issues/7541 -->
|
||||
<property name="id" value="RightCurlyAlone"/>
|
||||
<property name="query" value="//RCURLY[parent::SLIST[count(./*)=1]
|
||||
or preceding-sibling::*[last()][self::LCURLY]]"/>
|
||||
</module>
|
||||
<module name="WhitespaceAfter">
|
||||
<property name="tokens"
|
||||
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE,
|
||||
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
|
||||
</module>
|
||||
<module name="WhitespaceAround">
|
||||
<property name="allowEmptyConstructors" value="true"/>
|
||||
<property name="allowEmptyLambdas" value="true"/>
|
||||
<property name="allowEmptyMethods" value="true"/>
|
||||
<property name="allowEmptyTypes" value="true"/>
|
||||
<property name="allowEmptyLoops" value="true"/>
|
||||
<property name="ignoreEnhancedForColon" value="false"/>
|
||||
<property name="tokens"
|
||||
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
|
||||
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
|
||||
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
|
||||
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
|
||||
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
|
||||
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
|
||||
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
|
||||
<message key="ws.notFollowed"
|
||||
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||
<message key="ws.notPreceded"
|
||||
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="OneStatementPerLine"/>
|
||||
<module name="MultipleVariableDeclarations"/>
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="FallThrough"/>
|
||||
<module name="UpperEll"/>
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="EmptyLineSeparator">
|
||||
<property name="tokens"
|
||||
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
|
||||
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF,
|
||||
COMPACT_CTOR_DEF"/>
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapDot"/>
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapComma"/>
|
||||
<property name="tokens" value="COMMA"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/259 -->
|
||||
<property name="id" value="SeparatorWrapEllipsis"/>
|
||||
<property name="tokens" value="ELLIPSIS"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/258 -->
|
||||
<property name="id" value="SeparatorWrapArrayDeclarator"/>
|
||||
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapMethodRef"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="PackageName">
|
||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="TypeName">
|
||||
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
|
||||
ANNOTATION_DEF, RECORD_DEF"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MemberName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LambdaParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="CatchParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LocalVariableName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="PatternVariableName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Pattern variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ClassTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="RecordComponentName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Record component name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="RecordTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Record type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MethodTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="InterfaceTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="NoFinalizer"/>
|
||||
<module name="GenericWhitespace">
|
||||
<message key="ws.followed"
|
||||
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
||||
<message key="ws.preceded"
|
||||
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
||||
<message key="ws.illegalFollow"
|
||||
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
||||
<message key="ws.notPreceded"
|
||||
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="Indentation">
|
||||
<property name="basicOffset" value="2"/>
|
||||
<property name="braceAdjustment" value="2"/>
|
||||
<property name="caseIndent" value="2"/>
|
||||
<property name="throwsIndent" value="4"/>
|
||||
<property name="lineWrappingIndentation" value="4"/>
|
||||
<property name="arrayInitIndent" value="2"/>
|
||||
</module>
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="false"/>
|
||||
<property name="allowedAbbreviationLength" value="0"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
|
||||
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF,
|
||||
RECORD_COMPONENT_DEF"/>
|
||||
</module>
|
||||
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="VariableDeclarationUsageDistance"/>
|
||||
<module name="CustomImportOrder">
|
||||
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||
<property name="separateLineBetweenGroups" value="true"/>
|
||||
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
|
||||
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
|
||||
</module>
|
||||
<module name="MethodParamPad">
|
||||
<property name="tokens"
|
||||
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
|
||||
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF"/>
|
||||
</module>
|
||||
<module name="NoWhitespaceBefore">
|
||||
<property name="tokens"
|
||||
value="COMMA, SEMI, POST_INC, POST_DEC, DOT,
|
||||
LABELED_STAT, METHOD_REF"/>
|
||||
<property name="allowLineBreaks" value="true"/>
|
||||
</module>
|
||||
<module name="ParenPad">
|
||||
<property name="tokens"
|
||||
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
|
||||
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
|
||||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
|
||||
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA,
|
||||
RECORD_DEF"/>
|
||||
</module>
|
||||
<module name="OperatorWrap">
|
||||
<property name="option" value="NL"/>
|
||||
<property name="tokens"
|
||||
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
|
||||
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF,
|
||||
TYPE_EXTENSION_AND "/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationMostCases"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF,
|
||||
RECORD_DEF, COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationVariables"/>
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||
</module>
|
||||
<module name="NonEmptyAtclauseDescription"/>
|
||||
<module name="InvalidJavadocPosition"/>
|
||||
<module name="JavadocTagContinuationIndentation"/>
|
||||
<module name="SummaryJavadoc">
|
||||
<property name="forbiddenSummaryFragments"
|
||||
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||
</module>
|
||||
<module name="JavadocParagraph"/>
|
||||
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
|
||||
<module name="AtclauseOrder">
|
||||
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||
<property name="target"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||
</module>
|
||||
<module name="JavadocMethod">
|
||||
<property name="accessModifiers" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="MissingJavadocMethod">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="minLineCount" value="2"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF,
|
||||
COMPACT_CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="MissingJavadocType">
|
||||
<property name="scope" value="protected"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
|
||||
RECORD_DEF, ANNOTATION_DEF"/>
|
||||
<property name="excludeScope" value="nothing"/>
|
||||
</module>
|
||||
<module name="MethodName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Method name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="SingleLineJavadoc"/>
|
||||
<module name="EmptyCatchBlock">
|
||||
<property name="exceptionVariableName" value="expected"/>
|
||||
</module>
|
||||
<module name="CommentsIndentation">
|
||||
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
198
config/checkstyle/sun_checks.xml
Normal file
198
config/checkstyle/sun_checks.xml
Normal file
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!--
|
||||
|
||||
Checkstyle configuration that checks the sun coding conventions from:
|
||||
|
||||
- the Java Language Specification at
|
||||
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
|
||||
|
||||
- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
|
||||
|
||||
- the Javadoc guidelines at
|
||||
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
|
||||
|
||||
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
|
||||
|
||||
- some best practices
|
||||
|
||||
Checkstyle is very configurable. Be sure to read the documentation at
|
||||
https://checkstyle.org (or in your downloaded distribution).
|
||||
|
||||
Most Checks are configurable, be sure to consult the documentation.
|
||||
|
||||
To completely disable a check, just comment it out or delete it from the file.
|
||||
To suppress certain violations please review suppression filters.
|
||||
|
||||
Finally, it is worth reading the documentation.
|
||||
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
<!--
|
||||
If you set the basedir property below, then all reported file
|
||||
names will be relative to the specified directory. See
|
||||
https://checkstyle.org/config.html#Checker
|
||||
|
||||
<property name="basedir" value="${basedir}"/>
|
||||
-->
|
||||
<property name="severity" value="error"/>
|
||||
|
||||
<property name="fileExtensions" value="java, properties, xml"/>
|
||||
|
||||
<!-- Excludes all 'module-info.java' files -->
|
||||
<!-- See https://checkstyle.org/config_filefilters.html -->
|
||||
<module name="BeforeExecutionExclusionFileFilter">
|
||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
||||
</module>
|
||||
|
||||
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
|
||||
default="suppressions.xml" />
|
||||
<property name="optional" value="true"/>
|
||||
</module>
|
||||
|
||||
<!-- Checks that a package-info.java file exists for each package. -->
|
||||
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
|
||||
<module name="JavadocPackage"/>
|
||||
|
||||
<!-- Checks whether files end with a new line. -->
|
||||
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
|
||||
<module name="NewlineAtEndOfFile"/>
|
||||
|
||||
<!-- Checks that property files contain the same keys. -->
|
||||
<!-- See https://checkstyle.org/config_misc.html#Translation -->
|
||||
<module name="Translation"/>
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See https://checkstyle.org/config_sizes.html -->
|
||||
<module name="FileLength"/>
|
||||
<module name="LineLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
</module>
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See https://checkstyle.org/config_whitespace.html -->
|
||||
<module name="FileTabCharacter"/>
|
||||
|
||||
<!-- Miscellaneous other checks. -->
|
||||
<!-- See https://checkstyle.org/config_misc.html -->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\s+$"/>
|
||||
<property name="minimum" value="0"/>
|
||||
<property name="maximum" value="0"/>
|
||||
<property name="message" value="Line has trailing spaces."/>
|
||||
</module>
|
||||
|
||||
<!-- Checks for Headers -->
|
||||
<!-- See https://checkstyle.org/config_header.html -->
|
||||
<!-- <module name="Header"> -->
|
||||
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
|
||||
<!-- <property name="fileExtensions" value="java"/> -->
|
||||
<!-- </module> -->
|
||||
|
||||
<module name="TreeWalker">
|
||||
|
||||
<!-- Checks for Javadoc comments. -->
|
||||
<!-- See https://checkstyle.org/config_javadoc.html -->
|
||||
<module name="InvalidJavadocPosition"/>
|
||||
<module name="JavadocMethod"/>
|
||||
<module name="JavadocType"/>
|
||||
<module name="JavadocVariable"/>
|
||||
<module name="JavadocStyle"/>
|
||||
<module name="MissingJavadocMethod"/>
|
||||
|
||||
<!-- Checks for Naming Conventions. -->
|
||||
<!-- See https://checkstyle.org/config_naming.html -->
|
||||
<module name="ConstantName"/>
|
||||
<module name="LocalFinalVariableName"/>
|
||||
<module name="LocalVariableName"/>
|
||||
<module name="MemberName"/>
|
||||
<module name="MethodName"/>
|
||||
<module name="PackageName"/>
|
||||
<module name="ParameterName"/>
|
||||
<module name="StaticVariableName"/>
|
||||
<module name="TypeName"/>
|
||||
|
||||
<!-- Checks for imports -->
|
||||
<!-- See https://checkstyle.org/config_imports.html -->
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports">
|
||||
<property name="processJavadoc" value="false"/>
|
||||
</module>
|
||||
|
||||
<!-- Checks for Size Violations. -->
|
||||
<!-- See https://checkstyle.org/config_sizes.html -->
|
||||
<module name="MethodLength"/>
|
||||
<module name="ParameterNumber"/>
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See https://checkstyle.org/config_whitespace.html -->
|
||||
<module name="EmptyForIteratorPad"/>
|
||||
<module name="GenericWhitespace"/>
|
||||
<module name="MethodParamPad"/>
|
||||
<module name="NoWhitespaceAfter"/>
|
||||
<module name="NoWhitespaceBefore"/>
|
||||
<module name="OperatorWrap"/>
|
||||
<module name="ParenPad"/>
|
||||
<module name="TypecastParenPad"/>
|
||||
<module name="WhitespaceAfter"/>
|
||||
<module name="WhitespaceAround"/>
|
||||
|
||||
<!-- Modifier Checks -->
|
||||
<!-- See https://checkstyle.org/config_modifier.html -->
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="RedundantModifier"/>
|
||||
|
||||
<!-- Checks for blocks. You know, those {}'s -->
|
||||
<!-- See https://checkstyle.org/config_blocks.html -->
|
||||
<module name="AvoidNestedBlocks"/>
|
||||
<module name="EmptyBlock"/>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="RightCurly"/>
|
||||
|
||||
<!-- Checks for common coding problems -->
|
||||
<!-- See https://checkstyle.org/config_coding.html -->
|
||||
<module name="EmptyStatement"/>
|
||||
<module name="EqualsHashCode"/>
|
||||
<module name="HiddenField"/>
|
||||
<module name="IllegalInstantiation"/>
|
||||
<module name="InnerAssignment"/>
|
||||
<module name="MagicNumber"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="MultipleVariableDeclarations"/>
|
||||
<module name="SimplifyBooleanExpression"/>
|
||||
<module name="SimplifyBooleanReturn"/>
|
||||
|
||||
<!-- Checks for class design -->
|
||||
<!-- See https://checkstyle.org/config_design.html -->
|
||||
<module name="DesignForExtension"/>
|
||||
<module name="FinalClass"/>
|
||||
<module name="HideUtilityClassConstructor"/>
|
||||
<module name="InterfaceIsType"/>
|
||||
<module name="VisibilityModifier"/>
|
||||
|
||||
<!-- Miscellaneous other checks. -->
|
||||
<!-- See https://checkstyle.org/config_misc.html -->
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<module name="FinalParameters"/>
|
||||
<module name="TodoComment"/>
|
||||
<module name="UpperEll"/>
|
||||
|
||||
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
|
||||
<module name="SuppressionXpathFilter">
|
||||
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
|
||||
default="checkstyle-xpath-suppressions.xml" />
|
||||
<property name="optional" value="true"/>
|
||||
</module>
|
||||
|
||||
</module>
|
||||
|
||||
</module>
|
||||
659
config/checkstyle/suppressions.xml
Normal file
659
config/checkstyle/suppressions.xml
Normal file
@@ -0,0 +1,659 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
|
||||
<suppressions>
|
||||
<!-- can't split long messages between lines -->
|
||||
<suppress id="lineLengthXml" files="google_checks\.xml" lines="56,126"/>
|
||||
<!-- don't validate generated files -->
|
||||
<suppress id="lineLengthXml" files="releasenotes\.xml"/>
|
||||
<suppress id="lineLengthXml" files="[\\/]meta[\\/]"/>
|
||||
|
||||
<suppress checks="FileLength"
|
||||
files="TokenTypes.java|IndentationCheckTest.java"
|
||||
lines="1"/>
|
||||
|
||||
<!-- illegal words are part of Javadoc -->
|
||||
<suppress checks="TodoComment" files=".*TodoCommentCheck\.java"/>
|
||||
|
||||
<!-- 'Abstract' pattern is used to show it is checking for abstract class name -->
|
||||
<suppress checks="AbstractClassNameCheck"
|
||||
files="AbstractClassNameCheck.java"/>
|
||||
<!-- test should be named as their main class -->
|
||||
<suppress checks="AbstractClassNameCheck"
|
||||
files="AbstractCheckTest.java|AbstractClassNameCheckTest.java|
|
||||
|AbstractJavadocCheckTest.java|
|
||||
|AbstractViolationReporterTest.java|AbstractFileSetCheckTest.java"/>
|
||||
|
||||
<!-- Tone down the checking for test code -->
|
||||
<suppress checks="ExecutableStatementCount|JavaNCSS|BooleanExpressionComplexity|
|
||||
|NestedIfDepth|MethodLength"
|
||||
files="[\\/]XdocsPagesTest\.java"/>
|
||||
|
||||
<!-- till https://github.com/checkstyle/checkstyle/issues/6336 -->
|
||||
<suppress checks="JavadocMethod" files=".*AbstractIndentationTestSupport\.java"/>
|
||||
<suppress checks="JavadocMethod" files=".*AbstractModuleTestSupport\.java"/>
|
||||
<suppress checks="JavadocMethod" files=".*AbstractXpathTestSupport\.java"/>
|
||||
<suppress checks="JavadocMethod" files=".*AbstractModuleTestSupport\.java"/>
|
||||
<suppress checks="JavadocMethod" files=".*AbstractPathTestSupport\.java"/>
|
||||
<suppress checks="JavadocMethod" files=".*AbstractXmlTestSupport\.java"/>
|
||||
|
||||
<!-- The Check generates too many violations, fixing them will make code unmanageable. -->
|
||||
<suppress checks="MagicNumber" files="(ParseTreeTablePresentation|MainFrame)\.java"/>
|
||||
|
||||
<!-- Methods that build fake AST are very long -->
|
||||
<suppress checks="MethodLength" files=".*(Generated)?Java(doc)?TokenTypesTest\.java"/>
|
||||
<suppress checks="ExecutableStatementCount"
|
||||
files=".*(Generated)?Java(doc)?TokenTypesTest\.java"/>
|
||||
<suppress checks="JavaNCSS" files=".*(Generated)?Java(doc)?TokenTypesTest\.java"/>
|
||||
<suppress checks="ExecutableStatementCount" files=".*IllegalInstantiationCheckTest\.java"/>
|
||||
<suppress checks="ExecutableStatementCount" files=".*Main\.java"/>
|
||||
|
||||
<!-- Till https://github.com/checkstyle/checkstyle/issues/1854 -->
|
||||
<suppress checks="TrailingComment"
|
||||
files="(InnerAssignmentCheck\.java|OperatorWrapCheck\.java|
|
||||
|AbbreviationAsWordInNameCheckTest\.java)"/>
|
||||
|
||||
<!-- Fixing these cases will decrease code readability -->
|
||||
<suppress checks="MultipleStringLiterals" files="JavadocStyleCheck\.java|XMLLogger\.java|SarifLogger\.java"/>
|
||||
|
||||
<!-- There are a lot of setters/getters in the Check.
|
||||
A small number of methods is left for Check's logic -->
|
||||
<suppress checks="MethodCount" files="[\\/]JavadocMethodCheck.java$"/>
|
||||
<!-- Apart from a complex logic there is a lot of small methods for a better readability. -->
|
||||
<suppress checks="MethodCount" files="[\\/]CommentsIndentationCheck.java$"/>
|
||||
<!-- VisibilityModifierCheck has 7 options which require 7 additional methods (setters) -->
|
||||
<suppress checks="MethodCount" files="[\\/]VisibilityModifierCheck.java$"/>
|
||||
<!-- RequireThisCheck has a hierarchy of nested classes which contains a lot of methods. -->
|
||||
<suppress checks="MethodCount" files="[\\/]RequireThisCheck.java$"/>
|
||||
|
||||
<!-- we need that set of converters -->
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="AutomaticBean\.java"/>
|
||||
<!-- they are aggregators of logic, usage a several of classes are ok -->
|
||||
<suppress checks="ClassDataAbstractionCoupling"
|
||||
files="(Checker|Main|CheckstyleAntTask|JavadocDetailNodeParser)\.java"/>
|
||||
<suppress checks="ClassDataAbstractionCoupling"
|
||||
files="(CheckerTest|AbstractModuleTestSupport|AbstractItModuleTestSupport|
|
||||
|CheckstyleAntTaskTest|DefaultLoggerTest|
|
||||
|TranslationCheckTest|ViolationTest|AbstractFileSetCheckTest|
|
||||
|AbstractCheckTest|AutomaticBeanTest)\.java"/>
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="PropertyCacheFileTest\.java"/>
|
||||
<suppress checks="ClassDataAbstractionCoupling"
|
||||
files="XpathFileGeneratorAuditListenerTest\.java"/>
|
||||
<suppress checks="ClassFanOutComplexity" files="[\\/]Main\.java"/>
|
||||
<suppress checks="ClassFanOutComplexity" files="CheckstyleAntTask\.java"/>
|
||||
<suppress checks="ClassFanOutComplexity" files="CheckerTest\.java"/>
|
||||
<suppress checks="ClassFanOutComplexity" files="Checker\.java"/>
|
||||
<!-- a lot of GUI elements is OK -->
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="(TreeTable|MainFrame)\.java"/>
|
||||
|
||||
<!-- Should be fixed after moving
|
||||
https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/master/sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/ReturnCountExtendedCheck.java
|
||||
into the main repo, to allow skip guard sentences(or by topLinesToIgnoreCount) -->
|
||||
<suppress checks="ReturnCount" files="(ConfigurationLoader|LambdaHandler)\.java"/>
|
||||
|
||||
<!-- HandlerFactory crosses allowed limit for executable statements -->
|
||||
<suppress checks="ExecutableStatementCount" files="HandlerFactory\.java"/>
|
||||
|
||||
<suppress id="ImportControlTest" files="[\\/]powermock[\\/]"
|
||||
message=".* - org\.(powermock|mockito).*" />
|
||||
|
||||
<suppress id="noSourceforgeNetLinks" files="[\\/]releasenotes.xml"/>
|
||||
<suppress id="noSourceforgeIoLinks" files="[\\/]google_style.xml" lines="31"/>
|
||||
<suppress id="noSourceforgeIoLinks" files="[\\/]sun_style.xml" lines="31"/>
|
||||
<suppress id="noSourceforgeIoLinks" files="[\\/]index.xml.vm"/>
|
||||
|
||||
<!-- usage of div class="wrap-content" render even indented content properly -->
|
||||
<suppress id="noIndentationConfigExamples" files="[\\/]src[\\/]xdocs[\\/]writingchecks.xml"/>
|
||||
<suppress id="noIndentationConfigExamples"
|
||||
files="[\\/]src[\\/]xdocs[\\/]beginning_development.xml"/>
|
||||
|
||||
<!-- until https://github.com/checkstyle/checkstyle/issues/5234 -->
|
||||
<suppress id="MatchXPathBranchContains" files="[\\/]DetailAstImplTest.java"/>
|
||||
|
||||
<!-- until https://github.com/checkstyle/checkstyle/issues/9142 -->
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]it[\\/]java[\\/]org[\\/]checkstyle[\\/]base[\\/]AbstractItModuleTestSupport.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]it[\\/]java[\\/]org[\\/]checkstyle[\\/]suppressionxpathfilter[\\/]AbstractXpathTestSupport.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]AbstractXmlTestSupport.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]AstTreeStringPrinterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]AuditEventDefaultFormatterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]CheckerTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]ConfigurationLoaderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]DefaultConfigurationTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]DefaultLoggerTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]DefinitionsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]DetailAstImplTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]DetailNodeTreeStringPrinterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]JavaParserTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]JavadocDetailNodeParserTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]JavadocPropertiesGeneratorTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]MainTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]PackageNamesLoaderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]PackageObjectFactoryTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]PropertiesExpanderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]PropertyCacheFileTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]SarifLoggerTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]SuppressionsStringPrinterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]ThreadModeSettingsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]TreeWalkerTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]XMLLoggerTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]XmlLoaderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]XpathFileGeneratorAstFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]XpathFileGeneratorAuditListenerTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]ant[\\/]CheckstyleAntTaskTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]AbstractCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]FullIdentTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]JavadocTokenTypesTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]ScopeTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]SeverityLevelCounterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]SeverityLevelTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]TokenTypesTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]api[\\/]ViolationTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]ArrayTypeStyleCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]AvoidEscapedUnicodeCharactersCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]NewlineAtEndOfFileCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]OrderedPropertiesCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]OuterTypeFilenameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]SuppressWarningsHolderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]TodoCommentCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]TrailingCommentCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]TranslationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]UncommentedMainCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]UniquePropertiesCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]UpperEllCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]annotation[\\/]AnnotationLocationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]annotation[\\/]AnnotationOnSameLineCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]annotation[\\/]AnnotationUseStyleCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]annotation[\\/]MissingDeprecatedCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]annotation[\\/]MissingOverrideCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]annotation[\\/]PackageAnnotationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]blocks[\\/]AvoidNestedBlocksCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]blocks[\\/]EmptyBlockCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]blocks[\\/]EmptyCatchBlockCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]blocks[\\/]LeftCurlyCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]blocks[\\/]RightCurlyCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]ArrayTrailingCommaCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]AvoidDoubleBraceInitializationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]AvoidInlineConditionalsCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]AvoidNoArgumentSuperConstructorCallCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]CovariantEqualsCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]DeclarationOrderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]DefaultComesLastCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]EmptyStatementCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]EqualsHashCodeCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]EqualsAvoidNullCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]ExplicitInitializationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]FallThroughCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]FinalLocalVariableCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]HiddenFieldCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]IllegalCatchCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]IllegalInstantiationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]IllegalThrowsCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]IllegalTokenTextCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]IllegalTypeCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]InnerAssignmentCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]MissingCtorCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]MissingSwitchDefaultCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]ModifiedControlVariableCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]MultipleStringLiteralsCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]MultipleVariableDeclarationsCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NestedForDepthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NestedIfDepthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NestedTryDepthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NoArrayTrailingCommaCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NoCloneCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NoEnumTrailingCommaCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]NoFinalizerCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]OneStatementPerLineCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]OverloadMethodsDeclarationOrderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]PackageDeclarationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]ParameterAssignmentCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]RequireThisCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]ReturnCountCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]SimplifyBooleanExpressionCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]SimplifyBooleanReturnCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]StringLiteralEqualityCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]SuperCloneCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]UnnecessaryParenthesesCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]UnnecessarySemicolonInEnumerationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]UnnecessarySemicolonInTryWithResourcesCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]coding[\\/]VariableDeclarationUsageDistanceCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]DesignForExtensionCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]FinalClassCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]HideUtilityClassConstructorCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]InnerTypeLastCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]InterfaceIsTypeCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]MutableExceptionCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]OneTopLevelClassCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]ThrowsCountCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]design[\\/]VisibilityModifierCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]header[\\/]HeaderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]header[\\/]RegexpHeaderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]AccessResultTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]AvoidStarImportCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]AvoidStaticImportCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]ClassImportRuleTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]CustomImportOrderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]FileImportControlTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]IllegalImportCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]ImportControlCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]ImportControlLoaderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]ImportOrderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]PkgImportControlTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]PkgImportRuleTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]RedundantImportCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]imports[\\/]UnusedImportsCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]indentation[\\/]CommentsIndentationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]indentation[\\/]IndentationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]AbstractJavadocCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]InvalidJavadocPositionCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocBlockTagLocationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocContentLocationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocMethodCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocMissingLeadingAsteriskCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocMissingWhitespaceAfterAsteriskCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocNodeImplTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocPackageCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocParagraphCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocStyleCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocTagContinuationIndentationCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocTagInfoTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocTagTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocTypeCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]JavadocVariableCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]MissingJavadocMethodCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]MissingJavadocPackageCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]MissingJavadocTypeCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]NonEmptyAtclauseDescriptionCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]RequireEmptyLineBeforeBlockTagGroupCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]SingleLineJavadocCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]SummaryJavadocCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]WriteTagCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]utils[\\/]BlockTagUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]utils[\\/]InlineTagUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]metrics[\\/]BooleanExpressionComplexityCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]metrics[\\/]ClassDataAbstractionCouplingCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]metrics[\\/]ClassFanOutComplexityCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]metrics[\\/]CyclomaticComplexityCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]metrics[\\/]JavaNCSSCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]metrics[\\/]NPathComplexityCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]modifier[\\/]ClassMemberImpliedModifierCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]modifier[\\/]InterfaceMemberImpliedModifierCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]modifier[\\/]ModifierOrderCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]modifier[\\/]RedundantModifierCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]AbstractClassNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]CatchParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]ClassTypeParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]ConstantNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]IllegalIdentifierNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]InterfaceTypeParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]LambdaParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]LocalFinalVariableNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]LocalVariableNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]MemberNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]MethodNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]MethodTypeParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]PackageNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]ParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]PatternVariableNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]RecordComponentNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]RecordTypeParameterNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]naming[\\/]StaticVariableNameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]regexp[\\/]RegexpCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]regexp[\\/]RegexpMultilineCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]regexp[\\/]RegexpOnFilenameCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]regexp[\\/]RegexpSinglelineCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]regexp[\\/]RegexpSinglelineJavaCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]AnonInnerLengthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]ExecutableStatementCountCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]FileLengthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]LambdaBodyLengthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]MethodCountCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]MethodLengthCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]OuterTypeNumberCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]ParameterNumberCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]sizes[\\/]RecordComponentNumberCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]EmptyForInitializerPadCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]EmptyForIteratorPadCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]EmptyLineSeparatorCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]GenericWhitespaceCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]MethodParamPadCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]NoWhitespaceAfterCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]OperatorWrapCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]ParenPadCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]SeparatorWrapCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]SingleSpaceSeparatorCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]TypecastParenPadCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]WhitespaceAfterCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]whitespace[\\/]WhitespaceAroundCheckTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filefilters[\\/]BeforeExecutionExclusionFileFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]CsvFilterElementTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]IntMatchFilterElementTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]IntRangeFilterElementTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SeverityMatchFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressFilterElementTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressWithNearbyCommentFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressWithPlainTextCommentFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressionCommentFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressionFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressionXpathFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressionXpathSingleFilterTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]SuppressionsLoaderTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]filters[\\/]XpathFilterElementTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammar[\\/]AstRegressionTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammar[\\/]GeneratedJavaTokenTypesTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammar[\\/]comments[\\/]AllBlockCommentsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammar[\\/]comments[\\/]AllSinglelineCommentsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammar[\\/]comments[\\/]CommentsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammar[\\/]javadoc[\\/]GeneratedJavadocTokenTypesTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]gui[\\/]CodeSelectorPresentationTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]gui[\\/]MainFrameModelTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]gui[\\/]ParseTreeTablePresentationTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]AllChecksTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]AllTestsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]CommitValidationTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]XdocsJavaDocsTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]XdocsMobileWrapperTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]XdocsPagesTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]XpathRegressionTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]internal[\\/]utils[\\/]XmlUtil.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]meta[\\/]JavadocMetadataScraperTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]AnnotationUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]BlockCommentPositionTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]ChainedPropertyUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]CheckUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]CommonUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]FilterUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]JavadocUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]ModuleReflectionUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]ParserUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]ScopeUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]TokenUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]utils[\\/]XpathUtilTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]xpath[\\/]AttributeNodeTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]xpath[\\/]ElementNodeTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]xpath[\\/]RootNodeTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]xpath[\\/]XpathMapperTest.java"/>
|
||||
<suppress id="ImportControlTest"
|
||||
files="[\\/]src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]xpath[\\/]XpathQueryGeneratorTest.java"/>
|
||||
|
||||
<!-- required by JavaAstVisitor design -->
|
||||
<suppress checks="MethodCount"
|
||||
files="[\\/]src[\\/]main[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]JavaAstVisitor.java"/>
|
||||
<suppress checks="FileLength"
|
||||
files="[\\/]src[\\/]main[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]JavaAstVisitor.java"/>
|
||||
<suppress checks="ClassFanOutComplexity"
|
||||
files="[\\/]src[\\/]main[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]JavaAstVisitor.java"/>
|
||||
|
||||
<!-- DetailAST API requires large number of methods -->
|
||||
<suppress checks="MethodCount"
|
||||
files="[\\/]src[\\/]main[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]DetailAstImpl.java"/>
|
||||
</suppressions>
|
||||
337
config/formatter/eclipse-java-google-style.xml
Normal file
337
config/formatter/eclipse-java-google-style.xml
Normal file
@@ -0,0 +1,337 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="13">
|
||||
<profile kind="CodeFormatterProfile" name="GoogleStyle" version="13">
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent" value="16|-1|16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_comment_inline_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="1040"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent" value="1585|-1|1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent" value="16|-1|16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent" value="16|4|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent" value="16|4|48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent" value="16|4|49"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent" value="16|4|48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent" value="16|5|48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="100"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent" value="16|4|48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_field_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent" value="16|5|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent" value="1040|-1|1040"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent" value="1585|-1|1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.force_if_else_statement_brace" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="3"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent" value="16|-1|16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="1585"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class" value="20"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent" value="1585|-1|1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent" value="1585|-1|1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent" value="16|5|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent" value="16|-1|16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent" value="16|5|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent" value="16|4|48"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent" value="1585|-1|1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent" value="16|-1|16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="1585"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent" value="16|5|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent" value="16|-1|16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent" value="16|5|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent" value="16|5|80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_for_statement" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
111
config/pmd/ruleset.xml
Normal file
111
config/pmd/ruleset.xml
Normal file
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<ruleset name="Default Maven PMD Plugin Ruleset" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
|
||||
|
||||
<description>
|
||||
The default ruleset used by the Maven PMD Plugin, when no other ruleset is specified.
|
||||
It contains the rules of the old (pre PMD 6.0.0) rulesets java-basic, java-empty, java-imports,
|
||||
java-unnecessary, java-unusedcode.
|
||||
|
||||
This ruleset might be used as a starting point for an own customized ruleset [0].
|
||||
|
||||
[0] https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html
|
||||
</description>
|
||||
|
||||
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
|
||||
<rule ref="category/java/bestpractices.xml/CheckResultSet" />
|
||||
|
||||
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />
|
||||
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
|
||||
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
|
||||
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
|
||||
|
||||
<rule ref="category/java/codestyle.xml/ExtendsObject" />
|
||||
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
|
||||
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
|
||||
<rule ref="category/java/codestyle.xml/UselessParentheses" />
|
||||
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />
|
||||
|
||||
<rule ref="category/java/codestyle.xml/MethodNamingConventions">
|
||||
<properties>
|
||||
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*" />
|
||||
<property name="staticPattern" value="[a-z][a-zA-Z0-9]*" />
|
||||
<property name="nativePattern" value="[a-z][a-zA-Z0-9]*" />
|
||||
<property name="junit3TestPattern" value="test[A-Z0-9][a-zA-Z0-9]*" />
|
||||
<property name="junit4TestPattern" value="[a-z][a-zA-Z0-9]*" />
|
||||
<property name="junit5TestPattern" value="[a-z][a-zA-Z0-9]*" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/codestyle.xml/ClassNamingConventions" />
|
||||
|
||||
<rule ref="category/java/design.xml/CollapsibleIfStatements" />
|
||||
<rule ref="category/java/design.xml/SimplifiedTernary" />
|
||||
<rule ref="category/java/design.xml/UselessOverridingMethod" />
|
||||
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException" />
|
||||
|
||||
|
||||
<rule ref="category/java/design.xml/CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="classReportLevel" value="200" />
|
||||
<property name="methodReportLevel" value="120" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/design.xml/ExcessiveMethodLength" />
|
||||
|
||||
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
|
||||
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
|
||||
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators" />
|
||||
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues" />
|
||||
<rule ref="category/java/errorprone.xml/BrokenNullCheck" />
|
||||
<rule ref="category/java/errorprone.xml/CheckSkipResult" />
|
||||
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
|
||||
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
|
||||
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
|
||||
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
|
||||
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
|
||||
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
|
||||
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
|
||||
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
|
||||
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock" />
|
||||
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement" />
|
||||
<rule ref="category/java/errorprone.xml/UnnecessaryConversionTemporary" />
|
||||
<rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals" />
|
||||
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable" />
|
||||
|
||||
<!-- for Codazy -->
|
||||
<rule ref="category/java/multithreading.xml/AvoidThreadGroup" />
|
||||
<rule ref="category/java/multithreading.xml/DontCallThreadRun" />
|
||||
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking" />
|
||||
|
||||
<rule ref="category/java/performance.xml/BigIntegerInstantiation" />
|
||||
|
||||
<!-- for Codazy -->
|
||||
<!-- <rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody" /> -->
|
||||
</ruleset>
|
||||
15
config/spotbugs/spotBugsExcludeFilter.xml
Normal file
15
config/spotbugs/spotBugsExcludeFilter.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<FindBugsFilter
|
||||
xmlns="https://github.com/spotbugs/filter/3.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
|
||||
<Match>
|
||||
<Or>
|
||||
<Package name="net.sf.jsqlparser.parser" />
|
||||
<Source name="*java/test/*" />
|
||||
<Not>
|
||||
<Confidence value="1" />
|
||||
</Not>
|
||||
</Or>
|
||||
</Match>
|
||||
</FindBugsFilter>
|
||||
17
gradle.properties
Normal file
17
gradle.properties
Normal file
@@ -0,0 +1,17 @@
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1G -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError
|
||||
|
||||
org.gradle.caching=true
|
||||
|
||||
# Modularise your project and enable parallel build
|
||||
org.gradle.parallel=true
|
||||
|
||||
# Enable configure on demand.
|
||||
org.gradle.configureondemand=true
|
||||
|
||||
# see https://docs.gradle.org/current/userguide/upgrading_version_8.html#xml_parsing_now_requires_recent_parsers
|
||||
systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
|
||||
systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
|
||||
systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
249
gradlew
vendored
Normal file
249
gradlew
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
92
gradlew.bat
vendored
Normal file
92
gradlew.bat
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
32
nb-configuration.xml
Normal file
32
nb-configuration.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-shared-configuration>
|
||||
<!--
|
||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
||||
The configuration is intended to be shared among all the users of project and
|
||||
therefore it is assumed to be part of version control checkout.
|
||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
||||
-->
|
||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
||||
<!--
|
||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
||||
-->
|
||||
<netbeans.compile.on.save>none</netbeans.compile.on.save>
|
||||
<com-junichi11-netbeans-changelf.enable>false</com-junichi11-netbeans-changelf.enable>
|
||||
<com-junichi11-netbeans-changelf.use-project>true</com-junichi11-netbeans-changelf.use-project>
|
||||
<com-junichi11-netbeans-changelf.lf-kind>LF</com-junichi11-netbeans-changelf.lf-kind>
|
||||
<com-junichi11-netbeans-changelf.use-global>false</com-junichi11-netbeans-changelf.use-global>
|
||||
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
|
||||
<netbeans.hint.jdkPlatform>JDK_11</netbeans.hint.jdkPlatform>
|
||||
<org-netbeans-modules-editor-indent.text.xml.CodeStyle.project.expand-tabs>false</org-netbeans-modules-editor-indent.text.xml.CodeStyle.project.expand-tabs>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>120</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>
|
||||
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
|
||||
</properties>
|
||||
</project-shared-configuration>
|
||||
23
nbactions.xml
Normal file
23
nbactions.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<actions>
|
||||
<action>
|
||||
<actionName>CUSTOM-check-sign</actionName>
|
||||
<displayName>check-sign</displayName>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
<goal>install</goal>
|
||||
</goals>
|
||||
<properties>
|
||||
<performRelease>true</performRelease>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
</action>
|
||||
<action>
|
||||
<actionName>CUSTOM-clean deploy</actionName>
|
||||
<displayName>clean deploy</displayName>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</action>
|
||||
</actions>
|
||||
665
pom.xml
Normal file
665
pom.xml
Normal file
@@ -0,0 +1,665 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.fantaibao.jsqlparser</groupId>
|
||||
<artifactId>jsqlparser</artifactId>
|
||||
<version>5.0</version>
|
||||
<name>JSQLParser library</name>
|
||||
<inceptionYear>2004</inceptionYear>
|
||||
<organization>
|
||||
<name>JSQLParser</name>
|
||||
</organization>
|
||||
<packaging>bundle</packaging>
|
||||
<url>https://github.com/JSQLParser/JSqlParser</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>GNU Library or Lesser General Public License (LGPL) V2.1</name>
|
||||
<url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<dependencies>
|
||||
<!-- needed for parsing the Keywords via JTree in ParserKeywordsUtils -->
|
||||
<dependency>
|
||||
<groupId>net.java.dev.javacc</groupId>
|
||||
<artifactId>javacc</artifactId>
|
||||
<version>[7.0.13,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>[2.15.1,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>[5.10.2,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>[5.11.0,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<version>[5.11.0,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>[3.25.3,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>[3.14.0,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>[2.2.224,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- This is needed for the Validation Framework tests -->
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-all</artifactId>
|
||||
<version>1.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Tobias Warneke</name>
|
||||
<email>t.warneke@gmx.net</email>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<!-- <distributionManagement>-->
|
||||
<!-- <repository>-->
|
||||
<!-- <id>sonatype-nexus-staging</id>-->
|
||||
<!-- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>-->
|
||||
<!-- </repository>-->
|
||||
<!-- <snapshotRepository>-->
|
||||
<!-- <id>sonatype-nexus-snapshots</id>-->
|
||||
<!-- <url>https://oss.sonatype.org/content/repositories/snapshots/</url>-->
|
||||
<!-- </snapshotRepository>-->
|
||||
<!-- </distributionManagement>-->
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/JSQLParser/JSqlParser.git</connection>
|
||||
<developerConnection>scm:git:ssh://git@github.com:JSQLParser/JSqlParser.git</developerConnection>
|
||||
<url>https://github.com/JSQLParser/JSqlParser.git</url>
|
||||
<tag>jsqlparser-5.0</tag>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
<system>GitHub Issues</system>
|
||||
<url>https://github.com/JSQLParser/JSqlParser/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- Update they Keyword Whitelist in the Grammar's production RelObjectNameWithoutValue() -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<mainClass>net.sf.jsqlparser.parser.ParserKeywordsUtils</mainClass>
|
||||
<arguments>
|
||||
<argument>src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt</argument>
|
||||
<argument>src/site/sphinx/keywords.rst</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.21.2</version>
|
||||
<configuration>
|
||||
<rulesets>
|
||||
<!-- Custom local file system rule set -->
|
||||
<ruleset>${project.basedir}/config/pmd/ruleset.xml</ruleset>
|
||||
</rulesets>
|
||||
<excludes>
|
||||
<exclude>**/*Bean.java</exclude>
|
||||
<exclude>**/generated/*.java</exclude>
|
||||
</excludes>
|
||||
<excludeRoots>
|
||||
<excludeRoot>target/generated-sources</excludeRoot>
|
||||
<excludeRoot>target/generated-test-sources</excludeRoot>
|
||||
</excludeRoots>
|
||||
<printFailingErrors>true</printFailingErrors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pmd</id>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
<phase>process-sources</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.pmd</groupId>
|
||||
<artifactId>pmd-core</artifactId>
|
||||
<version>${pmdVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.pmd</groupId>
|
||||
<artifactId>pmd-java</artifactId>
|
||||
<version>${pmdVersion}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${project.build.directory}/generated-sources/javacc/</source>
|
||||
<source>${project.build.directory}/generated-sources/jjtree/</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<showWarnings>true</showWarnings>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.javacc.plugin</groupId>
|
||||
<artifactId>javacc-maven-plugin</artifactId>
|
||||
<version>3.0.3</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javacc</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>jjtree-javacc</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.java.dev.javacc</groupId>
|
||||
<artifactId>javacc</artifactId>
|
||||
<version>7.0.13</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
<configuration>
|
||||
<sourceIncludes>
|
||||
<sourceInclude>/target/generated-sources/javacc</sourceInclude>
|
||||
</sourceIncludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<configuration>
|
||||
<verbose>false</verbose>
|
||||
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
|
||||
<canUpdateDescription>false</canUpdateDescription>
|
||||
<licenseName>dual_lgpl_ap2</licenseName>
|
||||
<licenseResolver>${project.baseUri}/src/license</licenseResolver>
|
||||
<excludes>
|
||||
<exclude>site/sphinx/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>first</id>
|
||||
<goals>
|
||||
<goal>update-file-header</goal>
|
||||
</goals>
|
||||
<phase>process-sources</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<!--
|
||||
dont switch to version 3.0.1, that makes the strange certificate problems
|
||||
start maven release with -Dmaven.wagon.http.ssl.allowall=true since JDK 1.8
|
||||
does not have a complete truststore
|
||||
-->
|
||||
<version>3.0.0-M7</version>
|
||||
<configuration>
|
||||
<localCheckout>true</localCheckout>
|
||||
<pushChanges>false</pushChanges>
|
||||
<mavenExecutorId>forked-path</mavenExecutorId>
|
||||
<releaseProfiles>sign-release-artifacts</releaseProfiles>
|
||||
</configuration>
|
||||
<!--
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||
<version>1.9.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
-->
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<configuration>
|
||||
<additionalOptions>${javadoc.opts}</additionalOptions>
|
||||
<excludePackageNames>net.sf.jsqlparser.parser</excludePackageNames>
|
||||
<doclint>none</doclint>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Automatic-Module-Name>net.sf.jsqlparser</Automatic-Module-Name>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.12.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-descriptor</id>
|
||||
<goals>
|
||||
<goal>attach-descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<locales>en</locales>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.eluder.coveralls</groupId>
|
||||
<artifactId>coveralls-maven-plugin</artifactId>
|
||||
<version>4.3.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<configuration>
|
||||
<format>xml</format>
|
||||
<instrumentation>
|
||||
<excludes>
|
||||
<exclude>net/sf/jsqlparser/parser/*.class</exclude>
|
||||
<exclude>net/sf/jsqlparser/JSQLParserException.class</exclude>
|
||||
</excludes>
|
||||
</instrumentation>
|
||||
<check />
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>5.1.8</version>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.2.5</version>
|
||||
<configuration>
|
||||
<trimStackTrace>false</trimStackTrace>
|
||||
<!-- AlterViewTest does deep reflection -->
|
||||
<useModulePath>false</useModulePath>
|
||||
<argLine>
|
||||
--add-opens=java.base/java.lang=ALL-UNNAMED
|
||||
--add-opens=java.base/java.util=ALL-UNNAMED
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.10</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>2.28.0</version>
|
||||
<configuration>
|
||||
<!-- optional: limit format enforcement to just the files changed by this feature branch -->
|
||||
<ratchetFrom>origin/master</ratchetFrom>
|
||||
<formats>
|
||||
<!-- you can define as many formats as you want, each is independent -->
|
||||
<format>
|
||||
<!-- define the files to apply to -->
|
||||
<includes>
|
||||
<include>*.md</include>
|
||||
<include>.gitignore</include>
|
||||
</includes>
|
||||
<!-- define the steps to apply to those files -->
|
||||
<trimTrailingWhitespace />
|
||||
<endWithNewline />
|
||||
<indent>
|
||||
<tabs>true</tabs>
|
||||
<spacesPerTab>4</spacesPerTab>
|
||||
</indent>
|
||||
</format>
|
||||
</formats>
|
||||
<!-- define a language-specific format -->
|
||||
<java>
|
||||
<!-- These are the defaults, you can override if you want -->
|
||||
<includes>
|
||||
<include>src/main/java/**/*.java</include>
|
||||
<include>src/test/java/**/*.java</include>
|
||||
</includes>
|
||||
|
||||
<importOrder /> <!-- standard import order -->
|
||||
<removeUnusedImports />
|
||||
|
||||
<!-- Apply Google style guide https://google.github.io/styleguide/javaguide.html -->
|
||||
<eclipse>
|
||||
<file>config/formatter/eclipse-java-google-style.xml</file>
|
||||
</eclipse>
|
||||
|
||||
<formatAnnotations /> <!-- fixes formatting of type annotations, see below -->
|
||||
</java>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>net.sf.jsqlparser</pattern>
|
||||
<shadedPattern>com.fantaibao.jsqlparser</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
<version>3.0.0-M7</version>
|
||||
<configuration>
|
||||
<outputDirectory>${project.reporting.outputDirectory}/testresults</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<configuration>
|
||||
<useStandardDocletOptions>true</useStandardDocletOptions>
|
||||
<maxmemory>800m</maxmemory>
|
||||
<doclint>none</doclint>
|
||||
|
||||
<!-- Doclint does not work on the Test Sources
|
||||
<doclint>all,-missing</doclint>
|
||||
<excludePackageNames>net.sf.jsqlparser.parser</excludePackageNames>
|
||||
<sourceFileExcludes>
|
||||
<sourceFileExclude>src/test/**</sourceFileExclude>
|
||||
</sourceFileExcludes>
|
||||
-->
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.4.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>sign-release-artifacts</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>performRelease</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<keyname>f22e0543</keyname>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>check.sources</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>!skipCheckSources</name>
|
||||
</property>
|
||||
<jdk>[11,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>verify-style</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<logViolationsToConsole>true</logViolationsToConsole>
|
||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
<sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
|
||||
<excludes>**/module-info.java</excludes>
|
||||
<checkstyleRules>
|
||||
<module name="Checker">
|
||||
<module name="SuppressWarningsFilter" />
|
||||
<module name="FileTabCharacter" />
|
||||
<!-- git checkout may change linefeeds on the fly
|
||||
<module name="RegexpMultiline">
|
||||
<property name="format" value="(?s:(\r\n|\r).*)" />
|
||||
<property name="message" value="CRLF and CR line endings are prohibited, but this file uses them." />
|
||||
</module>
|
||||
-->
|
||||
<module name="TreeWalker">
|
||||
<module name="AvoidNestedBlocks" />
|
||||
<module name="ConstantName" />
|
||||
<module name="EmptyCatchBlock" />
|
||||
<module name="EmptyStatement" />
|
||||
<module name="MissingOverride" />
|
||||
<module name="MultipleVariableDeclarations" />
|
||||
<module name="ParameterAssignment" />
|
||||
<module name="StringLiteralEquality" />
|
||||
<module name="RedundantImport" />
|
||||
<module name="UnusedImports" />
|
||||
|
||||
<module name="WhitespaceAfter" />
|
||||
|
||||
<module name="NeedBraces" />
|
||||
<module name="UnnecessaryParentheses" />
|
||||
<module name="LeftCurly" />
|
||||
<module name="RightCurly" />
|
||||
|
||||
<module name="SuppressWarningsHolder" />
|
||||
</module>
|
||||
</module>
|
||||
</checkstyleRules>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
<version>${checkStyleVersion}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- for building the parser with debug flags -->
|
||||
<id>skip.all</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
<checkstyle.skip>true</checkstyle.skip>
|
||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
||||
<license.skipUpdateLicense>true</license.skipUpdateLicense>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<pmdVersion>6.55.0</pmdVersion>
|
||||
<checkStyleVersion>10.14.0</checkStyleVersion>
|
||||
</properties>
|
||||
|
||||
<!--增加私服仓库配置-->
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<!--必须与 settings.xml 的 id 一致-->
|
||||
<id>fantaibao-fantaibao-maven-repository</id>
|
||||
<name>maven-repository</name>
|
||||
<url>http://192.168.3.25:18081/nexus/repository/maven-releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<description>JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes.
|
||||
The generated hierarchy can be navigated using the Visitor Pattern.</description>
|
||||
</project>
|
||||
5
settings.gradle
Normal file
5
settings.gradle
Normal file
@@ -0,0 +1,5 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
|
||||
rootProject.name = 'JSQLFormatter'
|
||||
1
src/license/dual_lgpl_ap2/header.txt
Normal file
1
src/license/dual_lgpl_ap2/header.txt
Normal file
@@ -0,0 +1 @@
|
||||
Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
710
src/license/dual_lgpl_ap2/license.txt
Normal file
710
src/license/dual_lgpl_ap2/license.txt
Normal file
@@ -0,0 +1,710 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
(This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.)
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{description}
|
||||
Copyright (C) {year} {fullname}
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random
|
||||
Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
*********************************************************************************************
|
||||
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
10
src/license/licenses.properties
Normal file
10
src/license/licenses.properties
Normal file
@@ -0,0 +1,10 @@
|
||||
###
|
||||
# #%L
|
||||
# JSQLParser library
|
||||
# %%
|
||||
# Copyright (C) 2004 - 2019 JSQLParser
|
||||
# %%
|
||||
# Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
# #L%
|
||||
###
|
||||
dual_lgpl_ap2=Dual License GNU LGPL 2.1 or Apache License 2.0
|
||||
55
src/main/java/module-info.java
Normal file
55
src/main/java/module-info.java
Normal file
@@ -0,0 +1,55 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2024 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
module net.sf.jsqlparser {
|
||||
requires java.sql;
|
||||
requires java.logging;
|
||||
|
||||
exports net.sf.jsqlparser;
|
||||
exports net.sf.jsqlparser.expression;
|
||||
exports net.sf.jsqlparser.expression.operators.arithmetic;
|
||||
exports net.sf.jsqlparser.expression.operators.conditional;
|
||||
exports net.sf.jsqlparser.expression.operators.relational;
|
||||
exports net.sf.jsqlparser.parser;
|
||||
exports net.sf.jsqlparser.parser.feature;
|
||||
exports net.sf.jsqlparser.schema;
|
||||
exports net.sf.jsqlparser.statement;
|
||||
exports net.sf.jsqlparser.statement.alter;
|
||||
exports net.sf.jsqlparser.statement.alter.sequence;
|
||||
exports net.sf.jsqlparser.statement.analyze;
|
||||
exports net.sf.jsqlparser.statement.comment;
|
||||
exports net.sf.jsqlparser.statement.create.function;
|
||||
exports net.sf.jsqlparser.statement.create.index;
|
||||
exports net.sf.jsqlparser.statement.create.procedure;
|
||||
exports net.sf.jsqlparser.statement.create.schema;
|
||||
exports net.sf.jsqlparser.statement.create.sequence;
|
||||
exports net.sf.jsqlparser.statement.create.synonym;
|
||||
exports net.sf.jsqlparser.statement.create.table;
|
||||
exports net.sf.jsqlparser.statement.create.view;
|
||||
exports net.sf.jsqlparser.statement.delete;
|
||||
exports net.sf.jsqlparser.statement.drop;
|
||||
exports net.sf.jsqlparser.statement.execute;
|
||||
exports net.sf.jsqlparser.statement.grant;
|
||||
exports net.sf.jsqlparser.statement.insert;
|
||||
exports net.sf.jsqlparser.statement.merge;
|
||||
exports net.sf.jsqlparser.statement.refresh;
|
||||
exports net.sf.jsqlparser.statement.select;
|
||||
exports net.sf.jsqlparser.statement.show;
|
||||
exports net.sf.jsqlparser.statement.truncate;
|
||||
exports net.sf.jsqlparser.statement.update;
|
||||
exports net.sf.jsqlparser.statement.upsert;
|
||||
exports net.sf.jsqlparser.util;
|
||||
exports net.sf.jsqlparser.util.cnfexpression;
|
||||
exports net.sf.jsqlparser.util.deparser;
|
||||
exports net.sf.jsqlparser.util.validation;
|
||||
exports net.sf.jsqlparser.util.validation.allowedtypes;
|
||||
exports net.sf.jsqlparser.util.validation.feature;
|
||||
exports net.sf.jsqlparser.util.validation.metadata;
|
||||
exports net.sf.jsqlparser.util.validation.validator;
|
||||
}
|
||||
32
src/main/java/net/sf/jsqlparser/JSQLParserException.java
Normal file
32
src/main/java/net/sf/jsqlparser/JSQLParserException.java
Normal file
@@ -0,0 +1,32 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser;
|
||||
|
||||
public class JSQLParserException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = -4200894355696788796L;
|
||||
|
||||
public JSQLParserException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public JSQLParserException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public JSQLParserException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public JSQLParserException(Throwable cause) {
|
||||
super(cause == null ? null : cause.getMessage(), cause);
|
||||
}
|
||||
|
||||
}
|
||||
24
src/main/java/net/sf/jsqlparser/Model.java
Normal file
24
src/main/java/net/sf/jsqlparser/Model.java
Normal file
@@ -0,0 +1,24 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2020 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* A marker interface for jsqlparser-model-classes.
|
||||
* </p>
|
||||
* <p>
|
||||
* The datastructure where the sql syntax is represented by a tree consists of {@link Model}'s
|
||||
* </p>
|
||||
*/
|
||||
public interface Model extends Serializable {
|
||||
|
||||
}
|
||||
126
src/main/java/net/sf/jsqlparser/expression/Alias.java
Normal file
126
src/main/java/net/sf/jsqlparser/expression/Alias.java
Normal file
@@ -0,0 +1,126 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.sf.jsqlparser.statement.create.table.ColDataType;
|
||||
|
||||
public class Alias implements Serializable {
|
||||
|
||||
private String name;
|
||||
private boolean useAs = true;
|
||||
private List<AliasColumn> aliasColumns;
|
||||
|
||||
public Alias(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Alias(String name, boolean useAs) {
|
||||
this.name = name;
|
||||
this.useAs = useAs;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isUseAs() {
|
||||
return useAs;
|
||||
}
|
||||
|
||||
public void setUseAs(boolean useAs) {
|
||||
this.useAs = useAs;
|
||||
}
|
||||
|
||||
public List<AliasColumn> getAliasColumns() {
|
||||
return aliasColumns;
|
||||
}
|
||||
|
||||
public void setAliasColumns(List<AliasColumn> aliasColumns) {
|
||||
this.aliasColumns = aliasColumns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String alias = (useAs ? " AS " : " ") + name;
|
||||
|
||||
if (aliasColumns != null && !aliasColumns.isEmpty()) {
|
||||
StringBuilder ac = new StringBuilder();
|
||||
for (AliasColumn col : aliasColumns) {
|
||||
if (ac.length() > 0) {
|
||||
ac.append(", ");
|
||||
}
|
||||
ac.append(col.name);
|
||||
if (col.colDataType != null) {
|
||||
ac.append(" ").append(col.colDataType.toString());
|
||||
}
|
||||
}
|
||||
alias += "(" + ac + ")";
|
||||
}
|
||||
|
||||
return alias;
|
||||
}
|
||||
|
||||
public Alias withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Alias withUseAs(boolean useAs) {
|
||||
this.setUseAs(useAs);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Alias withAliasColumns(List<AliasColumn> aliasColumns) {
|
||||
this.setAliasColumns(aliasColumns);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Alias addAliasColumns(AliasColumn... aliasColumns) {
|
||||
List<AliasColumn> collection =
|
||||
Optional.ofNullable(getAliasColumns()).orElseGet(ArrayList::new);
|
||||
Collections.addAll(collection, aliasColumns);
|
||||
return this.withAliasColumns(collection);
|
||||
}
|
||||
|
||||
public Alias addAliasColumns(Collection<? extends AliasColumn> aliasColumns) {
|
||||
List<AliasColumn> collection =
|
||||
Optional.ofNullable(getAliasColumns()).orElseGet(ArrayList::new);
|
||||
collection.addAll(aliasColumns);
|
||||
return this.withAliasColumns(collection);
|
||||
}
|
||||
|
||||
public static class AliasColumn implements Serializable {
|
||||
|
||||
public final String name;
|
||||
public final ColDataType colDataType;
|
||||
|
||||
public AliasColumn(String name, ColDataType colDataType) {
|
||||
Objects.requireNonNull(name);
|
||||
this.name = name;
|
||||
this.colDataType = colDataType;
|
||||
}
|
||||
|
||||
public AliasColumn(String name) {
|
||||
this(name, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
src/main/java/net/sf/jsqlparser/expression/AllValue.java
Normal file
25
src/main/java/net/sf/jsqlparser/expression/AllValue.java
Normal file
@@ -0,0 +1,25 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class AllValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ALL";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.Limit;
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.util.stream.Collectors.joining;
|
||||
|
||||
/**
|
||||
* Analytic function. The name of the function is variable but the parameters following the special
|
||||
* analytic function path. e.g. row_number() over (order by test). Additionally, there can be an
|
||||
* expression for an analytical aggregate like sum(col) or the "all columns" wildcard like count(*).
|
||||
*
|
||||
* @author tw
|
||||
*/
|
||||
public class AnalyticExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
|
||||
private String name;
|
||||
private Expression expression;
|
||||
private Expression offset;
|
||||
private Expression defaultValue;
|
||||
private boolean allColumns = false;
|
||||
private KeepExpression keep = null;
|
||||
private AnalyticType type = AnalyticType.OVER;
|
||||
private boolean distinct = false;
|
||||
private boolean unique = false;
|
||||
private boolean ignoreNullsOutside = false; // IGNORE NULLS outside function parameters
|
||||
private Expression filterExpression = null;
|
||||
private List<OrderByElement> funcOrderBy = null;
|
||||
private String windowName = null; // refers to an external window definition (paritionBy,
|
||||
// orderBy, windowElement)
|
||||
private WindowDefinition windowDef = new WindowDefinition();
|
||||
|
||||
private Function.HavingClause havingClause;
|
||||
|
||||
private Function.NullHandling nullHandling = null;
|
||||
|
||||
private Limit limit = null;
|
||||
|
||||
public AnalyticExpression() {}
|
||||
|
||||
public AnalyticExpression(Function function) {
|
||||
this.name = String.join(" ", function.getMultipartName());
|
||||
this.allColumns = function.isAllColumns();
|
||||
this.distinct = function.isDistinct();
|
||||
this.unique = function.isUnique();
|
||||
|
||||
|
||||
ExpressionList<? extends Expression> list = function.getParameters();
|
||||
if (list != null) {
|
||||
if (list.size() > 3) {
|
||||
throw new IllegalArgumentException(
|
||||
"function object not valid to initialize analytic expression");
|
||||
}
|
||||
|
||||
expression = list.get(0);
|
||||
if (list.size() > 1) {
|
||||
offset = list.get(1);
|
||||
}
|
||||
if (list.size() > 2) {
|
||||
defaultValue = list.get(2);
|
||||
}
|
||||
}
|
||||
this.havingClause = function.getHavingClause();
|
||||
this.ignoreNullsOutside = function.isIgnoreNullsOutside();
|
||||
this.nullHandling = function.getNullHandling();
|
||||
this.funcOrderBy = function.getOrderByElements();
|
||||
this.limit = function.getLimit();
|
||||
this.keep = function.getKeep();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public List<OrderByElement> getOrderByElements() {
|
||||
return windowDef.orderBy.getOrderByElements();
|
||||
}
|
||||
|
||||
public void setOrderByElements(List<OrderByElement> orderByElements) {
|
||||
windowDef.orderBy.setOrderByElements(orderByElements);
|
||||
}
|
||||
|
||||
public KeepExpression getKeep() {
|
||||
return keep;
|
||||
}
|
||||
|
||||
public void setKeep(KeepExpression keep) {
|
||||
this.keep = keep;
|
||||
}
|
||||
|
||||
public ExpressionList<?> getPartitionExpressionList() {
|
||||
return windowDef.partitionBy.getPartitionExpressionList();
|
||||
}
|
||||
|
||||
public void setPartitionExpressionList(ExpressionList<?> partitionExpressionList) {
|
||||
setPartitionExpressionList(partitionExpressionList, false);
|
||||
}
|
||||
|
||||
public void setPartitionExpressionList(ExpressionList<?> partitionExpressionList,
|
||||
boolean brackets) {
|
||||
windowDef.partitionBy.setPartitionExpressionList(partitionExpressionList, brackets);
|
||||
}
|
||||
|
||||
public boolean isPartitionByBrackets() {
|
||||
return windowDef.partitionBy.isBrackets();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public Expression getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(Expression offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public Expression getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(Expression defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public WindowElement getWindowElement() {
|
||||
return windowDef.windowElement;
|
||||
}
|
||||
|
||||
public void setWindowElement(WindowElement windowElement) {
|
||||
windowDef.windowElement = windowElement;
|
||||
}
|
||||
|
||||
public AnalyticType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(AnalyticType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isUnique() {
|
||||
return unique;
|
||||
}
|
||||
|
||||
public void setUnique(boolean unique) {
|
||||
this.unique = unique;
|
||||
}
|
||||
|
||||
public boolean isIgnoreNulls() {
|
||||
return this.nullHandling == Function.NullHandling.IGNORE_NULLS;
|
||||
}
|
||||
|
||||
public void setIgnoreNulls(boolean ignoreNulls) {
|
||||
this.nullHandling = ignoreNulls ? Function.NullHandling.IGNORE_NULLS : null;
|
||||
}
|
||||
|
||||
public boolean isIgnoreNullsOutside() {
|
||||
return ignoreNullsOutside;
|
||||
}
|
||||
|
||||
public void setIgnoreNullsOutside(boolean ignoreNullsOutside) {
|
||||
this.ignoreNullsOutside = ignoreNullsOutside;
|
||||
}
|
||||
|
||||
public String getWindowName() {
|
||||
return windowName;
|
||||
}
|
||||
|
||||
public void setWindowName(String windowName) {
|
||||
this.windowName = windowName;
|
||||
}
|
||||
|
||||
public WindowDefinition getWindowDefinition() {
|
||||
return windowDef;
|
||||
}
|
||||
|
||||
public void setWindowDefinition(WindowDefinition windowDef) {
|
||||
this.windowDef = windowDef;
|
||||
}
|
||||
|
||||
|
||||
public Function.HavingClause getHavingClause() {
|
||||
return havingClause;
|
||||
}
|
||||
|
||||
public AnalyticExpression setHavingClause(Function.HavingClause havingClause) {
|
||||
this.havingClause = havingClause;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression setHavingClause(String havingType, Expression expression) {
|
||||
this.havingClause = new Function.HavingClause(
|
||||
Function.HavingClause.HavingType.valueOf(havingType.trim().toUpperCase()),
|
||||
expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function.NullHandling getNullHandling() {
|
||||
return nullHandling;
|
||||
}
|
||||
|
||||
public AnalyticExpression setNullHandling(Function.NullHandling nullHandling) {
|
||||
this.nullHandling = nullHandling;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Limit getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public AnalyticExpression setLimit(Limit limit) {
|
||||
this.limit = limit;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity",
|
||||
"PMD.MissingBreakInSwitch"})
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
||||
b.append(name).append("(");
|
||||
if (isDistinct()) {
|
||||
b.append("DISTINCT ");
|
||||
}
|
||||
if (expression != null) {
|
||||
b.append(expression);
|
||||
if (offset != null) {
|
||||
b.append(", ").append(offset);
|
||||
if (defaultValue != null) {
|
||||
b.append(", ").append(defaultValue);
|
||||
}
|
||||
}
|
||||
} else if (isAllColumns()) {
|
||||
b.append("*");
|
||||
}
|
||||
|
||||
if (havingClause != null) {
|
||||
havingClause.appendTo(b);
|
||||
}
|
||||
|
||||
if (nullHandling != null && !ignoreNullsOutside) {
|
||||
switch (nullHandling) {
|
||||
case IGNORE_NULLS:
|
||||
b.append(" IGNORE NULLS");
|
||||
break;
|
||||
case RESPECT_NULLS:
|
||||
b.append(" RESPECT NULLS");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (funcOrderBy != null) {
|
||||
b.append(" ORDER BY ");
|
||||
b.append(funcOrderBy.stream().map(OrderByElement::toString).collect(joining(", ")));
|
||||
}
|
||||
|
||||
if (limit != null) {
|
||||
b.append(limit);
|
||||
}
|
||||
|
||||
b.append(") ");
|
||||
if (keep != null) {
|
||||
b.append(keep).append(" ");
|
||||
}
|
||||
|
||||
if (filterExpression != null) {
|
||||
b.append("FILTER (WHERE ");
|
||||
b.append(filterExpression);
|
||||
b.append(")");
|
||||
if (type != AnalyticType.FILTER_ONLY) {
|
||||
b.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
if (nullHandling != null && ignoreNullsOutside) {
|
||||
switch (nullHandling) {
|
||||
case IGNORE_NULLS:
|
||||
b.append(" IGNORE NULLS ");
|
||||
break;
|
||||
case RESPECT_NULLS:
|
||||
b.append(" RESPECT NULLS ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case FILTER_ONLY:
|
||||
return b.toString();
|
||||
case WITHIN_GROUP:
|
||||
b.append("WITHIN GROUP");
|
||||
break;
|
||||
case WITHIN_GROUP_OVER:
|
||||
b.append("WITHIN GROUP (");
|
||||
windowDef.orderBy.toStringOrderByElements(b);
|
||||
b.append(") OVER (");
|
||||
windowDef.partitionBy.toStringPartitionBy(b);
|
||||
b.append(")");
|
||||
break;
|
||||
default:
|
||||
b.append("OVER");
|
||||
}
|
||||
|
||||
if (windowName != null) {
|
||||
b.append(" ").append(windowName);
|
||||
} else if (type != AnalyticType.WITHIN_GROUP_OVER) {
|
||||
b.append(" ");
|
||||
b.append(windowDef.toString());
|
||||
}
|
||||
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public boolean isAllColumns() {
|
||||
return allColumns;
|
||||
}
|
||||
|
||||
public void setAllColumns(boolean allColumns) {
|
||||
this.allColumns = allColumns;
|
||||
}
|
||||
|
||||
public Expression getFilterExpression() {
|
||||
return filterExpression;
|
||||
}
|
||||
|
||||
public void setFilterExpression(Expression filterExpression) {
|
||||
this.filterExpression = filterExpression;
|
||||
}
|
||||
|
||||
public AnalyticExpression withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withExpression(Expression expression) {
|
||||
this.setExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withOffset(Expression offset) {
|
||||
this.setOffset(offset);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withDefaultValue(Expression defaultValue) {
|
||||
this.setDefaultValue(defaultValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withAllColumns(boolean allColumns) {
|
||||
this.setAllColumns(allColumns);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withKeep(KeepExpression keep) {
|
||||
this.setKeep(keep);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withType(AnalyticType type) {
|
||||
this.setType(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withDistinct(boolean distinct) {
|
||||
this.setDistinct(distinct);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withUnique(boolean unique) {
|
||||
this.setUnique(unique);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withIgnoreNulls(boolean ignoreNulls) {
|
||||
this.setIgnoreNulls(ignoreNulls);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withFilterExpression(Expression filterExpression) {
|
||||
this.setFilterExpression(filterExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AnalyticExpression withWindowElement(WindowElement windowElement) {
|
||||
this.setWindowElement(windowElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getExpression(Class<E> type) {
|
||||
return type.cast(getExpression());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getOffset(Class<E> type) {
|
||||
return type.cast(getOffset());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getDefaultValue(Class<E> type) {
|
||||
return type.cast(getDefaultValue());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getFilterExpression(Class<E> type) {
|
||||
return type.cast(getFilterExpression());
|
||||
}
|
||||
|
||||
public List<OrderByElement> getFuncOrderBy() {
|
||||
return funcOrderBy;
|
||||
}
|
||||
|
||||
public void setFuncOrderBy(List<OrderByElement> funcOrderBy) {
|
||||
this.funcOrderBy = funcOrderBy;
|
||||
}
|
||||
}
|
||||
18
src/main/java/net/sf/jsqlparser/expression/AnalyticType.java
Normal file
18
src/main/java/net/sf/jsqlparser/expression/AnalyticType.java
Normal file
@@ -0,0 +1,18 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
public enum AnalyticType {
|
||||
OVER, WITHIN_GROUP, WITHIN_GROUP_OVER, FILTER_ONLY;
|
||||
|
||||
public static AnalyticType from(String type) {
|
||||
return Enum.valueOf(AnalyticType.class, type.toUpperCase());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.Select;
|
||||
|
||||
/**
|
||||
* Combines ANY and SOME expressions.
|
||||
*
|
||||
* @author toben
|
||||
*/
|
||||
public class AnyComparisonExpression extends ASTNodeAccessImpl implements Expression {
|
||||
private final Select select;
|
||||
private final AnyType anyType;
|
||||
|
||||
public AnyComparisonExpression(AnyType anyType, Select select) {
|
||||
this.anyType = anyType;
|
||||
this.select = select;
|
||||
}
|
||||
|
||||
public Select getSelect() {
|
||||
return select;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public AnyType getAnyType() {
|
||||
return anyType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String s = anyType.name() + select;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
18
src/main/java/net/sf/jsqlparser/expression/AnyType.java
Normal file
18
src/main/java/net/sf/jsqlparser/expression/AnyType.java
Normal file
@@ -0,0 +1,18 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
public enum AnyType {
|
||||
ANY, SOME, ALL;
|
||||
|
||||
public static AnyType from(String type) {
|
||||
return Enum.valueOf(AnyType.class, type.toUpperCase());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class ArrayConstructor extends ASTNodeAccessImpl implements Expression {
|
||||
private ExpressionList<?> expressions;
|
||||
private boolean arrayKeyword;
|
||||
|
||||
public ArrayConstructor(ExpressionList<?> expressions, boolean arrayKeyword) {
|
||||
this.expressions = expressions;
|
||||
this.arrayKeyword = arrayKeyword;
|
||||
}
|
||||
|
||||
public ArrayConstructor(Expression... expressions) {
|
||||
this(new ExpressionList<Expression>(expressions), false);
|
||||
}
|
||||
|
||||
public ExpressionList<?> getExpressions() {
|
||||
return expressions;
|
||||
}
|
||||
|
||||
public void setExpressions(ExpressionList<?> expressions) {
|
||||
this.expressions = expressions;
|
||||
}
|
||||
|
||||
public boolean isArrayKeyword() {
|
||||
return arrayKeyword;
|
||||
}
|
||||
|
||||
public void setArrayKeyword(boolean arrayKeyword) {
|
||||
this.arrayKeyword = arrayKeyword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (arrayKeyword) {
|
||||
sb.append("ARRAY");
|
||||
}
|
||||
sb.append("[");
|
||||
sb.append(expressions.toString());
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
117
src/main/java/net/sf/jsqlparser/expression/ArrayExpression.java
Normal file
117
src/main/java/net/sf/jsqlparser/expression/ArrayExpression.java
Normal file
@@ -0,0 +1,117 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class ArrayExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Expression objExpression;
|
||||
private Expression indexExpression;
|
||||
private Expression startIndexExpression;
|
||||
private Expression stopIndexExpression;
|
||||
|
||||
|
||||
public ArrayExpression() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public ArrayExpression(Expression objExpression, Expression indexExpression,
|
||||
Expression startIndexExpression, Expression stopIndexExpression) {
|
||||
this.objExpression = objExpression;
|
||||
this.indexExpression = indexExpression;
|
||||
this.startIndexExpression = startIndexExpression;
|
||||
this.stopIndexExpression = stopIndexExpression;
|
||||
}
|
||||
|
||||
public ArrayExpression(Expression objExpression, Expression indexExpression) {
|
||||
this(objExpression, indexExpression, null, null);
|
||||
}
|
||||
|
||||
public ArrayExpression(Expression objExpression, Expression startIndexExpression,
|
||||
Expression stopIndexExpression) {
|
||||
this(objExpression, null, startIndexExpression, stopIndexExpression);
|
||||
}
|
||||
|
||||
public Expression getObjExpression() {
|
||||
return objExpression;
|
||||
}
|
||||
|
||||
public void setObjExpression(Expression objExpression) {
|
||||
this.objExpression = objExpression;
|
||||
}
|
||||
|
||||
public Expression getIndexExpression() {
|
||||
return indexExpression;
|
||||
}
|
||||
|
||||
public void setIndexExpression(Expression indexExpression) {
|
||||
this.indexExpression = indexExpression;
|
||||
}
|
||||
|
||||
public Expression getStartIndexExpression() {
|
||||
return startIndexExpression;
|
||||
}
|
||||
|
||||
public void setStartIndexExpression(Expression startIndexExpression) {
|
||||
this.startIndexExpression = startIndexExpression;
|
||||
}
|
||||
|
||||
public Expression getStopIndexExpression() {
|
||||
return stopIndexExpression;
|
||||
}
|
||||
|
||||
public void setStopIndexExpression(Expression stopIndexExpression) {
|
||||
this.stopIndexExpression = stopIndexExpression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (indexExpression != null) {
|
||||
return objExpression.toString() + "[" + indexExpression.toString() + "]";
|
||||
} else {
|
||||
return objExpression.toString() + "[" +
|
||||
(startIndexExpression == null ? "" : startIndexExpression.toString()) +
|
||||
":" +
|
||||
(stopIndexExpression == null ? "" : stopIndexExpression.toString()) +
|
||||
"]";
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayExpression withObjExpression(Expression objExpression) {
|
||||
this.setObjExpression(objExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayExpression withIndexExpression(Expression indexExpression) {
|
||||
this.setIndexExpression(indexExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayExpression withRangeExpression(Expression startIndexExpression,
|
||||
Expression stopIndexExpression) {
|
||||
this.setStartIndexExpression(startIndexExpression);
|
||||
this.setStopIndexExpression(stopIndexExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getObjExpression(Class<E> type) {
|
||||
return type.cast(getObjExpression());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getIndexExpression(Class<E> type) {
|
||||
return type.cast(getIndexExpression());
|
||||
}
|
||||
}
|
||||
266
src/main/java/net/sf/jsqlparser/expression/BinaryExpression.java
Normal file
266
src/main/java/net/sf/jsqlparser/expression/BinaryExpression.java
Normal file
@@ -0,0 +1,266 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Addition;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseAnd;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseLeftShift;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseOr;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseRightShift;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseXor;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Concat;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Division;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.IntegerDivision;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Modulo;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Multiplication;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Subtraction;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.XorExpression;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* A basic class for binary expressions, that is expressions having a left member and a right member
|
||||
* which are in turn expressions.
|
||||
*/
|
||||
public abstract class BinaryExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Expression leftExpression;
|
||||
private Expression rightExpression;
|
||||
|
||||
public BinaryExpression() {}
|
||||
|
||||
public BinaryExpression(Expression leftExpression, Expression rightExpression) {
|
||||
this.leftExpression = leftExpression;
|
||||
this.rightExpression = rightExpression;
|
||||
}
|
||||
|
||||
public static Expression build(Class<? extends BinaryExpression> clz, Expression... expressions)
|
||||
throws NoSuchMethodException, InvocationTargetException, InstantiationException,
|
||||
IllegalAccessException {
|
||||
switch (expressions.length) {
|
||||
case 0:
|
||||
return new NullValue();
|
||||
case 1:
|
||||
return expressions[0];
|
||||
default:
|
||||
Iterator<Expression> it = Arrays.stream(expressions).iterator();
|
||||
|
||||
Expression leftExpression = it.next();
|
||||
Expression rightExpression = it.next();
|
||||
BinaryExpression binaryExpression =
|
||||
clz.getConstructor(Expression.class, Expression.class)
|
||||
.newInstance(leftExpression, rightExpression);
|
||||
|
||||
while (it.hasNext()) {
|
||||
rightExpression = it.next();
|
||||
binaryExpression = clz.getConstructor(Expression.class, Expression.class)
|
||||
.newInstance(binaryExpression, rightExpression);
|
||||
}
|
||||
return binaryExpression;
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression add(Expression... expressions) {
|
||||
try {
|
||||
return build(Addition.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression bitAnd(Expression... expressions) {
|
||||
try {
|
||||
return build(BitwiseAnd.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression bitShiftLeft(Expression... expressions) {
|
||||
try {
|
||||
return build(BitwiseLeftShift.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression multiply(Expression... expressions) {
|
||||
try {
|
||||
return build(Multiplication.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression bitOr(Expression... expressions) {
|
||||
try {
|
||||
return build(BitwiseOr.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression bitShiftRight(Expression... expressions) {
|
||||
try {
|
||||
return build(BitwiseRightShift.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression bitXor(Expression... expressions) {
|
||||
try {
|
||||
return build(BitwiseXor.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression concat(Expression... expressions) {
|
||||
try {
|
||||
return build(Concat.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression divide(Expression... expressions) {
|
||||
try {
|
||||
return build(Division.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression divideInt(Expression... expressions) {
|
||||
try {
|
||||
return build(IntegerDivision.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression modulo(Expression... expressions) {
|
||||
try {
|
||||
return build(Modulo.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression subtract(Expression... expressions) {
|
||||
try {
|
||||
return build(Subtraction.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression or(Expression... expressions) {
|
||||
try {
|
||||
return build(OrExpression.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression xor(Expression... expressions) {
|
||||
try {
|
||||
return build(XorExpression.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Expression and(Expression... expressions) {
|
||||
try {
|
||||
return build(AndExpression.class, expressions);
|
||||
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException
|
||||
| IllegalAccessException e) {
|
||||
// this should never happen, at least I don't see how
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Expression getLeftExpression() {
|
||||
return leftExpression;
|
||||
}
|
||||
|
||||
public void setLeftExpression(Expression expression) {
|
||||
leftExpression = expression;
|
||||
}
|
||||
|
||||
public Expression getRightExpression() {
|
||||
return rightExpression;
|
||||
}
|
||||
|
||||
public void setRightExpression(Expression expression) {
|
||||
rightExpression = expression;
|
||||
}
|
||||
|
||||
public BinaryExpression withLeftExpression(Expression expression) {
|
||||
setLeftExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BinaryExpression withRightExpression(Expression expression) {
|
||||
setRightExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return // (not ? "NOT " : "") +
|
||||
getLeftExpression() + " " + getStringExpression() + " " + getRightExpression();
|
||||
}
|
||||
|
||||
public abstract String getStringExpression();
|
||||
|
||||
public <E extends Expression> E getLeftExpression(Class<E> type) {
|
||||
return type.cast(getLeftExpression());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getRightExpression(Class<E> type) {
|
||||
return type.cast(getRightExpression());
|
||||
}
|
||||
}
|
||||
182
src/main/java/net/sf/jsqlparser/expression/CaseExpression.java
Normal file
182
src/main/java/net/sf/jsqlparser/expression/CaseExpression.java
Normal file
@@ -0,0 +1,182 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.PlainSelect;
|
||||
|
||||
/**
|
||||
* CASE/WHEN expression.
|
||||
* <p>
|
||||
* Syntax:
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* CASE
|
||||
* WHEN condition THEN expression
|
||||
* [WHEN condition THEN expression]...
|
||||
* [ELSE expression]
|
||||
* END
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
* <br>
|
||||
* or <br>
|
||||
* <br>
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* CASE expression
|
||||
* WHEN condition THEN expression
|
||||
* [WHEN condition THEN expression]...
|
||||
* [ELSE expression]
|
||||
* END
|
||||
* </code>
|
||||
* </pre>
|
||||
*/
|
||||
public class CaseExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private boolean usingBrackets = false;
|
||||
private Expression switchExpression;
|
||||
private List<WhenClause> whenClauses;
|
||||
private Expression elseExpression;
|
||||
|
||||
public CaseExpression() {}
|
||||
|
||||
public CaseExpression(WhenClause... whenClauses) {
|
||||
this.whenClauses = Arrays.asList(whenClauses);
|
||||
}
|
||||
|
||||
public CaseExpression(Expression elseExpression, WhenClause... whenClauses) {
|
||||
this.elseExpression = elseExpression;
|
||||
this.whenClauses = Arrays.asList(whenClauses);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public Expression getSwitchExpression() {
|
||||
return switchExpression;
|
||||
}
|
||||
|
||||
public void setSwitchExpression(Expression switchExpression) {
|
||||
this.switchExpression = switchExpression;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the elseExpression.
|
||||
*/
|
||||
public Expression getElseExpression() {
|
||||
return elseExpression;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param elseExpression The elseExpression to set.
|
||||
*/
|
||||
public void setElseExpression(Expression elseExpression) {
|
||||
this.elseExpression = elseExpression;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the whenClauses.
|
||||
*/
|
||||
public List<WhenClause> getWhenClauses() {
|
||||
return whenClauses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param whenClauses The whenClauses to set.
|
||||
*/
|
||||
public void setWhenClauses(List<WhenClause> whenClauses) {
|
||||
this.whenClauses = whenClauses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (usingBrackets ? "(" : "") + "CASE "
|
||||
+ ((switchExpression != null) ? switchExpression + " " : "")
|
||||
+ PlainSelect.getStringList(whenClauses, false, false) + " "
|
||||
+ ((elseExpression != null) ? "ELSE " + elseExpression + " " : "") + "END"
|
||||
+ (usingBrackets ? ")" : "");
|
||||
}
|
||||
|
||||
public CaseExpression withSwitchExpression(Expression switchExpression) {
|
||||
this.setSwitchExpression(switchExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CaseExpression withWhenClauses(WhenClause... whenClauses) {
|
||||
return this.withWhenClauses(Arrays.asList(whenClauses));
|
||||
}
|
||||
|
||||
public CaseExpression withWhenClauses(List<WhenClause> whenClauses) {
|
||||
this.setWhenClauses(whenClauses);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CaseExpression withElseExpression(Expression elseExpression) {
|
||||
this.setElseExpression(elseExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CaseExpression addWhenClauses(WhenClause... whenClauses) {
|
||||
List<WhenClause> collection =
|
||||
Optional.ofNullable(getWhenClauses()).orElseGet(ArrayList::new);
|
||||
Collections.addAll(collection, whenClauses);
|
||||
return this.withWhenClauses(collection);
|
||||
}
|
||||
|
||||
public CaseExpression addWhenClauses(Collection<? extends WhenClause> whenClauses) {
|
||||
List<WhenClause> collection =
|
||||
Optional.ofNullable(getWhenClauses()).orElseGet(ArrayList::new);
|
||||
collection.addAll(whenClauses);
|
||||
return this.withWhenClauses(collection);
|
||||
}
|
||||
|
||||
public <E extends Expression> E getSwitchExpression(Class<E> type) {
|
||||
return type.cast(getSwitchExpression());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getElseExpression(Class<E> type) {
|
||||
return type.cast(getElseExpression());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the usingBrackets
|
||||
*/
|
||||
public boolean isUsingBrackets() {
|
||||
return usingBrackets;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param usingBrackets the usingBrackets to set
|
||||
*/
|
||||
public void setUsingBrackets(boolean usingBrackets) {
|
||||
this.usingBrackets = usingBrackets;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param usingBrackets the usingBrackets to set
|
||||
*/
|
||||
public CaseExpression withUsingBrackets(boolean usingBrackets) {
|
||||
this.usingBrackets = usingBrackets;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
295
src/main/java/net/sf/jsqlparser/expression/CastExpression.java
Normal file
295
src/main/java/net/sf/jsqlparser/expression/CastExpression.java
Normal file
@@ -0,0 +1,295 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.create.table.ColDataType;
|
||||
import net.sf.jsqlparser.statement.create.table.ColumnDefinition;
|
||||
import net.sf.jsqlparser.statement.select.Select;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class CastExpression extends ASTNodeAccessImpl implements Expression {
|
||||
private final static Pattern PATTERN =
|
||||
Pattern.compile("(^[a-z0-9_]*){1}", Pattern.CASE_INSENSITIVE);
|
||||
public String keyword;
|
||||
|
||||
private Expression leftExpression;
|
||||
private ColDataType colDataType = null;
|
||||
private ArrayList<ColumnDefinition> columnDefinitions = new ArrayList<>();
|
||||
|
||||
private boolean isImplicitCast = false;
|
||||
|
||||
// BigQuery specific FORMAT clause:
|
||||
// https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions#cast_as_date
|
||||
private String format = null;
|
||||
|
||||
public CastExpression(String keyword, Expression leftExpression, String dataType) {
|
||||
this.keyword = keyword;
|
||||
this.leftExpression = leftExpression;
|
||||
this.colDataType = new ColDataType(dataType);
|
||||
}
|
||||
|
||||
// Implicit Cast
|
||||
public CastExpression(String dataType, String value) {
|
||||
this.keyword = null;
|
||||
this.isImplicitCast = true;
|
||||
this.colDataType = new ColDataType(dataType);
|
||||
this.leftExpression = new StringValue(value);
|
||||
}
|
||||
|
||||
public CastExpression(ColDataType colDataType, String value) {
|
||||
this.keyword = null;
|
||||
this.isImplicitCast = true;
|
||||
this.colDataType = colDataType;
|
||||
this.leftExpression = new StringValue(value);
|
||||
}
|
||||
|
||||
public CastExpression(ColDataType colDataType, Long value) {
|
||||
this.keyword = null;
|
||||
this.isImplicitCast = true;
|
||||
this.colDataType = colDataType;
|
||||
this.leftExpression = new LongValue(value);
|
||||
}
|
||||
|
||||
public CastExpression(ColDataType colDataType, Double value) {
|
||||
this.keyword = null;
|
||||
this.isImplicitCast = true;
|
||||
this.colDataType = colDataType;
|
||||
this.leftExpression = new DoubleValue(value);
|
||||
}
|
||||
|
||||
public CastExpression(Expression leftExpression, String dataType) {
|
||||
this.keyword = null;
|
||||
this.leftExpression = leftExpression;
|
||||
this.colDataType = new ColDataType(dataType);
|
||||
}
|
||||
|
||||
|
||||
public CastExpression(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public CastExpression() {
|
||||
this("CAST");
|
||||
}
|
||||
|
||||
public static boolean isOf(ColDataType colDataType, DataType... types) {
|
||||
return Set.of(types).contains(DataType.from(colDataType.getDataType()));
|
||||
}
|
||||
|
||||
public static boolean isTime(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.TIME, DataType.TIME_WITH_TIME_ZONE,
|
||||
DataType.TIME_WITHOUT_TIME_ZONE);
|
||||
}
|
||||
|
||||
public static boolean isTimeStamp(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.TIMESTAMP_NS, DataType.TIMESTAMP,
|
||||
DataType.TIMESTAMP_WITHOUT_TIME_ZONE,
|
||||
DataType.DATETIME, DataType.TIMESTAMP_MS, DataType.TIMESTAMP_S,
|
||||
DataType.TIMESTAMPTZ, DataType.TIMESTAMP_WITH_TIME_ZONE);
|
||||
}
|
||||
|
||||
public static boolean isDate(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.DATE);
|
||||
}
|
||||
|
||||
public static boolean isBLOB(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.BLOB, DataType.BYTEA, DataType.BINARY, DataType.VARBINARY,
|
||||
DataType.BYTES, DataType.VARBYTE);
|
||||
}
|
||||
|
||||
public static boolean isFloat(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.REAL, DataType.FLOAT4, DataType.FLOAT, DataType.DOUBLE,
|
||||
DataType.DOUBLE_PRECISION, DataType.FLOAT8);
|
||||
}
|
||||
|
||||
public static boolean isInteger(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.TINYINT, DataType.INT1, DataType.SMALLINT, DataType.INT2,
|
||||
DataType.SHORT, DataType.INTEGER, DataType.INT4, DataType.INT, DataType.SIGNED,
|
||||
DataType.BIGINT, DataType.INT8, DataType.LONG, DataType.HUGEINT, DataType.UTINYINT,
|
||||
DataType.USMALLINT, DataType.UINTEGER, DataType.UBIGINT, DataType.UHUGEINT);
|
||||
}
|
||||
|
||||
public static boolean isDecimal(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.DECIMAL, DataType.NUMBER, DataType.NUMERIC);
|
||||
}
|
||||
|
||||
public static boolean isText(ColDataType colDataType) {
|
||||
return isOf(colDataType, DataType.VARCHAR, DataType.NVARCHAR, DataType.CHAR, DataType.NCHAR,
|
||||
DataType.BPCHAR, DataType.STRING, DataType.TEXT, DataType.CLOB);
|
||||
}
|
||||
|
||||
public ColDataType getColDataType() {
|
||||
return colDataType;
|
||||
}
|
||||
|
||||
public void setColDataType(ColDataType colDataType) {
|
||||
this.colDataType = colDataType;
|
||||
}
|
||||
|
||||
public ArrayList<ColumnDefinition> getColumnDefinitions() {
|
||||
return columnDefinitions;
|
||||
}
|
||||
|
||||
public void addColumnDefinition(ColumnDefinition columnDefinition) {
|
||||
this.columnDefinitions.add(columnDefinition);
|
||||
}
|
||||
|
||||
public Expression getLeftExpression() {
|
||||
return leftExpression;
|
||||
}
|
||||
|
||||
public void setLeftExpression(Expression expression) {
|
||||
leftExpression = expression;
|
||||
}
|
||||
|
||||
public boolean isImplicitCast() {
|
||||
return isImplicitCast;
|
||||
}
|
||||
|
||||
public CastExpression setImplicitCast(boolean implicitCast) {
|
||||
isImplicitCast = implicitCast;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isUseCastKeyword() {
|
||||
return keyword != null && !keyword.isEmpty();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setUseCastKeyword(boolean useCastKeyword) {
|
||||
if (useCastKeyword) {
|
||||
if (keyword == null || keyword.isEmpty()) {
|
||||
keyword = "CAST";
|
||||
}
|
||||
} else {
|
||||
keyword = null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
public CastExpression setFormat(String format) {
|
||||
this.format = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String formatStr = format != null && !format.isEmpty()
|
||||
? " FORMAT " + format
|
||||
: "";
|
||||
if (isImplicitCast) {
|
||||
return colDataType + " " + leftExpression;
|
||||
} else if (keyword != null && !keyword.isEmpty()) {
|
||||
return columnDefinitions.size() > 1
|
||||
? keyword + "(" + leftExpression + " AS ROW("
|
||||
+ Select.getStringList(columnDefinitions) + ")" + formatStr + ")"
|
||||
: keyword + "(" + leftExpression + " AS " + colDataType.toString() + formatStr
|
||||
+ ")";
|
||||
} else {
|
||||
return leftExpression + "::" + colDataType.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public CastExpression withType(ColDataType type) {
|
||||
this.setColDataType(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CastExpression withUseCastKeyword(boolean useCastKeyword) {
|
||||
this.setUseCastKeyword(useCastKeyword);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CastExpression withLeftExpression(Expression leftExpression) {
|
||||
this.setLeftExpression(leftExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getLeftExpression(Class<E> type) {
|
||||
return type.cast(getLeftExpression());
|
||||
}
|
||||
|
||||
public boolean isOf(CastExpression anotherCast) {
|
||||
return this.colDataType.equals(anotherCast.colDataType);
|
||||
}
|
||||
|
||||
public boolean isOf(DataType... types) {
|
||||
return Set.of(types).contains(DataType.from(colDataType.getDataType()));
|
||||
}
|
||||
|
||||
public boolean isTime() {
|
||||
return isTime(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isTimeStamp() {
|
||||
return isTimeStamp(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isDate() {
|
||||
return isDate(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isBLOB() {
|
||||
return isBLOB(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isFloat() {
|
||||
return isFloat(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isInteger() {
|
||||
return isInteger(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isDecimal() {
|
||||
return isDecimal(this.colDataType);
|
||||
}
|
||||
|
||||
public boolean isText() {
|
||||
return isText(this.colDataType);
|
||||
}
|
||||
|
||||
public enum DataType {
|
||||
ARRAY, BIT, BITSTRING, BLOB, BYTEA, BINARY, VARBINARY, BYTES, BOOLEAN, BOOL, ENUM, INTERVAL, LIST, MAP, STRUCT, TINYINT, INT1, SMALLINT, INT2, SHORT, INTEGER, INT4, INT, SIGNED, BIGINT, INT8, LONG, HUGEINT, UTINYINT, USMALLINT, UINTEGER, UBIGINT, UHUGEINT, DECIMAL, NUMBER, NUMERIC, REAL, FLOAT4, FLOAT, DOUBLE, DOUBLE_PRECISION, FLOAT8, FLOAT64, UUID, VARCHAR, NVARCHAR, CHAR, NCHAR, BPCHAR, STRING, TEXT, CLOB, DATE, TIME, TIME_WITHOUT_TIME_ZONE, TIMETZ, TIME_WITH_TIME_ZONE, TIMESTAMP_NS, TIMESTAMP, TIMESTAMP_WITHOUT_TIME_ZONE, DATETIME, TIMESTAMP_MS, TIMESTAMP_S, TIMESTAMPTZ, TIMESTAMP_WITH_TIME_ZONE, UNKNOWN, VARBYTE;
|
||||
|
||||
public static DataType from(String typeStr) {
|
||||
Matcher matcher = PATTERN.matcher(typeStr.trim().replaceAll("\\s+", "_").toUpperCase());
|
||||
if (matcher.find()) {
|
||||
try {
|
||||
return Enum.valueOf(DataType.class, matcher.group(0));
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(CastExpression.class.getName()).log(Level.FINE,
|
||||
"Type " + typeStr + " unknown", ex);
|
||||
return DataType.UNKNOWN;
|
||||
}
|
||||
} else {
|
||||
Logger.getLogger(CastExpression.class.getName()).log(Level.FINE,
|
||||
"Type " + typeStr + " unknown");
|
||||
return DataType.UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class CollateExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Expression leftExpression;
|
||||
private String collate;
|
||||
|
||||
public CollateExpression() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public CollateExpression(Expression leftExpression, String collate) {
|
||||
this.leftExpression = leftExpression;
|
||||
this.collate = collate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public Expression getLeftExpression() {
|
||||
return leftExpression;
|
||||
}
|
||||
|
||||
public void setLeftExpression(Expression leftExpression) {
|
||||
this.leftExpression = leftExpression;
|
||||
}
|
||||
|
||||
public String getCollate() {
|
||||
return collate;
|
||||
}
|
||||
|
||||
public void setCollate(String collate) {
|
||||
this.collate = collate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return leftExpression.toString() + " COLLATE " + collate;
|
||||
}
|
||||
|
||||
public CollateExpression withLeftExpression(Expression leftExpression) {
|
||||
this.setLeftExpression(leftExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CollateExpression withCollate(String collate) {
|
||||
this.setCollate(collate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getLeftExpression(Class<E> type) {
|
||||
return type.cast(getLeftExpression());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2021 JSQLParser.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation; either version
|
||||
* 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library;
|
||||
* if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.schema.Column;
|
||||
|
||||
/**
|
||||
* @author are
|
||||
*/
|
||||
public class ConnectByRootOperator extends ASTNodeAccessImpl implements Expression {
|
||||
private final Column column;
|
||||
|
||||
public ConnectByRootOperator(Column column) {
|
||||
this.column = Objects.requireNonNull(column,
|
||||
"The COLUMN of the ConnectByRoot Operator must not be null");
|
||||
}
|
||||
|
||||
public Column getColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public StringBuilder appendTo(StringBuilder builder) {
|
||||
builder.append("CONNECT_BY_ROOT ").append(column);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return appendTo(new StringBuilder()).toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class DateTimeLiteralExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String value;
|
||||
private DateTime type;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public DateTime getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(DateTime type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return type.name() + " " + value;
|
||||
}
|
||||
|
||||
public DateTimeLiteralExpression withValue(String value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DateTimeLiteralExpression withType(DateTime type) {
|
||||
this.setType(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public enum DateTime {
|
||||
DATE, DATETIME, TIME, TIMESTAMP, TIMESTAMPTZ;
|
||||
|
||||
public static DateTime from(String dateTimeStr) {
|
||||
return Enum.valueOf(DateTime.class, dateTimeStr.toUpperCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
62
src/main/java/net/sf/jsqlparser/expression/DateValue.java
Normal file
62
src/main/java/net/sf/jsqlparser/expression/DateValue.java
Normal file
@@ -0,0 +1,62 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
/**
|
||||
* A Date in the form {d 'yyyy-mm-dd'}
|
||||
*/
|
||||
public class DateValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Date value;
|
||||
|
||||
public DateValue() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public DateValue(Date value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Date in the form {d 'yyyy-mm-dd'}
|
||||
*
|
||||
* @param value The text presentation of the Date to be parsed.
|
||||
*/
|
||||
public DateValue(String value) {
|
||||
this(Date.valueOf(value.substring(1, value.length() - 1)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public Date getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Date d) {
|
||||
value = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{d '" + value.toString() + "'}";
|
||||
}
|
||||
|
||||
public DateValue withValue(Date value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
66
src/main/java/net/sf/jsqlparser/expression/DoubleValue.java
Normal file
66
src/main/java/net/sf/jsqlparser/expression/DoubleValue.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* Every number with a point or a exponential format is a DoubleValue
|
||||
*/
|
||||
public class DoubleValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Double value;
|
||||
private String stringValue;
|
||||
|
||||
public DoubleValue() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public DoubleValue(final String value) {
|
||||
if (value == null || value.length() == 0) {
|
||||
throw new IllegalArgumentException("value can neither be null nor empty.");
|
||||
}
|
||||
String val = value;
|
||||
if (val.charAt(0) == '+') {
|
||||
val = val.substring(1);
|
||||
}
|
||||
this.value = Double.parseDouble(val);
|
||||
this.stringValue = val;
|
||||
}
|
||||
|
||||
public DoubleValue(final double value) {
|
||||
this.value = value;
|
||||
this.stringValue = String.valueOf(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public double getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Double d) {
|
||||
value = d;
|
||||
stringValue = String.valueOf(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
public DoubleValue withValue(Double value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
26
src/main/java/net/sf/jsqlparser/expression/Expression.java
Normal file
26
src/main/java/net/sf/jsqlparser/expression/Expression.java
Normal file
@@ -0,0 +1,26 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.Model;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccess;
|
||||
|
||||
public interface Expression extends ASTNodeAccess, Model {
|
||||
|
||||
<T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context);
|
||||
|
||||
default <T> void accept(ExpressionVisitor<T> expressionVisitor) {
|
||||
this.accept(expressionVisitor, null);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,644 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Addition;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseAnd;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseLeftShift;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseOr;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseRightShift;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseXor;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Concat;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Division;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.IntegerDivision;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Modulo;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Multiplication;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Subtraction;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.XorExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.Between;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ContainedBy;
|
||||
import net.sf.jsqlparser.expression.operators.relational.Contains;
|
||||
import net.sf.jsqlparser.expression.operators.relational.DoubleAnd;
|
||||
import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExcludesExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExistsExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.expression.operators.relational.FullTextSearch;
|
||||
import net.sf.jsqlparser.expression.operators.relational.GeometryDistance;
|
||||
import net.sf.jsqlparser.expression.operators.relational.GreaterThan;
|
||||
import net.sf.jsqlparser.expression.operators.relational.GreaterThanEquals;
|
||||
import net.sf.jsqlparser.expression.operators.relational.InExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IncludesExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IsBooleanExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IsDistinctExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IsNullExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.JsonOperator;
|
||||
import net.sf.jsqlparser.expression.operators.relational.LikeExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.Matches;
|
||||
import net.sf.jsqlparser.expression.operators.relational.MemberOfExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.MinorThan;
|
||||
import net.sf.jsqlparser.expression.operators.relational.MinorThanEquals;
|
||||
import net.sf.jsqlparser.expression.operators.relational.NotEqualsTo;
|
||||
import net.sf.jsqlparser.expression.operators.relational.RegExpMatchOperator;
|
||||
import net.sf.jsqlparser.expression.operators.relational.SimilarToExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.TSQLLeftJoin;
|
||||
import net.sf.jsqlparser.expression.operators.relational.TSQLRightJoin;
|
||||
import net.sf.jsqlparser.schema.Column;
|
||||
import net.sf.jsqlparser.statement.select.AllColumns;
|
||||
import net.sf.jsqlparser.statement.select.AllTableColumns;
|
||||
import net.sf.jsqlparser.statement.select.ParenthesedSelect;
|
||||
import net.sf.jsqlparser.statement.select.Select;
|
||||
|
||||
public interface ExpressionVisitor<T> {
|
||||
|
||||
<S> T visit(BitwiseRightShift bitwiseRightShift, S context);
|
||||
|
||||
default void visit(BitwiseRightShift bitwiseRightShift) {
|
||||
this.visit(bitwiseRightShift, null);
|
||||
}
|
||||
|
||||
<S> T visit(BitwiseLeftShift bitwiseLeftShift, S context);
|
||||
|
||||
default void visit(BitwiseLeftShift bitwiseLeftShift) {
|
||||
this.visit(bitwiseLeftShift, null);
|
||||
}
|
||||
|
||||
<S> T visit(NullValue nullValue, S context);
|
||||
|
||||
default void visit(NullValue nullValue) {
|
||||
this.visit(nullValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(Function function, S context);
|
||||
|
||||
default void visit(Function function) {
|
||||
this.visit(function, null);
|
||||
}
|
||||
|
||||
<S> T visit(SignedExpression signedExpression, S context);
|
||||
|
||||
default void visit(SignedExpression signedExpression) {
|
||||
this.visit(signedExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(JdbcParameter jdbcParameter, S context);
|
||||
|
||||
default void visit(JdbcParameter jdbcParameter) {
|
||||
this.visit(jdbcParameter, null);
|
||||
}
|
||||
|
||||
<S> T visit(JdbcNamedParameter jdbcNamedParameter, S context);
|
||||
|
||||
default void visit(JdbcNamedParameter jdbcNamedParameter) {
|
||||
this.visit(jdbcNamedParameter, null);
|
||||
}
|
||||
|
||||
<S> T visit(DoubleValue doubleValue, S context);
|
||||
|
||||
default void visit(DoubleValue doubleValue) {
|
||||
this.visit(doubleValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(LongValue longValue, S context);
|
||||
|
||||
default void visit(LongValue longValue) {
|
||||
this.visit(longValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(HexValue hexValue, S context);
|
||||
|
||||
default void visit(HexValue hexValue) {
|
||||
this.visit(hexValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(DateValue dateValue, S context);
|
||||
|
||||
default void visit(DateValue dateValue) {
|
||||
this.visit(dateValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(TimeValue timeValue, S context);
|
||||
|
||||
default void visit(TimeValue timeValue) {
|
||||
this.visit(timeValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(TimestampValue timestampValue, S context);
|
||||
|
||||
default void visit(TimestampValue timestampValue) {
|
||||
this.visit(timestampValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(StringValue stringValue, S context);
|
||||
|
||||
default void visit(StringValue stringValue) {
|
||||
this.visit(stringValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(Addition addition, S context);
|
||||
|
||||
default void visit(Addition addition) {
|
||||
this.visit(addition, null);
|
||||
}
|
||||
|
||||
<S> T visit(Division division, S context);
|
||||
|
||||
default void visit(Division division) {
|
||||
this.visit(division, null);
|
||||
}
|
||||
|
||||
<S> T visit(IntegerDivision integerDivision, S context);
|
||||
|
||||
default void visit(IntegerDivision integerDivision) {
|
||||
this.visit(integerDivision, null);
|
||||
}
|
||||
|
||||
<S> T visit(Multiplication multiplication, S context);
|
||||
|
||||
default void visit(Multiplication multiplication) {
|
||||
this.visit(multiplication, null);
|
||||
}
|
||||
|
||||
<S> T visit(Subtraction subtraction, S context);
|
||||
|
||||
default void visit(Subtraction subtraction) {
|
||||
this.visit(subtraction, null);
|
||||
}
|
||||
|
||||
<S> T visit(AndExpression andExpression, S context);
|
||||
|
||||
default void visit(AndExpression andExpression) {
|
||||
this.visit(andExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(OrExpression orExpression, S context);
|
||||
|
||||
default void visit(OrExpression orExpression) {
|
||||
this.visit(orExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(XorExpression xorExpression, S context);
|
||||
|
||||
default void visit(XorExpression xorExpression) {
|
||||
this.visit(xorExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(Between between, S context);
|
||||
|
||||
default void visit(Between between) {
|
||||
this.visit(between, null);
|
||||
}
|
||||
|
||||
<S> T visit(OverlapsCondition overlapsCondition, S context);
|
||||
|
||||
default void visit(OverlapsCondition overlapsCondition) {
|
||||
this.visit(overlapsCondition, null);
|
||||
}
|
||||
|
||||
<S> T visit(EqualsTo equalsTo, S context);
|
||||
|
||||
default void visit(EqualsTo equalsTo) {
|
||||
this.visit(equalsTo, null);
|
||||
}
|
||||
|
||||
<S> T visit(GreaterThan greaterThan, S context);
|
||||
|
||||
default void visit(GreaterThan greaterThan) {
|
||||
this.visit(greaterThan, null);
|
||||
}
|
||||
|
||||
<S> T visit(GreaterThanEquals greaterThanEquals, S context);
|
||||
|
||||
default void visit(GreaterThanEquals greaterThanEquals) {
|
||||
this.visit(greaterThanEquals, null);
|
||||
}
|
||||
|
||||
<S> T visit(InExpression inExpression, S context);
|
||||
|
||||
default void visit(InExpression inExpression) {
|
||||
this.visit(inExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(IncludesExpression includesExpression, S context);
|
||||
|
||||
default void visit(IncludesExpression includesExpression) {
|
||||
this.visit(includesExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(ExcludesExpression excludesExpression, S context);
|
||||
|
||||
default void visit(ExcludesExpression excludesExpression) {
|
||||
this.visit(excludesExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(FullTextSearch fullTextSearch, S context);
|
||||
|
||||
default void visit(FullTextSearch fullTextSearch) {
|
||||
this.visit(fullTextSearch, null);
|
||||
}
|
||||
|
||||
<S> T visit(IsNullExpression isNullExpression, S context);
|
||||
|
||||
default void visit(IsNullExpression isNullExpression) {
|
||||
this.visit(isNullExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(IsBooleanExpression isBooleanExpression, S context);
|
||||
|
||||
default void visit(IsBooleanExpression isBooleanExpression) {
|
||||
this.visit(isBooleanExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(LikeExpression likeExpression, S context);
|
||||
|
||||
default void visit(LikeExpression likeExpression) {
|
||||
this.visit(likeExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(MinorThan minorThan, S context);
|
||||
|
||||
default void visit(MinorThan minorThan) {
|
||||
this.visit(minorThan, null);
|
||||
}
|
||||
|
||||
<S> T visit(MinorThanEquals minorThanEquals, S context);
|
||||
|
||||
default void visit(MinorThanEquals minorThanEquals) {
|
||||
this.visit(minorThanEquals, null);
|
||||
}
|
||||
|
||||
<S> T visit(NotEqualsTo notEqualsTo, S context);
|
||||
|
||||
default void visit(NotEqualsTo notEqualsTo) {
|
||||
this.visit(notEqualsTo, null);
|
||||
}
|
||||
|
||||
<S> T visit(DoubleAnd doubleAnd, S context);
|
||||
|
||||
default void visit(DoubleAnd doubleAnd) {
|
||||
this.visit(doubleAnd, null);
|
||||
}
|
||||
|
||||
<S> T visit(Contains contains, S context);
|
||||
|
||||
default void visit(Contains contains) {
|
||||
this.visit(contains, null);
|
||||
}
|
||||
|
||||
<S> T visit(ContainedBy containedBy, S context);
|
||||
|
||||
default void visit(ContainedBy containedBy) {
|
||||
this.visit(containedBy, null);
|
||||
}
|
||||
|
||||
<S> T visit(ParenthesedSelect select, S context);
|
||||
|
||||
default void visit(ParenthesedSelect select) {
|
||||
this.visit(select, null);
|
||||
}
|
||||
|
||||
<S> T visit(Column column, S context);
|
||||
|
||||
default void visit(Column column) {
|
||||
this.visit(column, null);
|
||||
}
|
||||
|
||||
<S> T visit(CaseExpression caseExpression, S context);
|
||||
|
||||
default void visit(CaseExpression caseExpression) {
|
||||
this.visit(caseExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(WhenClause whenClause, S context);
|
||||
|
||||
default void visit(WhenClause whenClause) {
|
||||
this.visit(whenClause, null);
|
||||
}
|
||||
|
||||
<S> T visit(ExistsExpression existsExpression, S context);
|
||||
|
||||
default void visit(ExistsExpression existsExpression) {
|
||||
this.visit(existsExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(MemberOfExpression memberOfExpression, S context);
|
||||
|
||||
default void visit(MemberOfExpression memberOfExpression) {
|
||||
this.visit(memberOfExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(AnyComparisonExpression anyComparisonExpression, S context);
|
||||
|
||||
default void visit(AnyComparisonExpression anyComparisonExpression) {
|
||||
this.visit(anyComparisonExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(Concat concat, S context);
|
||||
|
||||
default void visit(Concat concat) {
|
||||
this.visit(concat, null);
|
||||
}
|
||||
|
||||
<S> T visit(Matches matches, S context);
|
||||
|
||||
default void visit(Matches matches) {
|
||||
this.visit(matches, null);
|
||||
}
|
||||
|
||||
<S> T visit(BitwiseAnd bitwiseAnd, S context);
|
||||
|
||||
default void visit(BitwiseAnd bitwiseAnd) {
|
||||
this.visit(bitwiseAnd, null);
|
||||
}
|
||||
|
||||
<S> T visit(BitwiseOr bitwiseOr, S context);
|
||||
|
||||
default void visit(BitwiseOr bitwiseOr) {
|
||||
this.visit(bitwiseOr, null);
|
||||
}
|
||||
|
||||
<S> T visit(BitwiseXor bitwiseXor, S context);
|
||||
|
||||
default void visit(BitwiseXor bitwiseXor) {
|
||||
this.visit(bitwiseXor, null);
|
||||
}
|
||||
|
||||
<S> T visit(CastExpression castExpression, S context);
|
||||
|
||||
default void visit(CastExpression castExpression) {
|
||||
this.visit(castExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(Modulo modulo, S context);
|
||||
|
||||
default void visit(Modulo modulo) {
|
||||
this.visit(modulo, null);
|
||||
}
|
||||
|
||||
<S> T visit(AnalyticExpression analyticExpression, S context);
|
||||
|
||||
default void visit(AnalyticExpression analyticExpression) {
|
||||
this.visit(analyticExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(ExtractExpression extractExpression, S context);
|
||||
|
||||
default void visit(ExtractExpression extractExpression) {
|
||||
this.visit(extractExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(IntervalExpression intervalExpression, S context);
|
||||
|
||||
default void visit(IntervalExpression intervalExpression) {
|
||||
this.visit(intervalExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(OracleHierarchicalExpression hierarchicalExpression, S context);
|
||||
|
||||
default void visit(OracleHierarchicalExpression hierarchicalExpression) {
|
||||
this.visit(hierarchicalExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(RegExpMatchOperator regExpMatchOperator, S context);
|
||||
|
||||
default void visit(RegExpMatchOperator regExpMatchOperator) {
|
||||
this.visit(regExpMatchOperator, null);
|
||||
}
|
||||
|
||||
<S> T visit(JsonExpression jsonExpression, S context);
|
||||
|
||||
default void visit(JsonExpression jsonExpression) {
|
||||
this.visit(jsonExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(JsonOperator jsonOperator, S context);
|
||||
|
||||
default void visit(JsonOperator jsonOperator) {
|
||||
this.visit(jsonOperator, null);
|
||||
}
|
||||
|
||||
<S> T visit(UserVariable userVariable, S context);
|
||||
|
||||
default void visit(UserVariable userVariable) {
|
||||
this.visit(userVariable, null);
|
||||
}
|
||||
|
||||
<S> T visit(NumericBind numericBind, S context);
|
||||
|
||||
default void visit(NumericBind numericBind) {
|
||||
this.visit(numericBind, null);
|
||||
}
|
||||
|
||||
<S> T visit(KeepExpression keepExpression, S context);
|
||||
|
||||
default void visit(KeepExpression keepExpression) {
|
||||
this.visit(keepExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(MySQLGroupConcat groupConcat, S context);
|
||||
|
||||
default void visit(MySQLGroupConcat groupConcat) {
|
||||
this.visit(groupConcat, null);
|
||||
}
|
||||
|
||||
<S> T visit(ExpressionList<? extends Expression> expressionList, S context);
|
||||
|
||||
default void visit(ExpressionList<? extends Expression> expressionList) {
|
||||
this.visit(expressionList, null);
|
||||
}
|
||||
|
||||
<S> T visit(RowConstructor<? extends Expression> rowConstructor, S context);
|
||||
|
||||
default void visit(RowConstructor<? extends Expression> rowConstructor) {
|
||||
this.visit(rowConstructor, null);
|
||||
}
|
||||
|
||||
<S> T visit(RowGetExpression rowGetExpression, S context);
|
||||
|
||||
default void visit(RowGetExpression rowGetExpression) {
|
||||
this.visit(rowGetExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(OracleHint hint, S context);
|
||||
|
||||
default void visit(OracleHint hint) {
|
||||
this.visit(hint, null);
|
||||
}
|
||||
|
||||
<S> T visit(TimeKeyExpression timeKeyExpression, S context);
|
||||
|
||||
default void visit(TimeKeyExpression timeKeyExpression) {
|
||||
this.visit(timeKeyExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(DateTimeLiteralExpression dateTimeLiteralExpression, S context);
|
||||
|
||||
default void visit(DateTimeLiteralExpression dateTimeLiteralExpression) {
|
||||
this.visit(dateTimeLiteralExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(NotExpression notExpression, S context);
|
||||
|
||||
default void visit(NotExpression notExpression) {
|
||||
this.visit(notExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(NextValExpression nextValExpression, S context);
|
||||
|
||||
default void visit(NextValExpression nextValExpression) {
|
||||
this.visit(nextValExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(CollateExpression collateExpression, S context);
|
||||
|
||||
default void visit(CollateExpression collateExpression) {
|
||||
this.visit(collateExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(SimilarToExpression similarToExpression, S context);
|
||||
|
||||
default void visit(SimilarToExpression similarToExpression) {
|
||||
this.visit(similarToExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(ArrayExpression arrayExpression, S context);
|
||||
|
||||
default void visit(ArrayExpression arrayExpression) {
|
||||
this.visit(arrayExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(ArrayConstructor arrayConstructor, S context);
|
||||
|
||||
default void visit(ArrayConstructor arrayConstructor) {
|
||||
this.visit(arrayConstructor, null);
|
||||
}
|
||||
|
||||
<S> T visit(VariableAssignment variableAssignment, S context);
|
||||
|
||||
default void visit(VariableAssignment variableAssignment) {
|
||||
this.visit(variableAssignment, null);
|
||||
}
|
||||
|
||||
<S> T visit(XMLSerializeExpr xmlSerializeExpr, S context);
|
||||
|
||||
default void visit(XMLSerializeExpr xmlSerializeExpr) {
|
||||
this.visit(xmlSerializeExpr, null);
|
||||
}
|
||||
|
||||
<S> T visit(TimezoneExpression timezoneExpression, S context);
|
||||
|
||||
default void visit(TimezoneExpression timezoneExpression) {
|
||||
this.visit(timezoneExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(JsonAggregateFunction jsonAggregateFunction, S context);
|
||||
|
||||
default void visit(JsonAggregateFunction jsonAggregateFunction) {
|
||||
this.visit(jsonAggregateFunction, null);
|
||||
}
|
||||
|
||||
<S> T visit(JsonFunction jsonFunction, S context);
|
||||
|
||||
default void visit(JsonFunction jsonFunction) {
|
||||
this.visit(jsonFunction, null);
|
||||
}
|
||||
|
||||
<S> T visit(ConnectByRootOperator connectByRootOperator, S context);
|
||||
|
||||
default void visit(ConnectByRootOperator connectByRootOperator) {
|
||||
this.visit(connectByRootOperator, null);
|
||||
}
|
||||
|
||||
<S> T visit(OracleNamedFunctionParameter oracleNamedFunctionParameter, S context);
|
||||
|
||||
default void visit(OracleNamedFunctionParameter oracleNamedFunctionParameter) {
|
||||
this.visit(oracleNamedFunctionParameter, null);
|
||||
}
|
||||
|
||||
<S> T visit(AllColumns allColumns, S context);
|
||||
|
||||
default void visit(AllColumns allColumns) {
|
||||
this.visit(allColumns, null);
|
||||
}
|
||||
|
||||
<S> T visit(AllTableColumns allTableColumns, S context);
|
||||
|
||||
default void visit(AllTableColumns allTableColumns) {
|
||||
this.visit(allTableColumns, null);
|
||||
}
|
||||
|
||||
<S> T visit(AllValue allValue, S context);
|
||||
|
||||
default void visit(AllValue allValue) {
|
||||
this.visit(allValue, null);
|
||||
}
|
||||
|
||||
<S> T visit(IsDistinctExpression isDistinctExpression, S context);
|
||||
|
||||
default void visit(IsDistinctExpression isDistinctExpression) {
|
||||
this.visit(isDistinctExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(GeometryDistance geometryDistance, S context);
|
||||
|
||||
default void visit(GeometryDistance geometryDistance) {
|
||||
this.visit(geometryDistance, null);
|
||||
}
|
||||
|
||||
<S> T visit(Select select, S context);
|
||||
|
||||
default void visit(Select select) {
|
||||
this.visit(select, null);
|
||||
}
|
||||
|
||||
<S> T visit(TranscodingFunction transcodingFunction, S context);
|
||||
|
||||
default void visit(TranscodingFunction transcodingFunction) {
|
||||
this.visit(transcodingFunction, null);
|
||||
}
|
||||
|
||||
<S> T visit(TrimFunction trimFunction, S context);
|
||||
|
||||
default void visit(TrimFunction trimFunction) {
|
||||
this.visit(trimFunction, null);
|
||||
}
|
||||
|
||||
<S> T visit(RangeExpression rangeExpression, S context);
|
||||
|
||||
default void visit(RangeExpression rangeExpression) {
|
||||
this.visit(rangeExpression, null);
|
||||
}
|
||||
|
||||
<S> T visit(TSQLLeftJoin tsqlLeftJoin, S context);
|
||||
|
||||
default void visit(TSQLLeftJoin tsqlLeftJoin) {
|
||||
this.visit(tsqlLeftJoin, null);
|
||||
}
|
||||
|
||||
<S> T visit(TSQLRightJoin tsqlRightJoin, S context);
|
||||
|
||||
default void visit(TSQLRightJoin tsqlRightJoin) {
|
||||
this.visit(tsqlRightJoin, null);
|
||||
}
|
||||
|
||||
<S> T visit(StructType structType, S context);
|
||||
|
||||
default void visit(StructType structType) {
|
||||
this.visit(structType, null);
|
||||
}
|
||||
|
||||
<S> T visit(LambdaExpression lambdaExpression, S context);
|
||||
|
||||
default void visit(LambdaExpression lambdaExpression) {
|
||||
this.visit(lambdaExpression, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,827 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Addition;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseAnd;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseLeftShift;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseOr;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseRightShift;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.BitwiseXor;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Concat;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Division;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.IntegerDivision;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Modulo;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Multiplication;
|
||||
import net.sf.jsqlparser.expression.operators.arithmetic.Subtraction;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
|
||||
import net.sf.jsqlparser.expression.operators.conditional.XorExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.Between;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ContainedBy;
|
||||
import net.sf.jsqlparser.expression.operators.relational.Contains;
|
||||
import net.sf.jsqlparser.expression.operators.relational.DoubleAnd;
|
||||
import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExistsExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.expression.operators.relational.FullTextSearch;
|
||||
import net.sf.jsqlparser.expression.operators.relational.GeometryDistance;
|
||||
import net.sf.jsqlparser.expression.operators.relational.GreaterThan;
|
||||
import net.sf.jsqlparser.expression.operators.relational.GreaterThanEquals;
|
||||
import net.sf.jsqlparser.expression.operators.relational.InExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IsBooleanExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IsDistinctExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.IsNullExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.JsonOperator;
|
||||
import net.sf.jsqlparser.expression.operators.relational.LikeExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.Matches;
|
||||
import net.sf.jsqlparser.expression.operators.relational.MemberOfExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.MinorThan;
|
||||
import net.sf.jsqlparser.expression.operators.relational.MinorThanEquals;
|
||||
import net.sf.jsqlparser.expression.operators.relational.NotEqualsTo;
|
||||
import net.sf.jsqlparser.expression.operators.relational.RegExpMatchOperator;
|
||||
import net.sf.jsqlparser.expression.operators.relational.SimilarToExpression;
|
||||
import net.sf.jsqlparser.expression.operators.relational.*;
|
||||
import net.sf.jsqlparser.schema.Column;
|
||||
import net.sf.jsqlparser.statement.select.AllColumns;
|
||||
import net.sf.jsqlparser.statement.select.AllTableColumns;
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
import net.sf.jsqlparser.statement.select.ParenthesedSelect;
|
||||
import net.sf.jsqlparser.statement.select.Pivot;
|
||||
import net.sf.jsqlparser.statement.select.PivotVisitor;
|
||||
import net.sf.jsqlparser.statement.select.PivotXml;
|
||||
import net.sf.jsqlparser.statement.select.Select;
|
||||
import net.sf.jsqlparser.statement.select.SelectItem;
|
||||
import net.sf.jsqlparser.statement.select.SelectItemVisitor;
|
||||
import net.sf.jsqlparser.statement.select.SelectVisitor;
|
||||
import net.sf.jsqlparser.statement.select.UnPivot;
|
||||
import net.sf.jsqlparser.statement.select.WithItem;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.UncommentedEmptyMethodBody"})
|
||||
public class ExpressionVisitorAdapter<T>
|
||||
implements ExpressionVisitor<T>, PivotVisitor<T>, SelectItemVisitor<T> {
|
||||
|
||||
private SelectVisitor<T> selectVisitor;
|
||||
|
||||
public SelectVisitor<T> getSelectVisitor() {
|
||||
return selectVisitor;
|
||||
}
|
||||
|
||||
public void setSelectVisitor(SelectVisitor<T> selectVisitor) {
|
||||
this.selectVisitor = selectVisitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(NullValue nullValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Function function, S context) {
|
||||
if (function.getParameters() != null) {
|
||||
function.getParameters().accept(this, context);
|
||||
}
|
||||
if (function.getKeep() != null) {
|
||||
function.getKeep().accept(this, context);
|
||||
}
|
||||
if (function.getOrderByElements() != null) {
|
||||
for (OrderByElement orderByElement : function.getOrderByElements()) {
|
||||
orderByElement.getExpression().accept(this, context);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(SignedExpression signedExpression, S context) {
|
||||
signedExpression.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(JdbcParameter jdbcParameter, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(JdbcNamedParameter jdbcNamedParameter, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(DoubleValue doubleValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(LongValue longValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(DateValue dateValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TimeValue timeValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TimestampValue timestampValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(StringValue stringValue, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Addition addition, S context) {
|
||||
visitBinaryExpression(addition, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Division division, S context) {
|
||||
visitBinaryExpression(division, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(IntegerDivision integerDivision, S context) {
|
||||
visitBinaryExpression(integerDivision, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Multiplication multiplication, S context) {
|
||||
visitBinaryExpression(multiplication, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Subtraction subtraction, S context) {
|
||||
visitBinaryExpression(subtraction, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(AndExpression andExpression, S context) {
|
||||
visitBinaryExpression(andExpression, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(OrExpression orExpression, S context) {
|
||||
visitBinaryExpression(orExpression, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(XorExpression xorExpression, S context) {
|
||||
visitBinaryExpression(xorExpression, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Between between, S context) {
|
||||
between.getLeftExpression().accept(this, context);
|
||||
between.getBetweenExpressionStart().accept(this, context);
|
||||
between.getBetweenExpressionEnd().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S> T visit(OverlapsCondition overlapsCondition, S context) {
|
||||
overlapsCondition.getLeft().accept(this, context);
|
||||
overlapsCondition.getRight().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <S> T visit(EqualsTo equalsTo, S context) {
|
||||
visitBinaryExpression(equalsTo, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(GreaterThan greaterThan, S context) {
|
||||
visitBinaryExpression(greaterThan, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(GreaterThanEquals greaterThanEquals, S context) {
|
||||
visitBinaryExpression(greaterThanEquals, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(InExpression inExpression, S context) {
|
||||
inExpression.getLeftExpression().accept(this, context);
|
||||
inExpression.getRightExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(IncludesExpression includesExpression, S context) {
|
||||
includesExpression.getLeftExpression().accept(this, context);
|
||||
includesExpression.getRightExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ExcludesExpression excludesExpression, S context) {
|
||||
excludesExpression.getLeftExpression().accept(this, context);
|
||||
excludesExpression.getRightExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(IsNullExpression isNullExpression, S context) {
|
||||
isNullExpression.getLeftExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(FullTextSearch fullTextSearch, S context) {
|
||||
for (Column col : fullTextSearch.getMatchColumns()) {
|
||||
col.accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(IsBooleanExpression isBooleanExpression, S context) {
|
||||
isBooleanExpression.getLeftExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(LikeExpression likeExpression, S context) {
|
||||
visitBinaryExpression(likeExpression, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(MinorThan minorThan, S context) {
|
||||
visitBinaryExpression(minorThan, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(MinorThanEquals minorThanEquals, S context) {
|
||||
visitBinaryExpression(minorThanEquals, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(NotEqualsTo notEqualsTo, S context) {
|
||||
visitBinaryExpression(notEqualsTo, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(DoubleAnd doubleAnd, S context) {
|
||||
visitBinaryExpression(doubleAnd, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Contains contains, S context) {
|
||||
visitBinaryExpression(contains, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ContainedBy containedBy, S context) {
|
||||
visitBinaryExpression(containedBy, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Column column, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ParenthesedSelect select, S context) {
|
||||
visit((Select) select, context);
|
||||
if (select.getPivot() != null) {
|
||||
select.getPivot().accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(CaseExpression caseExpression, S context) {
|
||||
if (caseExpression.getSwitchExpression() != null) {
|
||||
caseExpression.getSwitchExpression().accept(this, context);
|
||||
}
|
||||
for (Expression x : caseExpression.getWhenClauses()) {
|
||||
x.accept(this, context);
|
||||
}
|
||||
if (caseExpression.getElseExpression() != null) {
|
||||
caseExpression.getElseExpression().accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(WhenClause whenClause, S context) {
|
||||
whenClause.getWhenExpression().accept(this, context);
|
||||
whenClause.getThenExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ExistsExpression existsExpression, S context) {
|
||||
existsExpression.getRightExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(MemberOfExpression memberOfExpression, S context) {
|
||||
memberOfExpression.getRightExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(AnyComparisonExpression anyComparisonExpression, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Concat concat, S context) {
|
||||
visitBinaryExpression(concat, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Matches matches, S context) {
|
||||
visitBinaryExpression(matches, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(BitwiseAnd bitwiseAnd, S context) {
|
||||
visitBinaryExpression(bitwiseAnd, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(BitwiseOr bitwiseOr, S context) {
|
||||
visitBinaryExpression(bitwiseOr, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(BitwiseXor bitwiseXor, S context) {
|
||||
visitBinaryExpression(bitwiseXor, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(CastExpression castExpression, S context) {
|
||||
castExpression.getLeftExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Modulo modulo, S context) {
|
||||
visitBinaryExpression(modulo, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(AnalyticExpression analyticExpression, S context) {
|
||||
if (analyticExpression.getExpression() != null) {
|
||||
analyticExpression.getExpression().accept(this, context);
|
||||
}
|
||||
if (analyticExpression.getDefaultValue() != null) {
|
||||
analyticExpression.getDefaultValue().accept(this, context);
|
||||
}
|
||||
if (analyticExpression.getOffset() != null) {
|
||||
analyticExpression.getOffset().accept(this, context);
|
||||
}
|
||||
if (analyticExpression.getKeep() != null) {
|
||||
analyticExpression.getKeep().accept(this, context);
|
||||
}
|
||||
if (analyticExpression.getFuncOrderBy() != null) {
|
||||
for (OrderByElement element : analyticExpression.getOrderByElements()) {
|
||||
element.getExpression().accept(this, context);
|
||||
}
|
||||
}
|
||||
if (analyticExpression.getWindowElement() != null) {
|
||||
/*
|
||||
* Visit expressions from the range and offset of the window element. Do this using
|
||||
* optional chains, because several things down the tree can be null e.g. the
|
||||
* expression. So, null-safe versions of e.g.:
|
||||
* analyticExpression.getWindowElement().getOffset().getExpression().accept(this,
|
||||
* parameters);
|
||||
*/
|
||||
Optional.ofNullable(analyticExpression.getWindowElement().getRange())
|
||||
.map(WindowRange::getStart)
|
||||
.map(WindowOffset::getExpression).ifPresent(e -> e.accept(this, context));
|
||||
Optional.ofNullable(analyticExpression.getWindowElement().getRange())
|
||||
.map(WindowRange::getEnd)
|
||||
.map(WindowOffset::getExpression).ifPresent(e -> e.accept(this, context));
|
||||
Optional.ofNullable(analyticExpression.getWindowElement().getOffset())
|
||||
.map(WindowOffset::getExpression).ifPresent(e -> e.accept(this, context));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ExtractExpression extractExpression, S context) {
|
||||
extractExpression.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(IntervalExpression intervalExpression, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(OracleHierarchicalExpression hierarchicalExpression, S context) {
|
||||
hierarchicalExpression.getConnectExpression().accept(this, context);
|
||||
hierarchicalExpression.getStartExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(RegExpMatchOperator regExpMatchOperator, S context) {
|
||||
visitBinaryExpression(regExpMatchOperator, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ExpressionList<? extends Expression> expressionList, S context) {
|
||||
for (Expression expr : expressionList) {
|
||||
expr.accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(RowConstructor<? extends Expression> rowConstructor, S context) {
|
||||
for (Expression expr : rowConstructor) {
|
||||
expr.accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(NotExpression notExpr, S context) {
|
||||
notExpr.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(BitwiseRightShift bitwiseRightShift, S context) {
|
||||
visitBinaryExpression(bitwiseRightShift, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(BitwiseLeftShift bitwiseLeftShift, S context) {
|
||||
visitBinaryExpression(bitwiseLeftShift, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
protected <S> T visitBinaryExpression(BinaryExpression binaryExpression, S context) {
|
||||
binaryExpression.getLeftExpression().accept(this, context);
|
||||
binaryExpression.getRightExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(JsonExpression jsonExpr, S context) {
|
||||
jsonExpr.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(JsonOperator jsonOperator, S context) {
|
||||
visitBinaryExpression(jsonOperator, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(UserVariable userVariable, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(NumericBind numericBind, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(KeepExpression keepExpression, S context) {
|
||||
for (OrderByElement element : keepExpression.getOrderByElements()) {
|
||||
element.getExpression().accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(MySQLGroupConcat groupConcat, S context) {
|
||||
for (Expression expr : groupConcat.getExpressionList()) {
|
||||
expr.accept(this, context);
|
||||
}
|
||||
if (groupConcat.getOrderByElements() != null) {
|
||||
for (OrderByElement element : groupConcat.getOrderByElements()) {
|
||||
element.getExpression().accept(this, context);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Pivot pivot, S context) {
|
||||
for (SelectItem<?> item : pivot.getFunctionItems()) {
|
||||
item.getExpression().accept(this, context);
|
||||
}
|
||||
for (Column col : pivot.getForColumns()) {
|
||||
col.accept(this, context);
|
||||
}
|
||||
if (pivot.getSingleInItems() != null) {
|
||||
for (SelectItem<?> item : pivot.getSingleInItems()) {
|
||||
item.getExpression().accept(this, context);
|
||||
}
|
||||
}
|
||||
|
||||
if (pivot.getMultiInItems() != null) {
|
||||
for (SelectItem<ExpressionList<?>> item : pivot.getMultiInItems()) {
|
||||
item.getExpression().accept(this, context);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(PivotXml pivotXml, S context) {
|
||||
for (SelectItem<?> item : pivotXml.getFunctionItems()) {
|
||||
item.getExpression().accept(this, context);
|
||||
}
|
||||
for (Column col : pivotXml.getForColumns()) {
|
||||
col.accept(this, context);
|
||||
}
|
||||
if (pivotXml.getInSelect() != null && selectVisitor != null) {
|
||||
pivotXml.getInSelect().accept(selectVisitor, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(UnPivot unpivot, S context) {
|
||||
unpivot.accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(AllColumns allColumns, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(AllTableColumns allTableColumns, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(AllValue allValue, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(IsDistinctExpression isDistinctExpression, S context) {
|
||||
visitBinaryExpression(isDistinctExpression, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(SelectItem<? extends Expression> selectItem, S context) {
|
||||
selectItem.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(RowGetExpression rowGetExpression, S context) {
|
||||
rowGetExpression.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(HexValue hexValue, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(OracleHint hint, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TimeKeyExpression timeKeyExpression, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(DateTimeLiteralExpression dateTimeLiteralExpression, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(NextValExpression nextValExpression, S context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(CollateExpression collateExpression, S context) {
|
||||
collateExpression.getLeftExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(SimilarToExpression similarToExpression, S context) {
|
||||
visitBinaryExpression(similarToExpression, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ArrayExpression arrayExpression, S context) {
|
||||
arrayExpression.getObjExpression().accept(this, context);
|
||||
if (arrayExpression.getIndexExpression() != null) {
|
||||
arrayExpression.getIndexExpression().accept(this, context);
|
||||
}
|
||||
if (arrayExpression.getStartIndexExpression() != null) {
|
||||
arrayExpression.getStartIndexExpression().accept(this, context);
|
||||
}
|
||||
if (arrayExpression.getStopIndexExpression() != null) {
|
||||
arrayExpression.getStopIndexExpression().accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ArrayConstructor arrayConstructor, S context) {
|
||||
for (Expression expression : arrayConstructor.getExpressions()) {
|
||||
expression.accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(VariableAssignment variableAssignment, S context) {
|
||||
variableAssignment.getVariable().accept(this, context);
|
||||
variableAssignment.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(XMLSerializeExpr xmlSerializeExpr, S context) {
|
||||
xmlSerializeExpr.getExpression().accept(this, context);
|
||||
for (OrderByElement elm : xmlSerializeExpr.getOrderByElements()) {
|
||||
elm.getExpression().accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TimezoneExpression timezoneExpression, S context) {
|
||||
timezoneExpression.getLeftExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(JsonAggregateFunction jsonAggregateFunction, S context) {
|
||||
Expression expr = jsonAggregateFunction.getExpression();
|
||||
if (expr != null) {
|
||||
expr.accept(this, context);
|
||||
}
|
||||
|
||||
expr = jsonAggregateFunction.getFilterExpression();
|
||||
if (expr != null) {
|
||||
expr.accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(JsonFunction jsonFunction, S context) {
|
||||
for (JsonFunctionExpression expr : jsonFunction.getExpressions()) {
|
||||
expr.getExpression().accept(this, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(ConnectByRootOperator connectByRootOperator, S context) {
|
||||
connectByRootOperator.getColumn().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(OracleNamedFunctionParameter oracleNamedFunctionParameter, S context) {
|
||||
oracleNamedFunctionParameter.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(GeometryDistance geometryDistance, S context) {
|
||||
visitBinaryExpression(geometryDistance, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(Select select, S context) {
|
||||
if (selectVisitor != null) {
|
||||
if (select.getWithItemsList() != null) {
|
||||
for (WithItem item : select.getWithItemsList()) {
|
||||
item.accept(selectVisitor, context);
|
||||
}
|
||||
}
|
||||
select.accept(selectVisitor, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TranscodingFunction transcodingFunction, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TrimFunction trimFunction, S context) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(RangeExpression rangeExpression, S context) {
|
||||
rangeExpression.getStartExpression().accept(this, context);
|
||||
rangeExpression.getEndExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TSQLLeftJoin tsqlLeftJoin, S context) {
|
||||
visitBinaryExpression(tsqlLeftJoin, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(TSQLRightJoin tsqlRightJoin, S context) {
|
||||
visitBinaryExpression(tsqlRightJoin, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(StructType structType, S context) {
|
||||
// @todo: visit the ColType also
|
||||
if (structType.getArguments() != null) {
|
||||
for (SelectItem<?> selectItem : structType.getArguments()) {
|
||||
visit(selectItem, context);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <S> T visit(LambdaExpression lambdaExpression, S context) {
|
||||
lambdaExpression.getExpression().accept(this, context);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* Extract value from date/time expression. The name stores the part - name to get from the
|
||||
* following date/time expression.
|
||||
*
|
||||
* @author tw
|
||||
*/
|
||||
public class ExtractExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String name;
|
||||
private Expression expression;
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EXTRACT(" + name + " FROM " + expression + ')';
|
||||
}
|
||||
|
||||
public ExtractExpression withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ExtractExpression withExpression(Expression expression) {
|
||||
this.setExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getExpression(Class<E> type) {
|
||||
return type.cast(getExpression());
|
||||
}
|
||||
}
|
||||
142
src/main/java/net/sf/jsqlparser/expression/FilterOverImpl.java
Normal file
142
src/main/java/net/sf/jsqlparser/expression/FilterOverImpl.java
Normal file
@@ -0,0 +1,142 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
/**
|
||||
* @author tw
|
||||
*/
|
||||
public class FilterOverImpl extends ASTNodeAccessImpl {
|
||||
private final OrderByClause orderBy = new OrderByClause();
|
||||
private final PartitionByClause partitionBy = new PartitionByClause();
|
||||
private AnalyticType analyticType = AnalyticType.FILTER_ONLY;
|
||||
private Expression filterExpression = null;
|
||||
private WindowElement windowElement = null;
|
||||
|
||||
public AnalyticType getAnalyticType() {
|
||||
return analyticType;
|
||||
}
|
||||
|
||||
public void setAnalyticType(AnalyticType analyticType) {
|
||||
this.analyticType = analyticType;
|
||||
}
|
||||
|
||||
public FilterOverImpl withAnalyticType(AnalyticType analyticType) {
|
||||
this.setAnalyticType(analyticType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<OrderByElement> getOrderByElements() {
|
||||
return orderBy.getOrderByElements();
|
||||
}
|
||||
|
||||
public void setOrderByElements(List<OrderByElement> orderByElements) {
|
||||
orderBy.setOrderByElements(orderByElements);
|
||||
}
|
||||
|
||||
public FilterOverImpl withOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.setOrderByElements(orderByElements);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ExpressionList getPartitionExpressionList() {
|
||||
return partitionBy.getPartitionExpressionList();
|
||||
}
|
||||
|
||||
public void setPartitionExpressionList(ExpressionList partitionExpressionList) {
|
||||
setPartitionExpressionList(partitionExpressionList, false);
|
||||
}
|
||||
|
||||
public void setPartitionExpressionList(ExpressionList partitionExpressionList,
|
||||
boolean brackets) {
|
||||
partitionBy.setPartitionExpressionList(partitionExpressionList, brackets);
|
||||
}
|
||||
|
||||
public boolean isPartitionByBrackets() {
|
||||
return partitionBy.isBrackets();
|
||||
}
|
||||
|
||||
public Expression getFilterExpression() {
|
||||
return filterExpression;
|
||||
}
|
||||
|
||||
public void setFilterExpression(Expression filterExpression) {
|
||||
this.filterExpression = filterExpression;
|
||||
}
|
||||
|
||||
|
||||
public FilterOverImpl withFilterExpression(Expression filterExpression) {
|
||||
this.setFilterExpression(filterExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public WindowElement getWindowElement() {
|
||||
return windowElement;
|
||||
}
|
||||
|
||||
public void setWindowElement(WindowElement windowElement) {
|
||||
this.windowElement = windowElement;
|
||||
}
|
||||
|
||||
public FilterOverImpl withWindowElement(WindowElement windowElement) {
|
||||
this.setWindowElement(windowElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity",
|
||||
"PMD.MissingBreakInSwitch"})
|
||||
public StringBuilder append(StringBuilder builder) {
|
||||
if (filterExpression != null) {
|
||||
builder.append("FILTER (WHERE ");
|
||||
builder.append(filterExpression.toString());
|
||||
builder.append(")");
|
||||
if (analyticType != AnalyticType.FILTER_ONLY) {
|
||||
builder.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
switch (analyticType) {
|
||||
case FILTER_ONLY:
|
||||
return builder;
|
||||
case WITHIN_GROUP:
|
||||
builder.append("WITHIN GROUP");
|
||||
break;
|
||||
default:
|
||||
builder.append("OVER");
|
||||
}
|
||||
builder.append(" (");
|
||||
|
||||
partitionBy.toStringPartitionBy(builder);
|
||||
orderBy.toStringOrderByElements(builder);
|
||||
|
||||
if (windowElement != null) {
|
||||
if (orderBy.getOrderByElements() != null) {
|
||||
builder.append(' ');
|
||||
}
|
||||
builder.append(windowElement);
|
||||
}
|
||||
|
||||
builder.append(")");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
return append(builder).toString();
|
||||
}
|
||||
}
|
||||
456
src/main/java/net/sf/jsqlparser/expression/Function.java
Normal file
456
src/main/java/net/sf/jsqlparser/expression/Function.java
Normal file
@@ -0,0 +1,456 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.expression.operators.relational.NamedExpressionList;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.schema.Column;
|
||||
import net.sf.jsqlparser.statement.select.Limit;
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A function as MAX,COUNT...
|
||||
*/
|
||||
public class Function extends ASTNodeAccessImpl implements Expression {
|
||||
private List<String> nameparts;
|
||||
private ExpressionList<?> parameters;
|
||||
private NamedExpressionList<?> namedParameters;
|
||||
private boolean allColumns = false;
|
||||
private boolean distinct = false;
|
||||
private boolean unique = false;
|
||||
private boolean isEscaped = false;
|
||||
private Expression attributeExpression;
|
||||
private HavingClause havingClause;
|
||||
private Column attributeColumn = null;
|
||||
private List<OrderByElement> orderByElements;
|
||||
private NullHandling nullHandling = null;
|
||||
private boolean ignoreNullsOutside = false; // IGNORE NULLS outside function parameters
|
||||
private Limit limit = null;
|
||||
private KeepExpression keep = null;
|
||||
|
||||
public Function() {}
|
||||
|
||||
public Function(String name, Expression... parameters) {
|
||||
this.nameparts = Arrays.asList(name);
|
||||
this.parameters = new ExpressionList<>(parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return nameparts == null ? null
|
||||
: String.join(nameparts.get(0).equalsIgnoreCase("APPROXIMATE") ? " " : ".",
|
||||
nameparts);
|
||||
}
|
||||
|
||||
public void setName(String string) {
|
||||
nameparts = Arrays.asList(string);
|
||||
}
|
||||
|
||||
public void setName(List<String> string) {
|
||||
nameparts = string;
|
||||
}
|
||||
|
||||
public List<String> getMultipartName() {
|
||||
return nameparts;
|
||||
}
|
||||
|
||||
public Function withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withName(List<String> nameparts) {
|
||||
this.nameparts = nameparts;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAllColumns() {
|
||||
return allColumns;
|
||||
}
|
||||
|
||||
public void setAllColumns(boolean b) {
|
||||
allColumns = b;
|
||||
}
|
||||
|
||||
public NullHandling getNullHandling() {
|
||||
return nullHandling;
|
||||
}
|
||||
|
||||
public Function setNullHandling(NullHandling nullHandling) {
|
||||
this.nullHandling = nullHandling;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isIgnoreNullsOutside() {
|
||||
return ignoreNullsOutside;
|
||||
}
|
||||
|
||||
public Function setIgnoreNullsOutside(boolean ignoreNullsOutside) {
|
||||
this.ignoreNullsOutside = ignoreNullsOutside;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Limit getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public Function setLimit(Limit limit) {
|
||||
this.limit = limit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isIgnoreNulls() {
|
||||
return nullHandling != null && nullHandling == NullHandling.IGNORE_NULLS;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is at the moment only necessary for AnalyticExpression initialization and not for normal
|
||||
* functions. Therefore there is no deparsing for it for normal functions.
|
||||
*/
|
||||
public void setIgnoreNulls(boolean ignoreNulls) {
|
||||
this.nullHandling = ignoreNulls ? NullHandling.IGNORE_NULLS : null;
|
||||
}
|
||||
|
||||
public HavingClause getHavingClause() {
|
||||
return havingClause;
|
||||
}
|
||||
|
||||
public Function setHavingClause(HavingClause havingClause) {
|
||||
this.havingClause = havingClause;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function setHavingClause(String havingType, Expression expression) {
|
||||
this.havingClause = new HavingClause(
|
||||
HavingClause.HavingType.valueOf(havingType.trim().toUpperCase()), expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* true if the function is "distinct"
|
||||
*
|
||||
* @return true if the function is "distinct"
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean b) {
|
||||
distinct = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* true if the function is "unique"
|
||||
*
|
||||
* @return true if the function is "unique"
|
||||
*/
|
||||
public boolean isUnique() {
|
||||
return unique;
|
||||
}
|
||||
|
||||
public void setUnique(boolean b) {
|
||||
unique = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of parameters of the function (if any, else null) If the parameter is "*",
|
||||
* allColumns is set to true
|
||||
*
|
||||
* @return the list of parameters of the function (if any, else null)
|
||||
*/
|
||||
public ExpressionList<?> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void setParameters(Expression... expressions) {
|
||||
if (expressions.length == 1 && expressions[0] instanceof ExpressionList) {
|
||||
parameters = (ExpressionList<?>) expressions[0];
|
||||
} else {
|
||||
parameters = new ExpressionList<>(expressions);
|
||||
}
|
||||
}
|
||||
|
||||
public void setParameters(ExpressionList<?> list) {
|
||||
parameters = list;
|
||||
}
|
||||
|
||||
/**
|
||||
* the parameters might be named parameters, e.g. substring('foobar' from 2 for 3)
|
||||
*
|
||||
* @return the list of named parameters of the function (if any, else null)
|
||||
*/
|
||||
public NamedExpressionList<?> getNamedParameters() {
|
||||
return namedParameters;
|
||||
}
|
||||
|
||||
public void setNamedParameters(NamedExpressionList<?> list) {
|
||||
namedParameters = list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if it's in the form "{fn function_body() }"
|
||||
*
|
||||
* @return true if it's java-escaped
|
||||
*/
|
||||
public boolean isEscaped() {
|
||||
return isEscaped;
|
||||
}
|
||||
|
||||
public void setEscaped(boolean isEscaped) {
|
||||
this.isEscaped = isEscaped;
|
||||
}
|
||||
|
||||
public Object getAttribute() {
|
||||
return attributeExpression != null ? attributeExpression : attributeColumn;
|
||||
}
|
||||
|
||||
public void setAttribute(Expression attributeExpression) {
|
||||
this.attributeExpression = attributeExpression;
|
||||
}
|
||||
|
||||
public void setAttribute(Column attributeColumn) {
|
||||
attributeExpression = null;
|
||||
this.attributeColumn = attributeColumn;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getAttributeName() {
|
||||
return attributeColumn.toString();
|
||||
}
|
||||
|
||||
public void setAttributeName(String attributeName) {
|
||||
this.attributeColumn = new Column().withColumnName(attributeName);
|
||||
}
|
||||
|
||||
public Column getAttributeColumn() {
|
||||
return attributeColumn;
|
||||
}
|
||||
|
||||
public Function withAttribute(Column attributeColumn) {
|
||||
setAttribute(attributeColumn);
|
||||
return this;
|
||||
}
|
||||
|
||||
public KeepExpression getKeep() {
|
||||
return keep;
|
||||
}
|
||||
|
||||
public void setKeep(KeepExpression keep) {
|
||||
this.keep = keep;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public String toString() {
|
||||
String params;
|
||||
|
||||
if (parameters != null || namedParameters != null) {
|
||||
if (parameters != null) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append("(");
|
||||
if (isDistinct()) {
|
||||
b.append("DISTINCT ");
|
||||
} else if (isUnique()) {
|
||||
b.append("UNIQUE ");
|
||||
}
|
||||
if (isAllColumns()) {
|
||||
b.append("ALL ");
|
||||
}
|
||||
b.append(parameters);
|
||||
|
||||
if (havingClause != null) {
|
||||
havingClause.appendTo(b);
|
||||
}
|
||||
|
||||
if (nullHandling != null && !isIgnoreNullsOutside()) {
|
||||
switch (nullHandling) {
|
||||
case IGNORE_NULLS:
|
||||
b.append(" IGNORE NULLS");
|
||||
break;
|
||||
case RESPECT_NULLS:
|
||||
b.append(" RESPECT NULLS");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (orderByElements != null) {
|
||||
b.append(" ORDER BY ");
|
||||
boolean comma = false;
|
||||
for (OrderByElement orderByElement : orderByElements) {
|
||||
if (comma) {
|
||||
b.append(", ");
|
||||
} else {
|
||||
comma = true;
|
||||
}
|
||||
b.append(orderByElement);
|
||||
}
|
||||
}
|
||||
if (limit != null) {
|
||||
b.append(limit);
|
||||
}
|
||||
b.append(")");
|
||||
params = b.toString();
|
||||
} else {
|
||||
params = namedParameters.toString();
|
||||
}
|
||||
} else {
|
||||
params = "()";
|
||||
}
|
||||
|
||||
String ans = getName() + params;
|
||||
|
||||
if (nullHandling != null && isIgnoreNullsOutside()) {
|
||||
switch (nullHandling) {
|
||||
case IGNORE_NULLS:
|
||||
ans += " IGNORE NULLS";
|
||||
break;
|
||||
case RESPECT_NULLS:
|
||||
ans += " RESPECT NULLS";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attributeExpression != null) {
|
||||
ans += "." + attributeExpression;
|
||||
} else if (attributeColumn != null) {
|
||||
ans += "." + attributeColumn;
|
||||
}
|
||||
|
||||
if (keep != null) {
|
||||
ans += " " + keep;
|
||||
}
|
||||
|
||||
if (isEscaped) {
|
||||
ans = "{fn " + ans + "}";
|
||||
}
|
||||
|
||||
return ans;
|
||||
}
|
||||
|
||||
public Function withAttribute(Expression attribute) {
|
||||
this.setAttribute(attribute);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Function withAttributeName(String attributeName) {
|
||||
this.setAttributeName(attributeName);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withKeep(KeepExpression keep) {
|
||||
this.setKeep(keep);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withIgnoreNulls(boolean ignoreNulls) {
|
||||
this.setIgnoreNulls(ignoreNulls);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withParameters(ExpressionList<?> parameters) {
|
||||
this.setParameters(parameters);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withParameters(Expression... parameters) {
|
||||
return withParameters(new ExpressionList<>(parameters));
|
||||
}
|
||||
|
||||
public Function withNamedParameters(NamedExpressionList<?> namedParameters) {
|
||||
this.setNamedParameters(namedParameters);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withAllColumns(boolean allColumns) {
|
||||
this.setAllColumns(allColumns);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withDistinct(boolean distinct) {
|
||||
this.setDistinct(distinct);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Function withUnique(boolean unique) {
|
||||
this.setUnique(unique);
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<OrderByElement> getOrderByElements() {
|
||||
return orderByElements;
|
||||
}
|
||||
|
||||
public void setOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.orderByElements = orderByElements;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getAttribute(Class<E> type) {
|
||||
return type.cast(getAttribute());
|
||||
}
|
||||
|
||||
public enum NullHandling {
|
||||
IGNORE_NULLS, RESPECT_NULLS;
|
||||
}
|
||||
|
||||
public static class HavingClause extends ASTNodeAccessImpl implements Expression {
|
||||
HavingType havingType;
|
||||
Expression expression;
|
||||
|
||||
public HavingClause(HavingType havingType, Expression expression) {
|
||||
this.havingType = havingType;
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public HavingType getHavingType() {
|
||||
return havingType;
|
||||
}
|
||||
|
||||
public HavingClause setHavingType(HavingType havingType) {
|
||||
this.havingType = havingType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public HavingClause setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expression.accept(expressionVisitor, context);
|
||||
}
|
||||
|
||||
public StringBuilder appendTo(StringBuilder builder) {
|
||||
builder.append(" HAVING ").append(havingType.name()).append(" ").append(expression);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return appendTo(new StringBuilder()).toString();
|
||||
}
|
||||
|
||||
enum HavingType {
|
||||
MAX, MIN;
|
||||
}
|
||||
}
|
||||
}
|
||||
93
src/main/java/net/sf/jsqlparser/expression/HexValue.java
Normal file
93
src/main/java/net/sf/jsqlparser/expression/HexValue.java
Normal file
@@ -0,0 +1,93 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class HexValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String value;
|
||||
|
||||
public HexValue() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public HexValue(final String value) {
|
||||
String val = value;
|
||||
this.value = val;
|
||||
}
|
||||
|
||||
public static byte[] hexStringToByteArray(String s) {
|
||||
int len = s.length();
|
||||
byte[] data = new byte[len / 2];
|
||||
for (int i = 0; i < len; i += 2) {
|
||||
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
|
||||
+ Character.digit(s.charAt(i + 1), 16));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public HexValue withValue(String value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDigits() {
|
||||
return value.toUpperCase().startsWith("0X")
|
||||
? value.substring(2)
|
||||
: value.substring(2, value.length() - 1);
|
||||
}
|
||||
|
||||
public Long getLong() {
|
||||
return Long.parseLong(
|
||||
getDigits(), 16);
|
||||
}
|
||||
|
||||
public LongValue getLongValue() {
|
||||
return new LongValue(getLong());
|
||||
}
|
||||
|
||||
// `X'C3BC'` --> `'ü'`
|
||||
public StringValue getStringValue() {
|
||||
return new StringValue(
|
||||
new String(hexStringToByteArray(getDigits()), StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
// `X'C3BC'` --> `\xC3\xBC`
|
||||
public StringValue getBlob() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String digits = getDigits();
|
||||
int len = digits.length();
|
||||
for (int i = 0; i < len; i += 2) {
|
||||
builder.append("\\x").append(digits.charAt(i)).append(digits.charAt(i + 1));
|
||||
}
|
||||
return new StringValue(builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class IntervalExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private final boolean intervalKeyword;
|
||||
private String parameter = null;
|
||||
private String intervalType = null;
|
||||
private Expression expression = null;
|
||||
|
||||
public IntervalExpression() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public IntervalExpression(boolean intervalKeyword) {
|
||||
this.intervalKeyword = intervalKeyword;
|
||||
}
|
||||
|
||||
public IntervalExpression(int value, String type) {
|
||||
this.parameter = null;
|
||||
this.intervalKeyword = true;
|
||||
this.expression = new LongValue(value);
|
||||
this.intervalType = type;
|
||||
}
|
||||
|
||||
public boolean isUsingIntervalKeyword() {
|
||||
return intervalKeyword;
|
||||
}
|
||||
|
||||
public String getParameter() {
|
||||
return parameter;
|
||||
}
|
||||
|
||||
public void setParameter(String parameter) {
|
||||
this.parameter = parameter;
|
||||
}
|
||||
|
||||
public String getIntervalType() {
|
||||
return intervalType;
|
||||
}
|
||||
|
||||
public void setIntervalType(String intervalType) {
|
||||
this.intervalType = intervalType;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (intervalKeyword ? "INTERVAL " : "")
|
||||
+ Objects.toString(expression, parameter)
|
||||
+ (intervalType != null ? " " + intervalType : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public IntervalExpression withParameter(String parameter) {
|
||||
this.setParameter(parameter);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntervalExpression withIntervalType(String intervalType) {
|
||||
this.setIntervalType(intervalType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntervalExpression withExpression(Expression expression) {
|
||||
this.setExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getExpression(Class<E> type) {
|
||||
return type.cast(getExpression());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class JdbcNamedParameter extends ASTNodeAccessImpl implements Expression {
|
||||
private String parameterCharacter = ":";
|
||||
private String name;
|
||||
|
||||
public JdbcNamedParameter() {}
|
||||
|
||||
public JdbcNamedParameter(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getParameterCharacter() {
|
||||
return parameterCharacter;
|
||||
}
|
||||
|
||||
public JdbcNamedParameter setParameterCharacter(String parameterCharacter) {
|
||||
this.parameterCharacter = parameterCharacter;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return parameterCharacter + name;
|
||||
}
|
||||
|
||||
public JdbcNamedParameter withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* A '?' in a statement or a ?<number> e.g. ?4
|
||||
*/
|
||||
public class JdbcParameter extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String parameterCharacter = "?";
|
||||
private Integer index;
|
||||
private boolean useFixedIndex = false;
|
||||
|
||||
public JdbcParameter() {}
|
||||
|
||||
public JdbcParameter(Integer index, boolean useFixedIndex, String parameterCharacter) {
|
||||
this.index = index;
|
||||
this.useFixedIndex = useFixedIndex;
|
||||
this.parameterCharacter = parameterCharacter;
|
||||
|
||||
// This is needed for Parameters starting with "$" like "$2"
|
||||
// Those will contain the index in the parameterCharacter
|
||||
final Pattern pattern = Pattern.compile("(\\$)(\\d*)");
|
||||
final Matcher matcher = pattern.matcher(parameterCharacter);
|
||||
if (matcher.find() && matcher.groupCount() == 2) {
|
||||
this.useFixedIndex = true;
|
||||
this.parameterCharacter = matcher.group(1);
|
||||
this.index = Integer.valueOf(matcher.group(2));
|
||||
}
|
||||
}
|
||||
|
||||
public String getParameterCharacter() {
|
||||
return parameterCharacter;
|
||||
}
|
||||
|
||||
public JdbcParameter setParameterCharacter(String parameterCharacter) {
|
||||
this.parameterCharacter = parameterCharacter;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public boolean isUseFixedIndex() {
|
||||
return useFixedIndex;
|
||||
}
|
||||
|
||||
public void setUseFixedIndex(boolean useFixedIndex) {
|
||||
this.useFixedIndex = useFixedIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return useFixedIndex ? parameterCharacter + index : parameterCharacter;
|
||||
}
|
||||
|
||||
public JdbcParameter withIndex(Integer index) {
|
||||
this.setIndex(index);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JdbcParameter withUseFixedIndex(boolean useFixedIndex) {
|
||||
this.setUseFixedIndex(useFixedIndex);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
|
||||
public class JsonAggregateFunction extends FilterOverImpl implements Expression {
|
||||
private final OrderByClause expressionOrderBy = new OrderByClause();
|
||||
private JsonFunctionType functionType;
|
||||
private Expression expression = null;
|
||||
private boolean usingKeyKeyword = false;
|
||||
private String key;
|
||||
private boolean usingValueKeyword = false;
|
||||
private Object value;
|
||||
|
||||
private boolean usingFormatJson = false;
|
||||
|
||||
private JsonAggregateOnNullType onNullType;
|
||||
private JsonAggregateUniqueKeysType uniqueKeysType;
|
||||
|
||||
|
||||
public JsonAggregateOnNullType getOnNullType() {
|
||||
return onNullType;
|
||||
}
|
||||
|
||||
public void setOnNullType(JsonAggregateOnNullType onNullType) {
|
||||
this.onNullType = onNullType;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withOnNullType(JsonAggregateOnNullType onNullType) {
|
||||
this.setOnNullType(onNullType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonAggregateUniqueKeysType getUniqueKeysType() {
|
||||
return uniqueKeysType;
|
||||
}
|
||||
|
||||
public void setUniqueKeysType(JsonAggregateUniqueKeysType uniqueKeysType) {
|
||||
this.uniqueKeysType = uniqueKeysType;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withUniqueKeysType(JsonAggregateUniqueKeysType uniqueKeysType) {
|
||||
this.setUniqueKeysType(uniqueKeysType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonFunctionType getType() {
|
||||
return functionType;
|
||||
}
|
||||
|
||||
public void setType(JsonFunctionType type) {
|
||||
this.functionType = Objects.requireNonNull(type,
|
||||
"The Type of the JSON Aggregate Function must not be null");
|
||||
}
|
||||
|
||||
public void setType(String typeName) {
|
||||
this.functionType = JsonFunctionType
|
||||
.valueOf(Objects
|
||||
.requireNonNull(typeName,
|
||||
"The Type of the JSON Aggregate Function must not be null")
|
||||
.toUpperCase());
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withType(JsonFunctionType type) {
|
||||
this.setType(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withType(String typeName) {
|
||||
this.setType(typeName);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withExpression(Expression expression) {
|
||||
this.setExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isUsingKeyKeyword() {
|
||||
return usingKeyKeyword;
|
||||
}
|
||||
|
||||
public void setUsingKeyKeyword(boolean usingKeyKeyword) {
|
||||
this.usingKeyKeyword = usingKeyKeyword;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withUsingKeyKeyword(boolean usingKeyKeyword) {
|
||||
this.setUsingKeyKeyword(usingKeyKeyword);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withKey(String key) {
|
||||
this.setKey(key);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isUsingValueKeyword() {
|
||||
return usingValueKeyword;
|
||||
}
|
||||
|
||||
public void setUsingValueKeyword(boolean usingValueKeyword) {
|
||||
this.usingValueKeyword = usingValueKeyword;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withUsingValueKeyword(boolean usingValueKeyword) {
|
||||
this.setUsingValueKeyword(usingValueKeyword);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withValue(Object value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isUsingFormatJson() {
|
||||
return usingFormatJson;
|
||||
}
|
||||
|
||||
public void setUsingFormatJson(boolean usingFormatJson) {
|
||||
this.usingFormatJson = usingFormatJson;
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withUsingFormatJson(boolean usingFormatJson) {
|
||||
this.setUsingFormatJson(usingFormatJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<OrderByElement> getExpressionOrderByElements() {
|
||||
return expressionOrderBy.getOrderByElements();
|
||||
}
|
||||
|
||||
public void setExpressionOrderByElements(List<OrderByElement> orderByElements) {
|
||||
expressionOrderBy.setOrderByElements(orderByElements);
|
||||
}
|
||||
|
||||
public JsonAggregateFunction withExpressionOrderByElements(
|
||||
List<OrderByElement> orderByElements) {
|
||||
this.setExpressionOrderByElements(orderByElements);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
// avoid countless Builder --> String conversion
|
||||
@Override
|
||||
public StringBuilder append(StringBuilder builder) {
|
||||
switch (functionType) {
|
||||
case OBJECT:
|
||||
appendObject(builder);
|
||||
break;
|
||||
case ARRAY:
|
||||
appendArray(builder);
|
||||
break;
|
||||
default:
|
||||
// this should never happen really
|
||||
throw new UnsupportedOperationException("JSON Aggregate Function of the type "
|
||||
+ functionType.name() + " has not been implemented yet.");
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public StringBuilder appendObject(StringBuilder builder) {
|
||||
builder.append("JSON_OBJECTAGG( ");
|
||||
if (usingValueKeyword) {
|
||||
if (usingKeyKeyword) {
|
||||
builder.append("KEY ");
|
||||
}
|
||||
builder.append(key).append(" VALUE ").append(value);
|
||||
} else {
|
||||
builder.append(key).append(":").append(value);
|
||||
}
|
||||
|
||||
if (usingFormatJson) {
|
||||
builder.append(" FORMAT JSON");
|
||||
}
|
||||
|
||||
if (onNullType != null) {
|
||||
switch (onNullType) {
|
||||
case NULL:
|
||||
builder.append(" NULL ON NULL");
|
||||
break;
|
||||
case ABSENT:
|
||||
builder.append(" ABSENT On NULL");
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueKeysType != null) {
|
||||
switch (uniqueKeysType) {
|
||||
case WITH:
|
||||
builder.append(" WITH UNIQUE KEYS");
|
||||
break;
|
||||
case WITHOUT:
|
||||
builder.append(" WITHOUT UNIQUE KEYS");
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
}
|
||||
}
|
||||
|
||||
builder.append(" ) ");
|
||||
|
||||
|
||||
// FILTER( WHERE expression ) OVER windowNameOrSpecification
|
||||
super.append(builder);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public StringBuilder appendArray(StringBuilder builder) {
|
||||
builder.append("JSON_ARRAYAGG( ");
|
||||
builder.append(expression).append(" ");
|
||||
|
||||
if (usingFormatJson) {
|
||||
builder.append("FORMAT JSON ");
|
||||
}
|
||||
|
||||
expressionOrderBy.toStringOrderByElements(builder);
|
||||
|
||||
if (onNullType != null) {
|
||||
switch (onNullType) {
|
||||
case NULL:
|
||||
builder.append(" NULL ON NULL ");
|
||||
break;
|
||||
case ABSENT:
|
||||
builder.append(" ABSENT On NULL ");
|
||||
break;
|
||||
default:
|
||||
// "ON NULL" was ommitted
|
||||
}
|
||||
}
|
||||
builder.append(") ");
|
||||
|
||||
|
||||
// FILTER( WHERE expression ) OVER windowNameOrSpecification
|
||||
super.append(builder);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
return append(builder).toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2021 JSQLParser.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation; either version
|
||||
* 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library;
|
||||
* if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
public enum JsonAggregateOnNullType {
|
||||
NULL, ABSENT;
|
||||
|
||||
public static JsonAggregateOnNullType from(String type) {
|
||||
return Enum.valueOf(JsonAggregateOnNullType.class, type.toUpperCase());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2021 JSQLParser.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation; either version
|
||||
* 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
||||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with this library;
|
||||
* if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
public enum JsonAggregateUniqueKeysType {
|
||||
WITH, WITHOUT;
|
||||
|
||||
public static JsonAggregateUniqueKeysType from(String type) {
|
||||
return Enum.valueOf(JsonAggregateUniqueKeysType.class, type.toUpperCase());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class JsonExpression extends ASTNodeAccessImpl implements Expression {
|
||||
private final List<Map.Entry<String, String>> idents = new ArrayList<>();
|
||||
private Expression expr;
|
||||
|
||||
public JsonExpression() {
|
||||
|
||||
}
|
||||
|
||||
public JsonExpression(Expression expr) {
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public JsonExpression(Expression expr, List<Map.Entry<String, String>> idents) {
|
||||
this.expr = expr;
|
||||
this.idents.addAll(idents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
public void setExpression(Expression expr) {
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public void addIdent(String ident, String operator) {
|
||||
idents.add(new AbstractMap.SimpleEntry<>(ident, operator));
|
||||
}
|
||||
|
||||
public void addAllIdents(Collection<Map.Entry<String, String>> idents) {
|
||||
this.idents.addAll(idents);
|
||||
}
|
||||
|
||||
public List<Map.Entry<String, String>> getIdentList() {
|
||||
return idents;
|
||||
}
|
||||
|
||||
public Map.Entry<String, String> getIdent(int index) {
|
||||
return idents.get(index);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public List<String> getIdents() {
|
||||
ArrayList<String> l = new ArrayList<>();
|
||||
for (Map.Entry<String, String> ident : idents) {
|
||||
l.add(ident.getKey());
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public List<String> getOperators() {
|
||||
ArrayList<String> l = new ArrayList<>();
|
||||
for (Map.Entry<String, String> ident : idents) {
|
||||
l.add(ident.getValue());
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append(expr.toString());
|
||||
for (Map.Entry<String, String> ident : idents) {
|
||||
b.append(ident.getValue()).append(ident.getKey());
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public JsonExpression withExpression(Expression expr) {
|
||||
this.setExpression(expr);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
264
src/main/java/net/sf/jsqlparser/expression/JsonFunction.java
Normal file
264
src/main/java/net/sf/jsqlparser/expression/JsonFunction.java
Normal file
@@ -0,0 +1,264 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
|
||||
public class JsonFunction extends ASTNodeAccessImpl implements Expression {
|
||||
private final ArrayList<JsonKeyValuePair> keyValuePairs = new ArrayList<>();
|
||||
private final ArrayList<JsonFunctionExpression> expressions = new ArrayList<>();
|
||||
private JsonFunctionType functionType;
|
||||
private JsonAggregateOnNullType onNullType;
|
||||
private JsonAggregateUniqueKeysType uniqueKeysType;
|
||||
|
||||
public ArrayList<JsonKeyValuePair> getKeyValuePairs() {
|
||||
return keyValuePairs;
|
||||
}
|
||||
|
||||
public ArrayList<JsonFunctionExpression> getExpressions() {
|
||||
return expressions;
|
||||
}
|
||||
|
||||
public JsonKeyValuePair getKeyValuePair(int i) {
|
||||
return keyValuePairs.get(i);
|
||||
}
|
||||
|
||||
public JsonFunctionExpression getExpression(int i) {
|
||||
return expressions.get(i);
|
||||
}
|
||||
|
||||
public boolean add(JsonKeyValuePair keyValuePair) {
|
||||
return keyValuePairs.add(keyValuePair);
|
||||
}
|
||||
|
||||
public void add(int i, JsonKeyValuePair keyValuePair) {
|
||||
keyValuePairs.add(i, keyValuePair);
|
||||
}
|
||||
|
||||
public boolean add(JsonFunctionExpression expression) {
|
||||
return expressions.add(expression);
|
||||
}
|
||||
|
||||
public void add(int i, JsonFunctionExpression expression) {
|
||||
expressions.add(i, expression);
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return keyValuePairs.isEmpty();
|
||||
}
|
||||
|
||||
public JsonAggregateOnNullType getOnNullType() {
|
||||
return onNullType;
|
||||
}
|
||||
|
||||
public void setOnNullType(JsonAggregateOnNullType onNullType) {
|
||||
this.onNullType = onNullType;
|
||||
}
|
||||
|
||||
public JsonFunction withOnNullType(JsonAggregateOnNullType onNullType) {
|
||||
this.setOnNullType(onNullType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonAggregateUniqueKeysType getUniqueKeysType() {
|
||||
return uniqueKeysType;
|
||||
}
|
||||
|
||||
public void setUniqueKeysType(JsonAggregateUniqueKeysType uniqueKeysType) {
|
||||
this.uniqueKeysType = uniqueKeysType;
|
||||
}
|
||||
|
||||
public JsonFunction withUniqueKeysType(JsonAggregateUniqueKeysType uniqueKeysType) {
|
||||
this.setUniqueKeysType(uniqueKeysType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonFunctionType getType() {
|
||||
return functionType;
|
||||
}
|
||||
|
||||
public void setType(JsonFunctionType type) {
|
||||
this.functionType =
|
||||
Objects.requireNonNull(type,
|
||||
"The Type of the JSON Aggregate Function must not be null");
|
||||
}
|
||||
|
||||
public void setType(String typeName) {
|
||||
this.functionType = JsonFunctionType.valueOf(
|
||||
Objects.requireNonNull(typeName,
|
||||
"The Type of the JSON Aggregate Function must not be null")
|
||||
.toUpperCase());
|
||||
}
|
||||
|
||||
public JsonFunction withType(JsonFunctionType type) {
|
||||
this.setType(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public JsonFunction withType(String typeName) {
|
||||
this.setType(typeName);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
// avoid countless Builder --> String conversion
|
||||
public StringBuilder append(StringBuilder builder) {
|
||||
switch (functionType) {
|
||||
case OBJECT:
|
||||
appendObject(builder);
|
||||
break;
|
||||
case POSTGRES_OBJECT:
|
||||
appendPostgresObject(builder);
|
||||
break;
|
||||
case MYSQL_OBJECT:
|
||||
appendMySqlObject(builder);
|
||||
break;
|
||||
case ARRAY:
|
||||
appendArray(builder);
|
||||
break;
|
||||
default:
|
||||
// this should never happen really
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public StringBuilder appendObject(StringBuilder builder) {
|
||||
builder.append("JSON_OBJECT( ");
|
||||
int i = 0;
|
||||
for (JsonKeyValuePair keyValuePair : keyValuePairs) {
|
||||
if (i > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
if (keyValuePair.isUsingValueKeyword()) {
|
||||
if (keyValuePair.isUsingKeyKeyword()) {
|
||||
builder.append("KEY ");
|
||||
}
|
||||
builder.append(keyValuePair.getKey()).append(" VALUE ")
|
||||
.append(keyValuePair.getValue());
|
||||
} else {
|
||||
builder.append(keyValuePair.getKey()).append(":").append(keyValuePair.getValue());
|
||||
}
|
||||
|
||||
if (keyValuePair.isUsingFormatJson()) {
|
||||
builder.append(" FORMAT JSON");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (onNullType != null) {
|
||||
switch (onNullType) {
|
||||
case NULL:
|
||||
builder.append(" NULL ON NULL");
|
||||
break;
|
||||
case ABSENT:
|
||||
builder.append(" ABSENT On NULL");
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueKeysType != null) {
|
||||
switch (uniqueKeysType) {
|
||||
case WITH:
|
||||
builder.append(" WITH UNIQUE KEYS");
|
||||
break;
|
||||
case WITHOUT:
|
||||
builder.append(" WITHOUT UNIQUE KEYS");
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
}
|
||||
}
|
||||
|
||||
builder.append(" ) ");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public StringBuilder appendPostgresObject(StringBuilder builder) {
|
||||
builder.append("JSON_OBJECT( ");
|
||||
for (JsonKeyValuePair keyValuePair : keyValuePairs) {
|
||||
builder.append(keyValuePair.getKey());
|
||||
if (keyValuePair.getValue() != null) {
|
||||
builder.append(", ").append(keyValuePair.getValue());
|
||||
}
|
||||
}
|
||||
builder.append(" ) ");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
public StringBuilder appendMySqlObject(StringBuilder builder) {
|
||||
builder.append("JSON_OBJECT( ");
|
||||
int i = 0;
|
||||
for (JsonKeyValuePair keyValuePair : keyValuePairs) {
|
||||
if (i > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
builder.append(keyValuePair.getKey());
|
||||
builder.append(", ").append(keyValuePair.getValue());
|
||||
i++;
|
||||
}
|
||||
builder.append(" ) ");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
|
||||
public StringBuilder appendArray(StringBuilder builder) {
|
||||
builder.append("JSON_ARRAY( ");
|
||||
int i = 0;
|
||||
|
||||
for (JsonFunctionExpression expr : expressions) {
|
||||
if (i > 0) {
|
||||
builder.append(", ");
|
||||
}
|
||||
expr.append(builder);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (onNullType != null) {
|
||||
switch (onNullType) {
|
||||
case NULL:
|
||||
builder.append(" NULL ON NULL ");
|
||||
break;
|
||||
case ABSENT:
|
||||
builder.append(" ABSENT ON NULL ");
|
||||
break;
|
||||
default:
|
||||
// "ON NULL" was omitted
|
||||
}
|
||||
}
|
||||
builder.append(") ");
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
return append(builder).toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
|
||||
public class JsonFunctionExpression implements Serializable {
|
||||
private final Expression expression;
|
||||
|
||||
private boolean usingFormatJson = false;
|
||||
|
||||
public JsonFunctionExpression(Expression expression) {
|
||||
this.expression = Objects.requireNonNull(expression, "The EXPRESSION must not be null");
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public boolean isUsingFormatJson() {
|
||||
return usingFormatJson;
|
||||
}
|
||||
|
||||
public void setUsingFormatJson(boolean usingFormatJson) {
|
||||
this.usingFormatJson = usingFormatJson;
|
||||
}
|
||||
|
||||
public JsonFunctionExpression withUsingFormatJson(boolean usingFormatJson) {
|
||||
this.setUsingFormatJson(usingFormatJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StringBuilder append(StringBuilder builder) {
|
||||
return builder.append(getExpression()).append(isUsingFormatJson() ? " FORMAT JSON" : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return append(new StringBuilder()).toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
public enum JsonFunctionType {
|
||||
OBJECT, ARRAY, POSTGRES_OBJECT, MYSQL_OBJECT;
|
||||
|
||||
public static JsonFunctionType from(String type) {
|
||||
return Enum.valueOf(JsonFunctionType.class, type.toUpperCase());
|
||||
}
|
||||
}
|
||||
126
src/main/java/net/sf/jsqlparser/expression/JsonKeyValuePair.java
Normal file
126
src/main/java/net/sf/jsqlparser/expression/JsonKeyValuePair.java
Normal file
@@ -0,0 +1,126 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
|
||||
public class JsonKeyValuePair implements Serializable {
|
||||
private final String key;
|
||||
private final Object value;
|
||||
private boolean usingKeyKeyword = false;
|
||||
private boolean usingValueKeyword = false;
|
||||
private boolean usingFormatJson = false;
|
||||
|
||||
public JsonKeyValuePair(String key, Object value, boolean usingKeyKeyword,
|
||||
boolean usingValueKeyword) {
|
||||
this.key = Objects.requireNonNull(key, "The KEY of the Pair must not be null");
|
||||
this.value = value;
|
||||
this.usingKeyKeyword = usingKeyKeyword;
|
||||
this.usingValueKeyword = usingValueKeyword;
|
||||
}
|
||||
|
||||
public boolean isUsingKeyKeyword() {
|
||||
return usingKeyKeyword;
|
||||
}
|
||||
|
||||
public void setUsingKeyKeyword(boolean usingKeyKeyword) {
|
||||
this.usingKeyKeyword = usingKeyKeyword;
|
||||
}
|
||||
|
||||
public JsonKeyValuePair withUsingKeyKeyword(boolean usingKeyKeyword) {
|
||||
this.setUsingKeyKeyword(usingKeyKeyword);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isUsingValueKeyword() {
|
||||
return usingValueKeyword;
|
||||
}
|
||||
|
||||
public void setUsingValueKeyword(boolean usingValueKeyword) {
|
||||
this.usingValueKeyword = usingValueKeyword;
|
||||
}
|
||||
|
||||
public JsonKeyValuePair withUsingValueKeyword(boolean usingValueKeyword) {
|
||||
this.setUsingValueKeyword(usingValueKeyword);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isUsingFormatJson() {
|
||||
return usingFormatJson;
|
||||
}
|
||||
|
||||
public void setUsingFormatJson(boolean usingFormatJson) {
|
||||
this.usingFormatJson = usingFormatJson;
|
||||
}
|
||||
|
||||
public JsonKeyValuePair withUsingFormatJson(boolean usingFormatJson) {
|
||||
this.setUsingFormatJson(usingFormatJson);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 83 * hash + Objects.hashCode(this.key);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final JsonKeyValuePair other = (JsonKeyValuePair) obj;
|
||||
return Objects.equals(this.key, other.key);
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public StringBuilder append(StringBuilder builder) {
|
||||
if (isUsingValueKeyword()) {
|
||||
if (isUsingKeyKeyword()) {
|
||||
builder.append("KEY ");
|
||||
}
|
||||
builder.append(getKey()).append(" VALUE ").append(getValue());
|
||||
} else {
|
||||
builder.append(getKey()).append(":").append(getValue());
|
||||
}
|
||||
|
||||
if (isUsingFormatJson()) {
|
||||
builder.append(" FORMAT JSON");
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return append(new StringBuilder()).toString();
|
||||
}
|
||||
|
||||
}
|
||||
110
src/main/java/net/sf/jsqlparser/expression/KeepExpression.java
Normal file
110
src/main/java/net/sf/jsqlparser/expression/KeepExpression.java
Normal file
@@ -0,0 +1,110 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
public class KeepExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String name;
|
||||
private List<OrderByElement> orderByElements;
|
||||
private boolean first = false;
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public List<OrderByElement> getOrderByElements() {
|
||||
return orderByElements;
|
||||
}
|
||||
|
||||
public void setOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.orderByElements = orderByElements;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isFirst() {
|
||||
return first;
|
||||
}
|
||||
|
||||
public void setFirst(boolean first) {
|
||||
this.first = first;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
||||
b.append("KEEP (").append(name);
|
||||
|
||||
b.append(" ").append(first ? "FIRST" : "LAST").append(" ");
|
||||
toStringOrderByElements(b);
|
||||
|
||||
b.append(")");
|
||||
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
private void toStringOrderByElements(StringBuilder b) {
|
||||
if (orderByElements != null && !orderByElements.isEmpty()) {
|
||||
b.append("ORDER BY ");
|
||||
for (int i = 0; i < orderByElements.size(); i++) {
|
||||
if (i > 0) {
|
||||
b.append(", ");
|
||||
}
|
||||
b.append(orderByElements.get(i).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public KeepExpression withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
public KeepExpression withOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.setOrderByElements(orderByElements);
|
||||
return this;
|
||||
}
|
||||
|
||||
public KeepExpression withFirst(boolean first) {
|
||||
this.setFirst(first);
|
||||
return this;
|
||||
}
|
||||
|
||||
public KeepExpression addOrderByElements(OrderByElement... orderByElements) {
|
||||
List<OrderByElement> collection =
|
||||
Optional.ofNullable(getOrderByElements()).orElseGet(ArrayList::new);
|
||||
Collections.addAll(collection, orderByElements);
|
||||
return this.withOrderByElements(collection);
|
||||
}
|
||||
|
||||
public KeepExpression addOrderByElements(Collection<? extends OrderByElement> orderByElements) {
|
||||
List<OrderByElement> collection =
|
||||
Optional.ofNullable(getOrderByElements()).orElseGet(ArrayList::new);
|
||||
collection.addAll(orderByElements);
|
||||
return this.withOrderByElements(collection);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2024 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class LambdaExpression extends ASTNodeAccessImpl implements Expression {
|
||||
private List<String> identifiers;
|
||||
private Expression expression;
|
||||
|
||||
public LambdaExpression(String identifier, Expression expression) {
|
||||
this.identifiers = Arrays.asList(identifier);
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public LambdaExpression(List<String> identifiers, Expression expression) {
|
||||
this.identifiers = identifiers;
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public List<String> getIdentifiers() {
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public LambdaExpression setIdentifiers(List<String> identifiers) {
|
||||
this.identifiers = identifiers;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public LambdaExpression setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StringBuilder appendTo(StringBuilder builder) {
|
||||
if (identifiers.size() == 1) {
|
||||
builder.append(identifiers.get(0));
|
||||
} else {
|
||||
int i = 0;
|
||||
builder.append("( ");
|
||||
for (String s : identifiers) {
|
||||
builder.append(i++ > 0 ? ", " : "").append(s);
|
||||
}
|
||||
builder.append(" )");
|
||||
}
|
||||
return builder.append(" -> ").append(expression);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return appendTo(new StringBuilder()).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
}
|
||||
99
src/main/java/net/sf/jsqlparser/expression/LongValue.java
Normal file
99
src/main/java/net/sf/jsqlparser/expression/LongValue.java
Normal file
@@ -0,0 +1,99 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* Every number without a point or an exponential format is a LongValue.
|
||||
*/
|
||||
public class LongValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String stringValue;
|
||||
|
||||
public LongValue() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public LongValue(final String value) {
|
||||
if (value == null || value.length() == 0) {
|
||||
throw new IllegalArgumentException("value can neither be null nor empty.");
|
||||
}
|
||||
String val = value;
|
||||
if (val.charAt(0) == '+') {
|
||||
val = val.substring(1);
|
||||
}
|
||||
this.stringValue = val;
|
||||
}
|
||||
|
||||
public LongValue(long value) {
|
||||
stringValue = String.valueOf(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public long getValue() {
|
||||
return Long.parseLong(stringValue);
|
||||
}
|
||||
|
||||
public void setValue(long d) {
|
||||
stringValue = String.valueOf(d);
|
||||
}
|
||||
|
||||
public BigInteger getBigIntegerValue() {
|
||||
return new BigInteger(stringValue);
|
||||
}
|
||||
|
||||
public LongValue withValue(long d) {
|
||||
setValue(d);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
public void setStringValue(String string) {
|
||||
stringValue = string;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getStringValue();
|
||||
}
|
||||
|
||||
public LongValue withStringValue(String stringValue) {
|
||||
this.setStringValue(stringValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
LongValue longValue = (LongValue) o;
|
||||
return stringValue.equals(longValue.stringValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(stringValue);
|
||||
}
|
||||
}
|
||||
124
src/main/java/net/sf/jsqlparser/expression/MySQLGroupConcat.java
Normal file
124
src/main/java/net/sf/jsqlparser/expression/MySQLGroupConcat.java
Normal file
@@ -0,0 +1,124 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class MySQLGroupConcat extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private ExpressionList expressionList;
|
||||
private boolean distinct = false;
|
||||
private List<OrderByElement> orderByElements;
|
||||
private String separator;
|
||||
|
||||
public ExpressionList<?> getExpressionList() {
|
||||
return expressionList;
|
||||
}
|
||||
|
||||
public void setExpressionList(ExpressionList expressionList) {
|
||||
this.expressionList = expressionList;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public List<OrderByElement> getOrderByElements() {
|
||||
return orderByElements;
|
||||
}
|
||||
|
||||
public void setOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.orderByElements = orderByElements;
|
||||
}
|
||||
|
||||
public String getSeparator() {
|
||||
return separator;
|
||||
}
|
||||
|
||||
public void setSeparator(String separator) {
|
||||
this.separator = separator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append("GROUP_CONCAT(");
|
||||
if (isDistinct()) {
|
||||
b.append("DISTINCT ");
|
||||
}
|
||||
b.append(expressionList);
|
||||
if (orderByElements != null && !orderByElements.isEmpty()) {
|
||||
b.append(" ORDER BY ");
|
||||
for (int i = 0; i < orderByElements.size(); i++) {
|
||||
if (i > 0) {
|
||||
b.append(", ");
|
||||
}
|
||||
b.append(orderByElements.get(i).toString());
|
||||
}
|
||||
}
|
||||
if (separator != null) {
|
||||
b.append(" SEPARATOR ").append(separator);
|
||||
}
|
||||
b.append(")");
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public MySQLGroupConcat withExpressionList(ExpressionList expressionList) {
|
||||
this.setExpressionList(expressionList);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MySQLGroupConcat withDistinct(boolean distinct) {
|
||||
this.setDistinct(distinct);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MySQLGroupConcat withOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.setOrderByElements(orderByElements);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MySQLGroupConcat withSeparator(String separator) {
|
||||
this.setSeparator(separator);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MySQLGroupConcat addOrderByElements(OrderByElement... orderByElements) {
|
||||
List<OrderByElement> collection =
|
||||
Optional.ofNullable(getOrderByElements()).orElseGet(ArrayList::new);
|
||||
Collections.addAll(collection, orderByElements);
|
||||
return this.withOrderByElements(collection);
|
||||
}
|
||||
|
||||
public MySQLGroupConcat addOrderByElements(
|
||||
Collection<? extends OrderByElement> orderByElements) {
|
||||
List<OrderByElement> collection =
|
||||
Optional.ofNullable(getOrderByElements()).orElseGet(ArrayList::new);
|
||||
collection.addAll(orderByElements);
|
||||
return this.withOrderByElements(collection);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class MySQLIndexHint implements Serializable {
|
||||
|
||||
private final String action;
|
||||
private final String indexQualifier;
|
||||
private final List<String> indexNames;
|
||||
|
||||
public MySQLIndexHint(String action, String indexQualifier, List<String> indexNames) {
|
||||
this.action = action;
|
||||
this.indexQualifier = indexQualifier;
|
||||
this.indexNames = indexNames;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public String getIndexQualifier() {
|
||||
return indexQualifier;
|
||||
}
|
||||
|
||||
public List<String> getIndexNames() {
|
||||
return indexNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// use|ignore|force key|index (index1,...,indexN)
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.append(" ").append(action).append(" ").append(indexQualifier).append(" (");
|
||||
for (int i = 0; i < indexNames.size(); i++) {
|
||||
if (i > 0) {
|
||||
buffer.append(",");
|
||||
}
|
||||
buffer.append(indexNames.get(i));
|
||||
}
|
||||
buffer.append(")");
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* - #%L JSQLParser library %% Copyright (C) 2004 - 2019 JSQLParser %% Dual licensed under GNU LGPL
|
||||
* 2.1 or Apache License 2.0 #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class NextValExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
public static final Pattern NEXT_VALUE_PATTERN =
|
||||
Pattern.compile("NEXT\\s+VALUE\\s+FOR", Pattern.CASE_INSENSITIVE);
|
||||
private final List<String> nameList;
|
||||
private boolean usingNextValueFor = false;
|
||||
|
||||
public NextValExpression(List<String> nameList, String image) {
|
||||
this.nameList = nameList;
|
||||
// Test if we shall use NEXT VALUE FOR instead of NEXTVAL FOR
|
||||
if (NEXT_VALUE_PATTERN.matcher(image).matches()) {
|
||||
usingNextValueFor = true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isUsingNextValueFor() {
|
||||
return usingNextValueFor;
|
||||
}
|
||||
|
||||
public void setUsingNextValueFor(boolean usingNextValueFor) {
|
||||
this.usingNextValueFor = usingNextValueFor;
|
||||
}
|
||||
|
||||
public NextValExpression withNextValueFor(boolean usingNextValueFor) {
|
||||
setUsingNextValueFor(usingNextValueFor);
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getNameList() {
|
||||
return nameList;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (String name : nameList) {
|
||||
if (b.length() > 0) {
|
||||
b.append(".");
|
||||
}
|
||||
b.append(name);
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (usingNextValueFor
|
||||
? "NEXT VALUE FOR "
|
||||
: "NEXTVAL FOR ") + getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* It represents a "not " or "!" before an expression.
|
||||
*/
|
||||
public class NotExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Expression expression;
|
||||
|
||||
private boolean exclamationMark = false;
|
||||
|
||||
public NotExpression() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public NotExpression(Expression expression) {
|
||||
this(expression, false);
|
||||
}
|
||||
|
||||
public NotExpression(Expression expression, boolean useExclamationMark) {
|
||||
setExpression(expression);
|
||||
this.exclamationMark = useExclamationMark;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public final void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (exclamationMark ? "! " : "NOT ") + expression.toString();
|
||||
}
|
||||
|
||||
public boolean isExclamationMark() {
|
||||
return exclamationMark;
|
||||
}
|
||||
|
||||
public void setExclamationMark(boolean exclamationMark) {
|
||||
this.exclamationMark = exclamationMark;
|
||||
}
|
||||
|
||||
public NotExpression withExpression(Expression expression) {
|
||||
this.setExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public NotExpression withExclamationMark(boolean exclamationMark) {
|
||||
this.setExclamationMark(exclamationMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getExpression(Class<E> type) {
|
||||
return type.cast(getExpression());
|
||||
}
|
||||
}
|
||||
25
src/main/java/net/sf/jsqlparser/expression/NullValue.java
Normal file
25
src/main/java/net/sf/jsqlparser/expression/NullValue.java
Normal file
@@ -0,0 +1,25 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class NullValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NULL";
|
||||
}
|
||||
}
|
||||
40
src/main/java/net/sf/jsqlparser/expression/NumericBind.java
Normal file
40
src/main/java/net/sf/jsqlparser/expression/NumericBind.java
Normal file
@@ -0,0 +1,40 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class NumericBind extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private int bindId;
|
||||
|
||||
public int getBindId() {
|
||||
return bindId;
|
||||
}
|
||||
|
||||
public void setBindId(int bindId) {
|
||||
this.bindId = bindId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ":" + bindId;
|
||||
}
|
||||
|
||||
public NumericBind withBindId(int bindId) {
|
||||
this.setBindId(bindId);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class OracleHierarchicalExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
boolean connectFirst = false;
|
||||
private Expression startExpression;
|
||||
private Expression connectExpression;
|
||||
private boolean noCycle = false;
|
||||
|
||||
public Expression getStartExpression() {
|
||||
return startExpression;
|
||||
}
|
||||
|
||||
public void setStartExpression(Expression startExpression) {
|
||||
this.startExpression = startExpression;
|
||||
}
|
||||
|
||||
public Expression getConnectExpression() {
|
||||
return connectExpression;
|
||||
}
|
||||
|
||||
public void setConnectExpression(Expression connectExpression) {
|
||||
this.connectExpression = connectExpression;
|
||||
}
|
||||
|
||||
public boolean isNoCycle() {
|
||||
return noCycle;
|
||||
}
|
||||
|
||||
public void setNoCycle(boolean noCycle) {
|
||||
this.noCycle = noCycle;
|
||||
}
|
||||
|
||||
public boolean isConnectFirst() {
|
||||
return connectFirst;
|
||||
}
|
||||
|
||||
public void setConnectFirst(boolean connectFirst) {
|
||||
this.connectFirst = connectFirst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder b = new StringBuilder();
|
||||
if (isConnectFirst()) {
|
||||
b.append(" CONNECT BY ");
|
||||
if (isNoCycle()) {
|
||||
b.append("NOCYCLE ");
|
||||
}
|
||||
b.append(connectExpression.toString());
|
||||
if (startExpression != null) {
|
||||
b.append(" START WITH ").append(startExpression.toString());
|
||||
}
|
||||
} else {
|
||||
if (startExpression != null) {
|
||||
b.append(" START WITH ").append(startExpression.toString());
|
||||
}
|
||||
b.append(" CONNECT BY ");
|
||||
if (isNoCycle()) {
|
||||
b.append("NOCYCLE ");
|
||||
}
|
||||
b.append(connectExpression.toString());
|
||||
}
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public OracleHierarchicalExpression withStartExpression(Expression startExpression) {
|
||||
this.setStartExpression(startExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public OracleHierarchicalExpression withConnectExpression(Expression connectExpression) {
|
||||
this.setConnectExpression(connectExpression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public OracleHierarchicalExpression withNoCycle(boolean noCycle) {
|
||||
this.setNoCycle(noCycle);
|
||||
return this;
|
||||
}
|
||||
|
||||
public OracleHierarchicalExpression withConnectFirst(boolean connectFirst) {
|
||||
this.setConnectFirst(connectFirst);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getStartExpression(Class<E> type) {
|
||||
return type.cast(getStartExpression());
|
||||
}
|
||||
|
||||
public <E extends Expression> E getConnectExpression(Class<E> type) {
|
||||
return type.cast(getConnectExpression());
|
||||
}
|
||||
}
|
||||
101
src/main/java/net/sf/jsqlparser/expression/OracleHint.java
Normal file
101
src/main/java/net/sf/jsqlparser/expression/OracleHint.java
Normal file
@@ -0,0 +1,101 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.select.ParenthesedSelect;
|
||||
import net.sf.jsqlparser.statement.select.PlainSelect;
|
||||
import net.sf.jsqlparser.statement.select.Select;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Oracle Hint Expression
|
||||
*/
|
||||
public class OracleHint extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private static final Pattern SINGLE_LINE = Pattern.compile("--\\+ *([^ ].*[^ ])");
|
||||
private static final Pattern MULTI_LINE =
|
||||
Pattern.compile("\\/\\*\\+ *([^ ].*[^ ]) *\\*+\\/", Pattern.MULTILINE | Pattern.DOTALL);
|
||||
|
||||
private String value;
|
||||
private boolean singleLine = false;
|
||||
|
||||
public static boolean isHintMatch(String comment) {
|
||||
return SINGLE_LINE.matcher(comment).find() || MULTI_LINE.matcher(comment).find();
|
||||
}
|
||||
|
||||
public static OracleHint getHintFromSelectBody(Select selectBody) {
|
||||
|
||||
if (selectBody instanceof PlainSelect) {
|
||||
return ((PlainSelect) selectBody).getOracleHint();
|
||||
} else if (selectBody instanceof ParenthesedSelect) {
|
||||
return getHintFromSelectBody(((ParenthesedSelect) selectBody).getSelect());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public final void setComment(String comment) {
|
||||
Matcher m;
|
||||
m = SINGLE_LINE.matcher(comment);
|
||||
if (m.find()) {
|
||||
this.value = m.group(1);
|
||||
this.singleLine = true;
|
||||
return;
|
||||
}
|
||||
m = MULTI_LINE.matcher(comment);
|
||||
if (m.find()) {
|
||||
this.value = m.group(1);
|
||||
this.singleLine = false;
|
||||
}
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean isSingleLine() {
|
||||
return singleLine;
|
||||
}
|
||||
|
||||
public void setSingleLine(boolean singleLine) {
|
||||
this.singleLine = singleLine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (singleLine) {
|
||||
return "--+ " + value + "\n";
|
||||
} else {
|
||||
return "/*+ " + value + " */";
|
||||
}
|
||||
}
|
||||
|
||||
public OracleHint withValue(String value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public OracleHint withSingleLine(boolean singleLine) {
|
||||
this.setSingleLine(singleLine);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:andreas@manticore-projects.com">Andreas Reichel</a>
|
||||
*/
|
||||
public class OracleNamedFunctionParameter extends ASTNodeAccessImpl implements Expression {
|
||||
private final String name;
|
||||
private final Expression expression;
|
||||
|
||||
public OracleNamedFunctionParameter(String name, Expression expression) {
|
||||
this.name = Objects.requireNonNull(name,
|
||||
"The NAME of the OracleNamedFunctionParameter must not be null.");
|
||||
this.expression = Objects.requireNonNull(expression,
|
||||
"The EXPRESSION of the OracleNamedFunctionParameter must not be null.");
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public StringBuilder appendTo(StringBuilder builder) {
|
||||
builder.append(name)
|
||||
.append(" => ")
|
||||
.append(expression);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return appendTo(new StringBuilder()).toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.sf.jsqlparser.statement.select.OrderByElement;
|
||||
|
||||
public class OrderByClause implements Serializable {
|
||||
private List<OrderByElement> orderByElements;
|
||||
|
||||
public List<OrderByElement> getOrderByElements() {
|
||||
return orderByElements;
|
||||
}
|
||||
|
||||
public void setOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.orderByElements = orderByElements;
|
||||
}
|
||||
|
||||
public void toStringOrderByElements(StringBuilder b) {
|
||||
if (orderByElements != null && !orderByElements.isEmpty()) {
|
||||
b.append("ORDER BY ");
|
||||
for (int i = 0; i < orderByElements.size(); i++) {
|
||||
if (i > 0) {
|
||||
b.append(", ");
|
||||
}
|
||||
b.append(orderByElements.get(i).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public OrderByClause withOrderByElements(List<OrderByElement> orderByElements) {
|
||||
this.setOrderByElements(orderByElements);
|
||||
return this;
|
||||
}
|
||||
|
||||
public OrderByClause addOrderByElements(OrderByElement... orderByElements) {
|
||||
List<OrderByElement> collection =
|
||||
Optional.ofNullable(getOrderByElements()).orElseGet(ArrayList::new);
|
||||
Collections.addAll(collection, orderByElements);
|
||||
return this.withOrderByElements(collection);
|
||||
}
|
||||
|
||||
public OrderByClause addOrderByElements(Collection<? extends OrderByElement> orderByElements) {
|
||||
List<OrderByElement> collection =
|
||||
Optional.ofNullable(getOrderByElements()).orElseGet(ArrayList::new);
|
||||
collection.addAll(orderByElements);
|
||||
return this.withOrderByElements(collection);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2022 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class OverlapsCondition extends ASTNodeAccessImpl implements Expression {
|
||||
private final ExpressionList<?> left;
|
||||
private final ExpressionList<?> right;
|
||||
|
||||
public OverlapsCondition(ExpressionList<?> left, ExpressionList<?> right) {
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
|
||||
public ExpressionList<?> getLeft() {
|
||||
return left;
|
||||
}
|
||||
|
||||
public ExpressionList<?> getRight() {
|
||||
return right;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s OVERLAPS %s", left.toString(), right.toString());
|
||||
}
|
||||
}
|
||||
37
src/main/java/net/sf/jsqlparser/expression/Parenthesis.java
Normal file
37
src/main/java/net/sf/jsqlparser/expression/Parenthesis.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
|
||||
|
||||
/**
|
||||
* @deprecated This class is deprecated since version 5.0. Use {@link ParenthesedExpressionList}
|
||||
* instead. The reason for deprecation is the ambiguity and redundancy.
|
||||
*/
|
||||
@Deprecated(since = "5.0", forRemoval = true)
|
||||
public class Parenthesis extends ParenthesedExpressionList<Expression> {
|
||||
public Expression getExpression() {
|
||||
return isEmpty() ? null : get(0);
|
||||
}
|
||||
|
||||
public Parenthesis setExpression(Expression expression) {
|
||||
this.set(0, expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Parenthesis withExpression(Expression expression) {
|
||||
return this.setExpression(expression);
|
||||
}
|
||||
|
||||
public <E extends Expression> E getExpression(Class<E> type) {
|
||||
return type.cast(getExpression());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.statement.select.PlainSelect;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class PartitionByClause implements Serializable {
|
||||
ExpressionList partitionExpressionList;
|
||||
boolean brackets = false;
|
||||
|
||||
public ExpressionList getPartitionExpressionList() {
|
||||
return partitionExpressionList;
|
||||
}
|
||||
|
||||
public void setPartitionExpressionList(ExpressionList partitionExpressionList) {
|
||||
setPartitionExpressionList(partitionExpressionList, false);
|
||||
}
|
||||
|
||||
public void setPartitionExpressionList(ExpressionList partitionExpressionList,
|
||||
boolean brackets) {
|
||||
this.partitionExpressionList = partitionExpressionList;
|
||||
this.brackets = brackets;
|
||||
}
|
||||
|
||||
public void toStringPartitionBy(StringBuilder b) {
|
||||
if (partitionExpressionList != null
|
||||
&& !partitionExpressionList.getExpressions().isEmpty()) {
|
||||
b.append("PARTITION BY ");
|
||||
b.append(PlainSelect.getStringList(partitionExpressionList.getExpressions(), true,
|
||||
brackets));
|
||||
b.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBrackets() {
|
||||
return brackets;
|
||||
}
|
||||
|
||||
public PartitionByClause withPartitionExpressionList(ExpressionList partitionExpressionList) {
|
||||
this.setPartitionExpressionList(partitionExpressionList);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2023 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class RangeExpression extends ASTNodeAccessImpl implements Expression {
|
||||
private Expression startExpression;
|
||||
private Expression endExpression;
|
||||
|
||||
public RangeExpression(Expression startExpression, Expression endExpression) {
|
||||
this.startExpression = startExpression;
|
||||
this.endExpression = endExpression;
|
||||
}
|
||||
|
||||
public Expression getStartExpression() {
|
||||
return startExpression;
|
||||
}
|
||||
|
||||
public RangeExpression setStartExpression(Expression startExpression) {
|
||||
this.startExpression = startExpression;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Expression getEndExpression() {
|
||||
return endExpression;
|
||||
}
|
||||
|
||||
public RangeExpression setEndExpression(Expression endExpression) {
|
||||
this.endExpression = endExpression;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return startExpression + ":" + endExpression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
||||
import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
|
||||
|
||||
public class RowConstructor<T extends Expression> extends ParenthesedExpressionList<T>
|
||||
implements Expression {
|
||||
private String name = null;
|
||||
|
||||
public RowConstructor() {}
|
||||
|
||||
public RowConstructor(String name, ExpressionList<T> expressionList) {
|
||||
this.name = name;
|
||||
addAll(expressionList);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (name != null ? name : "") + super.toString();
|
||||
}
|
||||
|
||||
public RowConstructor<?> withName(String name) {
|
||||
this.setName(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K, S> K accept(ExpressionVisitor<K> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public final class RowGetExpression extends ASTNodeAccessImpl implements Expression {
|
||||
private Expression expression;
|
||||
private String columnName;
|
||||
|
||||
public RowGetExpression(Expression expression, String columnName) {
|
||||
this.expression = expression;
|
||||
this.columnName = columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return expression + "." + columnName;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
public void setColumnName(String columnName) {
|
||||
this.columnName = columnName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SQLServerHints implements Serializable {
|
||||
|
||||
private Boolean noLock;
|
||||
private String indexName;
|
||||
|
||||
public SQLServerHints() {}
|
||||
|
||||
public SQLServerHints withNoLock() {
|
||||
this.noLock = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getNoLock() {
|
||||
return noLock;
|
||||
}
|
||||
|
||||
public void setNoLock(Boolean noLock) {
|
||||
this.noLock = noLock;
|
||||
}
|
||||
|
||||
public String getIndexName() {
|
||||
return indexName;
|
||||
}
|
||||
|
||||
public void setIndexName(String indexName) {
|
||||
this.indexName = indexName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
List<String> hints = new ArrayList<>();
|
||||
if (indexName != null) {
|
||||
hints.add("INDEX (" + indexName + ")");
|
||||
}
|
||||
if (Boolean.TRUE.equals(noLock)) {
|
||||
hints.add("NOLOCK");
|
||||
}
|
||||
return " WITH ("
|
||||
+ String.join(", ", hints)
|
||||
+ ")";
|
||||
}
|
||||
|
||||
public SQLServerHints withNoLock(Boolean noLock) {
|
||||
this.setNoLock(noLock);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SQLServerHints withIndexName(String indexName) {
|
||||
this.setIndexName(indexName);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* It represents a "-" or "+" or "~" before an expression
|
||||
*/
|
||||
public class SignedExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private char sign;
|
||||
private Expression expression;
|
||||
|
||||
public SignedExpression() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public SignedExpression(char sign, Expression expression) {
|
||||
setSign(sign);
|
||||
setExpression(expression);
|
||||
}
|
||||
|
||||
public char getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public final void setSign(char sign) {
|
||||
this.sign = sign;
|
||||
if (sign != '+' && sign != '-' && sign != '~') {
|
||||
throw new IllegalArgumentException("illegal sign character, only + - ~ allowed");
|
||||
}
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
public final void setExpression(Expression expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getSign() + expression.toString();
|
||||
}
|
||||
|
||||
public SignedExpression withSign(char sign) {
|
||||
this.setSign(sign);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SignedExpression withExpression(Expression expression) {
|
||||
this.setExpression(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
public <E extends Expression> E getExpression(Class<E> type) {
|
||||
return type.cast(getExpression());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2021 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.schema.Table;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class SpannerInterleaveIn {
|
||||
|
||||
private Table table;
|
||||
private OnDelete onDelete;
|
||||
|
||||
public SpannerInterleaveIn() {
|
||||
|
||||
}
|
||||
|
||||
public SpannerInterleaveIn(Table table, OnDelete action) {
|
||||
setTable(table);
|
||||
setOnDelete(action);
|
||||
}
|
||||
|
||||
public SpannerInterleaveIn(List<String> nameParts) {
|
||||
this(new Table(nameParts), null);
|
||||
}
|
||||
|
||||
public SpannerInterleaveIn(String tableName) {
|
||||
this(Collections.singletonList(tableName));
|
||||
}
|
||||
|
||||
public Table getTable() {
|
||||
return table;
|
||||
}
|
||||
|
||||
public void setTable(Table table) {
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
public OnDelete getOnDelete() {
|
||||
return onDelete;
|
||||
}
|
||||
|
||||
public void setOnDelete(OnDelete action) {
|
||||
this.onDelete = action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "INTERLEAVE IN PARENT " + getTable().getName() +
|
||||
(getOnDelete() == null ? ""
|
||||
: " ON DELETE "
|
||||
+ (getOnDelete() == OnDelete.CASCADE ? "CASCADE" : "NO ACTION"));
|
||||
}
|
||||
|
||||
public SpannerInterleaveIn withTable(Table table) {
|
||||
this.setTable(table);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SpannerInterleaveIn withOnDelete(OnDelete action) {
|
||||
this.setOnDelete(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
public enum OnDelete {
|
||||
CASCADE, NO_ACTION;
|
||||
|
||||
public static OnDelete from(String action) {
|
||||
return Enum.valueOf(OnDelete.class, action.toUpperCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
119
src/main/java/net/sf/jsqlparser/expression/StringValue.java
Normal file
119
src/main/java/net/sf/jsqlparser/expression/StringValue.java
Normal file
@@ -0,0 +1,119 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
/**
|
||||
* A string as in 'example_string'
|
||||
*/
|
||||
public final class StringValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
public static final List<String> ALLOWED_PREFIXES =
|
||||
Arrays.asList("N", "U", "E", "R", "B", "RB", "_utf8", "Q");
|
||||
private String value = "";
|
||||
private String prefix = null;
|
||||
|
||||
public StringValue() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public StringValue(String escapedValue) {
|
||||
// removing "'" at the start and at the end
|
||||
if (escapedValue.length() >= 2 && escapedValue.startsWith("'")
|
||||
&& escapedValue.endsWith("'")) {
|
||||
value = escapedValue.substring(1, escapedValue.length() - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (escapedValue.length() > 2) {
|
||||
for (String p : ALLOWED_PREFIXES) {
|
||||
if (escapedValue.length() > p.length()
|
||||
&& escapedValue.substring(0, p.length()).equalsIgnoreCase(p)
|
||||
&& escapedValue.charAt(p.length()) == '\'') {
|
||||
this.prefix = p;
|
||||
value = escapedValue.substring(p.length() + 1, escapedValue.length() - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
value = escapedValue;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String string) {
|
||||
value = string;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public String getNotExcapedValue() {
|
||||
StringBuilder buffer = new StringBuilder(value);
|
||||
int index = 0;
|
||||
int deletesNum = 0;
|
||||
while ((index = value.indexOf("''", index)) != -1) {
|
||||
buffer.deleteCharAt(index - deletesNum);
|
||||
index += 2;
|
||||
deletesNum++;
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (prefix != null ? prefix : "") + "'" + value + "'";
|
||||
}
|
||||
|
||||
public StringValue withPrefix(String prefix) {
|
||||
this.setPrefix(prefix);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StringValue withValue(String value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
StringValue that = (StringValue) o;
|
||||
return Objects.equals(value, that.value) && Objects.equals(prefix, that.prefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(value, prefix);
|
||||
}
|
||||
}
|
||||
198
src/main/java/net/sf/jsqlparser/expression/StructType.java
Normal file
198
src/main/java/net/sf/jsqlparser/expression/StructType.java
Normal file
@@ -0,0 +1,198 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2024 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
import net.sf.jsqlparser.statement.create.table.ColDataType;
|
||||
import net.sf.jsqlparser.statement.select.SelectItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* STRUCT<T>
|
||||
*
|
||||
* Type Declaration Meaning STRUCT<INT64> Simple struct with a single unnamed 64-bit integer field.
|
||||
* STRUCT<x STRING(10)> Simple struct with a single parameterized string field named x. STRUCT<x
|
||||
* STRUCT<y INT64, z INT64>> A struct with a nested struct named x inside it. The struct x has two
|
||||
* fields, y and z, both of which are 64-bit integers. STRUCT<inner_array ARRAY<INT64>> A struct
|
||||
* containing an array named inner_array that holds 64-bit integer elements.
|
||||
*
|
||||
* STRUCT( expr1 [AS field_name] [, ... ])
|
||||
*
|
||||
* Syntax Output Type STRUCT(1,2,3) STRUCT<int64,int64,int64> STRUCT() STRUCT<> STRUCT('abc')
|
||||
* STRUCT<string> STRUCT(1, t.str_col) STRUCT<int64, str_col string> STRUCT(1 AS a, 'abc' AS b)
|
||||
* STRUCT<a int64, b string> STRUCT(str_col AS abc) STRUCT<abc string>
|
||||
*
|
||||
*
|
||||
* Struct Literals
|
||||
*
|
||||
* Example Output Type (1, 2, 3) STRUCT<INT64, INT64, INT64> (1, 'abc') STRUCT<INT64, STRING>
|
||||
* STRUCT(1 AS foo, 'abc' AS bar) STRUCT<foo INT64, bar STRING> STRUCT<INT64, STRING>(1, 'abc')
|
||||
* STRUCT<INT64, STRING> STRUCT(1) STRUCT<INT64> STRUCT<INT64>(1) STRUCT<INT64>
|
||||
*
|
||||
*/
|
||||
public class StructType extends ASTNodeAccessImpl implements Expression {
|
||||
private Dialect dialect = Dialect.BIG_QUERY;;
|
||||
private String keyword;
|
||||
private List<Map.Entry<String, ColDataType>> parameters;
|
||||
private List<SelectItem<?>> arguments;
|
||||
|
||||
public StructType(Dialect dialect, String keyword,
|
||||
List<Map.Entry<String, ColDataType>> parameters,
|
||||
List<SelectItem<?>> arguments) {
|
||||
this.dialect = dialect;
|
||||
this.keyword = keyword;
|
||||
this.parameters = parameters;
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
public StructType(Dialect dialect, List<Map.Entry<String, ColDataType>> parameters,
|
||||
List<SelectItem<?>> arguments) {
|
||||
this.dialect = dialect;
|
||||
this.parameters = parameters;
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
public StructType(Dialect dialect, List<SelectItem<?>> arguments) {
|
||||
this.dialect = dialect;
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
public Dialect getDialect() {
|
||||
return dialect;
|
||||
}
|
||||
|
||||
public StructType setDialect(Dialect dialect) {
|
||||
this.dialect = dialect;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public StructType setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<Map.Entry<String, ColDataType>> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public StructType setParameters(List<Map.Entry<String, ColDataType>> parameters) {
|
||||
this.parameters = parameters;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<SelectItem<?>> getArguments() {
|
||||
return arguments;
|
||||
}
|
||||
|
||||
public StructType setArguments(List<SelectItem<?>> arguments) {
|
||||
this.arguments = arguments;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StructType add(Expression expression, String aliasName) {
|
||||
if (arguments == null) {
|
||||
arguments = new ArrayList<>();
|
||||
}
|
||||
arguments.add(new SelectItem<>(expression, aliasName));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public StringBuilder appendTo(StringBuilder builder) {
|
||||
if (dialect != Dialect.DUCKDB && keyword != null) {
|
||||
builder.append(keyword);
|
||||
}
|
||||
|
||||
if (dialect != Dialect.DUCKDB && parameters != null && !parameters.isEmpty()) {
|
||||
builder.append("<");
|
||||
int i = 0;
|
||||
|
||||
for (Map.Entry<String, ColDataType> e : parameters) {
|
||||
if (0 < i++) {
|
||||
builder.append(",");
|
||||
}
|
||||
// optional name
|
||||
if (e.getKey() != null && !e.getKey().isEmpty()) {
|
||||
builder.append(e.getKey()).append(" ");
|
||||
}
|
||||
|
||||
// mandatory type
|
||||
builder.append(e.getValue());
|
||||
}
|
||||
|
||||
builder.append(">");
|
||||
}
|
||||
|
||||
if (arguments != null && !arguments.isEmpty()) {
|
||||
|
||||
if (dialect == Dialect.DUCKDB) {
|
||||
builder.append("{ ");
|
||||
int i = 0;
|
||||
for (SelectItem<?> e : arguments) {
|
||||
if (0 < i++) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append(e.getAlias().getName());
|
||||
builder.append(":");
|
||||
builder.append(e.getExpression());
|
||||
}
|
||||
builder.append(" }");
|
||||
} else {
|
||||
builder.append("(");
|
||||
int i = 0;
|
||||
for (SelectItem<?> e : arguments) {
|
||||
if (0 < i++) {
|
||||
builder.append(",");
|
||||
}
|
||||
e.appendTo(builder);
|
||||
}
|
||||
|
||||
builder.append(")");
|
||||
}
|
||||
}
|
||||
|
||||
if (dialect == Dialect.DUCKDB && parameters != null && !parameters.isEmpty()) {
|
||||
builder.append("::STRUCT( ");
|
||||
int i = 0;
|
||||
|
||||
for (Map.Entry<String, ColDataType> e : parameters) {
|
||||
if (0 < i++) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append(e.getKey()).append(" ");
|
||||
builder.append(e.getValue());
|
||||
}
|
||||
builder.append(")");
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return appendTo(new StringBuilder()).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public enum Dialect {
|
||||
BIG_QUERY, DUCKDB
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
public class TimeKeyExpression extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private String stringValue;
|
||||
|
||||
public TimeKeyExpression() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public TimeKeyExpression(final String value) {
|
||||
this.stringValue = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public String getStringValue() {
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
public void setStringValue(String string) {
|
||||
stringValue = string;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getStringValue();
|
||||
}
|
||||
|
||||
public TimeKeyExpression withStringValue(String stringValue) {
|
||||
this.setStringValue(stringValue);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
56
src/main/java/net/sf/jsqlparser/expression/TimeValue.java
Normal file
56
src/main/java/net/sf/jsqlparser/expression/TimeValue.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*-
|
||||
* #%L
|
||||
* JSQLParser library
|
||||
* %%
|
||||
* Copyright (C) 2004 - 2019 JSQLParser
|
||||
* %%
|
||||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
|
||||
* #L%
|
||||
*/
|
||||
package net.sf.jsqlparser.expression;
|
||||
|
||||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
|
||||
|
||||
import java.sql.Time;
|
||||
|
||||
/**
|
||||
* A Time in the form {t 'hh:mm:ss'}
|
||||
*/
|
||||
public class TimeValue extends ASTNodeAccessImpl implements Expression {
|
||||
|
||||
private Time value;
|
||||
|
||||
public TimeValue() {
|
||||
// empty constructor
|
||||
}
|
||||
|
||||
public TimeValue(String value) {
|
||||
if (value == null || value.isEmpty()) {
|
||||
throw new IllegalArgumentException("value can neither be null nor empty.");
|
||||
}
|
||||
this.value = Time.valueOf(value.substring(1, value.length() - 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) {
|
||||
return expressionVisitor.visit(this, context);
|
||||
}
|
||||
|
||||
public Time getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Time d) {
|
||||
value = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{t '" + value + "'}";
|
||||
}
|
||||
|
||||
public TimeValue withValue(Time value) {
|
||||
this.setValue(value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user