├── .github
├── dependabot.yml
├── release.yml
└── workflows
│ └── build.yml
├── .gitignore
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.adoc
├── LICENSE
├── README.adoc
├── SECURITY.md
├── annotations
├── pom.xml
└── src
│ └── main
│ └── java
│ ├── module-info.java
│ └── org
│ └── jboss
│ └── logging
│ └── annotations
│ ├── BaseUrl.java
│ ├── Cause.java
│ ├── ConstructType.java
│ ├── Field.java
│ ├── Fields.java
│ ├── FormatWith.java
│ ├── LogMessage.java
│ ├── LoggingClass.java
│ ├── Message.java
│ ├── MessageBundle.java
│ ├── MessageLogger.java
│ ├── Once.java
│ ├── Param.java
│ ├── Pos.java
│ ├── Producer.java
│ ├── Properties.java
│ ├── Property.java
│ ├── ResolutionDoc.java
│ ├── Signature.java
│ ├── Suppressed.java
│ ├── Transform.java
│ ├── TransformException.java
│ ├── ValidIdRange.java
│ └── ValidIdRanges.java
├── dco.txt
├── docs
├── apidocs
│ ├── allclasses-index.html
│ ├── allpackages-index.html
│ ├── constant-values.html
│ ├── copy.svg
│ ├── element-list
│ ├── help-doc.html
│ ├── index-all.html
│ ├── index.html
│ ├── legal
│ │ ├── ADDITIONAL_LICENSE_INFO
│ │ ├── ASSEMBLY_EXCEPTION
│ │ ├── LICENSE
│ │ ├── jquery.md
│ │ └── jqueryUI.md
│ ├── link.svg
│ ├── member-search-index.js
│ ├── module-search-index.js
│ ├── org.jboss.logging.annotations
│ │ ├── module-summary.html
│ │ └── org
│ │ │ └── jboss
│ │ │ └── logging
│ │ │ └── annotations
│ │ │ ├── BaseUrl.html
│ │ │ ├── Cause.html
│ │ │ ├── ConstructType.html
│ │ │ ├── Field.html
│ │ │ ├── Fields.html
│ │ │ ├── FormatWith.html
│ │ │ ├── LogMessage.html
│ │ │ ├── LoggingClass.html
│ │ │ ├── Message.Format.html
│ │ │ ├── Message.html
│ │ │ ├── MessageBundle.html
│ │ │ ├── MessageLogger.html
│ │ │ ├── Once.html
│ │ │ ├── Param.html
│ │ │ ├── Pos.html
│ │ │ ├── Producer.html
│ │ │ ├── Properties.html
│ │ │ ├── Property.html
│ │ │ ├── ResolutionDoc.html
│ │ │ ├── Signature.html
│ │ │ ├── Suppressed.html
│ │ │ ├── Transform.TransformType.html
│ │ │ ├── Transform.html
│ │ │ ├── TransformException.html
│ │ │ ├── ValidIdRange.html
│ │ │ ├── ValidIdRanges.html
│ │ │ ├── class-use
│ │ │ ├── BaseUrl.html
│ │ │ ├── Cause.html
│ │ │ ├── ConstructType.html
│ │ │ ├── Field.html
│ │ │ ├── Fields.html
│ │ │ ├── FormatWith.html
│ │ │ ├── LogMessage.html
│ │ │ ├── LoggingClass.html
│ │ │ ├── Message.Format.html
│ │ │ ├── Message.html
│ │ │ ├── MessageBundle.html
│ │ │ ├── MessageLogger.html
│ │ │ ├── Once.html
│ │ │ ├── Param.html
│ │ │ ├── Pos.html
│ │ │ ├── Producer.html
│ │ │ ├── Properties.html
│ │ │ ├── Property.html
│ │ │ ├── ResolutionDoc.html
│ │ │ ├── Signature.html
│ │ │ ├── Suppressed.html
│ │ │ ├── Transform.TransformType.html
│ │ │ ├── Transform.html
│ │ │ ├── TransformException.html
│ │ │ ├── ValidIdRange.html
│ │ │ └── ValidIdRanges.html
│ │ │ ├── package-summary.html
│ │ │ ├── package-tree.html
│ │ │ └── package-use.html
│ ├── overview-tree.html
│ ├── package-search-index.js
│ ├── resources
│ │ ├── glass.png
│ │ └── x.png
│ ├── script-dir
│ │ ├── jquery-3.7.1.min.js
│ │ ├── jquery-ui.min.css
│ │ └── jquery-ui.min.js
│ ├── script.js
│ ├── search-page.js
│ ├── search.html
│ ├── search.js
│ ├── stylesheet.css
│ ├── tag-search-index.js
│ └── type-search-index.js
├── default-notes.html
├── examples.html
├── examples
│ └── errors
│ │ ├── CW000003.html
│ │ ├── CW000100.html
│ │ └── CW000101.html
├── expressions.html
├── getting-started.html
├── index.html
├── js
│ └── links.js
├── message-bundle.html
├── message-logger.html
├── pom.xml
├── processor-options.html
├── reports.html
├── src
│ └── main
│ │ ├── asciidoc
│ │ ├── default-notes.adoc
│ │ ├── docinfo-footer.html
│ │ ├── examples.adoc
│ │ ├── examples
│ │ │ └── errors
│ │ │ │ ├── CW000003.adoc
│ │ │ │ ├── CW000100.adoc
│ │ │ │ └── CW000101.adoc
│ │ ├── expressions.adoc
│ │ ├── getting-started.adoc
│ │ ├── index.adoc
│ │ ├── js
│ │ │ └── links.js
│ │ ├── message-bundle.adoc
│ │ ├── message-logger.adoc
│ │ ├── processor-options.adoc
│ │ ├── reports.adoc
│ │ └── translation-property-files.adoc
│ │ └── java
│ │ └── org
│ │ └── jboss
│ │ └── logging
│ │ └── tools
│ │ └── examples
│ │ ├── AppLogger.java
│ │ ├── CloseException.java
│ │ ├── ContentWriter.java
│ │ ├── ContentWriterBuilder.java
│ │ └── ErrorMessages.java
└── translation-property-files.html
├── pom.xml
└── processor
├── pom.xml
└── src
├── main
├── java
│ └── org
│ │ └── jboss
│ │ └── logging
│ │ └── processor
│ │ ├── apt
│ │ ├── AbstractClassType.java
│ │ ├── AbstractGenerator.java
│ │ ├── ImplementationClassGenerator.java
│ │ ├── LoggingToolsProcessor.java
│ │ ├── MessageInterfaceFactory.java
│ │ ├── MessageMethodBuilder.java
│ │ ├── ParameterFactory.java
│ │ ├── ProcessingException.java
│ │ ├── ReportFileGenerator.java
│ │ ├── ReturnTypeFactory.java
│ │ ├── ThrowableTypeFactory.java
│ │ ├── ToolLogger.java
│ │ ├── TranslationClassGenerator.java
│ │ ├── TranslationFileGenerator.java
│ │ └── report
│ │ │ ├── AsciidocReportWriter.java
│ │ │ ├── IndentingXmlWriter.java
│ │ │ ├── ReportType.java
│ │ │ ├── ReportWriter.java
│ │ │ └── XmlReportWriter.java
│ │ ├── generator
│ │ └── model
│ │ │ ├── ClassModel.java
│ │ │ ├── ClassModelFactory.java
│ │ │ ├── ClassModelHelper.java
│ │ │ ├── ImplementationClassModel.java
│ │ │ ├── MessageBundleImplementor.java
│ │ │ ├── MessageBundleTranslator.java
│ │ │ ├── MessageLoggerImplementor.java
│ │ │ └── MessageLoggerTranslator.java
│ │ ├── model
│ │ ├── ClassType.java
│ │ ├── DelegatingElement.java
│ │ ├── DelegatingExecutableElement.java
│ │ ├── DelegatingTypeElement.java
│ │ ├── JavaDocComment.java
│ │ ├── LoggerMessageMethod.java
│ │ ├── MessageInterface.java
│ │ ├── MessageMethod.java
│ │ ├── Parameter.java
│ │ ├── ReturnType.java
│ │ └── ThrowableType.java
│ │ ├── util
│ │ ├── Comparison.java
│ │ ├── ElementHelper.java
│ │ ├── Expressions.java
│ │ ├── Objects.java
│ │ ├── TranslationHelper.java
│ │ └── VersionComparator.java
│ │ └── validation
│ │ ├── AbstractFormatPart.java
│ │ ├── AbstractFormatValidator.java
│ │ ├── FormatPart.java
│ │ ├── FormatValidator.java
│ │ ├── FormatValidatorFactory.java
│ │ ├── IdLengthValidator.java
│ │ ├── IdRangeValidator.java
│ │ ├── MessageFormatPart.java
│ │ ├── MessageFormatValidator.java
│ │ ├── MessageIdValidator.java
│ │ ├── NoFormatValidator.java
│ │ ├── PropertyValidator.java
│ │ ├── StringFormatPart.java
│ │ ├── StringFormatValidator.java
│ │ ├── StringPart.java
│ │ ├── ValidationMessage.java
│ │ ├── ValidationMessageFactory.java
│ │ └── Validator.java
└── resources
│ ├── META-INF
│ ├── gradle
│ │ └── incremental.annotation.processors
│ └── services
│ │ └── javax.annotation.processing.Processor
│ └── schema
│ └── logging-report_1_0.xsd
└── test
├── java
└── org
│ └── jboss
│ └── logging
│ └── processor
│ ├── generated
│ ├── DefaultLogger.java
│ ├── DefaultMessages.java
│ ├── ExpressionLogger.java
│ ├── ExtendedLogger.java
│ ├── LogOnceLogger.java
│ ├── MethodMessageConstants.java
│ ├── RootLocaleLogger.java
│ ├── SignatureMessages.java
│ ├── StringFormatLogger.java
│ ├── StringFormatMessages.java
│ ├── TestConstants.java
│ ├── TransformLogger.java
│ ├── TransformMessages.java
│ ├── ValidLogger.java
│ ├── ValidMessages.java
│ └── tests
│ │ ├── AbstractLoggerTest.java
│ │ ├── ExpressionMessagesTest.java
│ │ ├── GeneratedSkeletonTest.java
│ │ ├── GeneratedSourceAnalysisTest.java
│ │ ├── LevelIdCheckTest.java
│ │ ├── LogOnceTest.java
│ │ ├── LoggerTest.java
│ │ ├── LoggerVerificationTest.java
│ │ ├── MessagesTest.java
│ │ ├── QueuedMessageHandler.java
│ │ ├── ThrowableSignatureTest.java
│ │ └── TransformTest.java
│ ├── report
│ ├── ReportGenerationTest.java
│ ├── TestReportLogger.java
│ └── TestReportMessages.java
│ ├── util
│ ├── ExpressionsTest.java
│ └── VersionComparatorTest.java
│ └── validation
│ ├── MessageFormatValidatorTest.java
│ └── StringFormatValidatorTest.java
└── resources
├── expression.properties
├── logging.properties
└── org
└── jboss
└── logging
└── processor
└── generated
├── DefaultLogger.i18n_de.properties
├── DefaultLogger.i18n_de_DE.properties
├── DefaultLogger.i18n_en.properties
├── DefaultLogger.i18n_en_CA.properties
├── DefaultLogger.i18n_en_UK.properties
├── DefaultLogger.i18n_en_US.properties
├── DefaultLogger.i18n_es.properties
├── DefaultLogger.i18n_fr.properties
├── DefaultLogger.i18n_fr_CA.properties
├── DefaultLogger.i18n_fr_FR.properties
├── DefaultLogger.i18n_it.properties
├── DefaultLogger.i18n_it_IT.properties
├── DefaultLogger.i18n_ja.properties
├── DefaultLogger.i18n_ja_JP.properties
├── DefaultLogger.i18n_ko.properties
├── DefaultLogger.i18n_ko_KR.properties
├── DefaultLogger.i18n_zh.properties
├── DefaultLogger.i18n_zh_CN.properties
├── DefaultLogger.i18n_zh_TW.properties
├── DefaultMessages.i18n_de.properties
├── DefaultMessages.i18n_es.properties
├── DefaultMessages.i18n_fr.properties
├── RootLocaleLogger.i18n_en_US.properties
└── StringFormatLogger.i18n_es.properties
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "maven"
9 | directory: "/"
10 | schedule:
11 | interval: "daily"
12 | open-pull-requests-limit: 10
13 | - package-ecosystem: "github-actions"
14 | # Workflow files stored in the
15 | # default location of `.github/workflows`
16 | directory: "/"
17 | schedule:
18 | interval: "daily"
19 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | # .github/release.yml
2 |
3 | changelog:
4 | categories:
5 | - title: Breaking Changes 🛠
6 | labels:
7 | - breaking-change
8 | - title: Enhancements 🎉
9 | labels:
10 | - enhancement
11 | - title: Bugs 🐛
12 | labels:
13 | - bug
14 | - title: Dependency Upgrades ⬆
15 | labels:
16 | - dependency
17 | - title: Other Changes
18 | labels:
19 | - "*"
20 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a Java project with Maven
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3 |
4 | name: JBoss Logging Tools - CI
5 |
6 | on:
7 | push:
8 | branches:
9 | - 'main'
10 | pull_request:
11 | branches:
12 | - '**'
13 |
14 | # Only run the latest job
15 | concurrency:
16 | group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
17 | cancel-in-progress: true
18 |
19 | jobs:
20 | build:
21 | name: ${{ matrix.os }}-jdk${{ matrix.java }}
22 | runs-on: ${{ matrix.os }}
23 | strategy:
24 | fail-fast: false
25 | matrix:
26 | os: [ubuntu-latest, windows-latest]
27 | java: ['11', '17', '21', '22-ea']
28 |
29 | steps:
30 | - uses: actions/checkout@v4
31 | - name: Set up JDK ${{ matrix.java }}
32 | uses: actions/setup-java@v4
33 | with:
34 | java-version: ${{ matrix.java }}
35 | distribution: 'temurin'
36 | cache: 'maven'
37 | - name: Build and Test on ${{ matrix.java }}
38 | run: mvn clean -U -B install -fae
39 | - uses: actions/upload-artifact@v4
40 | if: failure()
41 | with:
42 | name: surefire-reports-${{ matrix.os }}-${{ matrix.java }}
43 | path: '**/surefire-reports/'
44 |
45 | format-check:
46 | runs-on: ubuntu-latest
47 | timeout-minutes: 30
48 |
49 | steps:
50 | - uses: actions/checkout@v4
51 | - name: Set up JDK 17
52 | uses: actions/setup-java@v4
53 | with:
54 | java-version: 17
55 | distribution: 'temurin'
56 | cache: 'maven'
57 | - name: Validate Formatting
58 | run: |
59 | mvn -B validate -Pformat-check -Denforcer.skip=true
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #Ignore Maven target folder
2 | target/
3 | .cache
4 |
5 | #Ignore Eclipse files
6 | .settings/
7 | .classpath
8 | .project
9 |
10 | #Ignore Intellij files
11 | *.iml
12 | *.iws
13 | *.ipr
14 | .idea/
15 |
16 | #Ignore Mac files
17 | .DS_Store
18 | /core/target/
19 | /base/target/
20 | nb-configuration.xml
21 | /processor/target/
22 | /generator/target/
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @jamezp
2 |
--------------------------------------------------------------------------------
/CONTRIBUTING.adoc:
--------------------------------------------------------------------------------
1 | :toc:
2 |
3 | = Contributing Guide
4 |
5 | Want to contribute to the jboss-logging-tools? We try to make it easy, and all contributions, even the smaller ones,
6 | are more than welcome. This includes bug reports, fixes, documentation, etc. First though, please read this page
7 | (including the small print at the end).
8 |
9 | == Legal
10 |
11 | All original contributions to jboss-logging-tools are licensed under the
12 | https://www.apache.org/licenses/LICENSE-2.0[ASL - Apache License], version 2.0 or later, or, if another license is
13 | specified as governing the file or directory being modified, such other license.
14 |
15 | All contributions are subject to the https://developercertificate.org/[Developer Certificate of Origin (DCO)].
16 | The DCO text is also included verbatim in the [dco.txt](dco.txt) file in the root directory of the repository.
17 |
18 | == Reporting an issue
19 |
20 | This project uses https://issues.redhat.com/browse/LOGMGR[JIRA] for filing issues.
21 |
22 | If you believe you found a bug, and it's likely possible, please indicate a way to reproduce it, what you are seeing and
23 | what you would expect to see.
24 |
25 | == Before you contribute
26 |
27 | To contribute, use GitHub Pull Requests, from your **own** fork.
28 |
29 | Also, make sure you have set up your Git authorship correctly:
30 |
31 | ----
32 | git config --global user.name "Your Full Name"
33 | git config --global user.email your.email@example.com
34 | ----
35 |
36 | If you use different computers to contribute, please make sure the name is the same on all your computers.
37 |
38 | We use this information to acknowledge your contributions in release announcements.
39 |
40 | == Setup
41 |
42 | If you have not done so on this machine, you need to:
43 |
44 | * Install Git and configure your GitHub access
45 | * Install Java SDK 11+ (OpenJDK recommended)
46 |
47 | === IDE Config and Code Style
48 |
49 | jboss-logging-tools has a strictly enforced code style. Code formatting is done by the Eclipse code formatter, using the config files
50 | found in the https://github.com/jboss-logging/logging-dev-tools/blob/main/ide-config/src/main/resources/[eclipse-code-formatter.xml]
51 | file. By default, when you run `mvn verify`, the code will be formatted automatically.
52 | When submitting a pull request the CI build will fail if running the formatter results in any code changes, so it is
53 | recommended that you always run a full Maven build before submitting a pull request.
54 |
55 | ==== Eclipse Setup
56 |
57 | Open the *Preferences* window, and then navigate to _Java_ -> _Code Style_ -> _Formatter_. Click _Import_ and then
58 | select the `eclipse-code-formatter.xml` downloaded from the above link or clone the repository and navigate to the file.
59 |
60 | Next navigate to _Java_ -> _Code Style_ -> _Organize Imports_. Click _Import_ and select the `eclipse.importorder` file.
61 |
62 | ==== IDEA Setup
63 |
64 | Install the https://plugins.jetbrains.com/plugin/6546-adapter-for-eclipse-code-formatter/[Adapter for Eclipse Code Formatter].
65 | See the https://github.com/krasa/EclipseCodeFormatter#instructions[documentation] on how to configure the plugin.
66 |
--------------------------------------------------------------------------------
/README.adoc:
--------------------------------------------------------------------------------
1 | = JBoss Logging Tools
2 |
3 | The JBoss logging tools are used to create internationalized log statements and exceptions.
4 |
5 | For user documentation see https://jboss-logging.github.io/jboss-logging-tools/. For annotation JavaDoc's see
6 | https://jboss-logging.github.io/jboss-logging-tools/apidocs/.
7 |
8 | == Building
9 |
10 | Standard Maven build:
11 |
12 | mvn clean install
13 |
14 | To generate the site use the `-Pgenerate-site` profile or `-Dgenerate-site` system property when building.
15 |
16 | mvn clean install -Dgenerate-site
17 |
18 | == Contributing
19 |
20 | See the link:CONTRIBUTING.adoc[contributing guide].
21 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Security Contacts and Procedures
4 |
5 | The JBoss community takes security very seriously, and we aim to take immediate action to address serious
6 | security-related problems that involve our products or services.
7 |
8 | Please report any suspected security vulnerability in this project to Red Hat Product Security at secalert@redhat.com.
9 | You can use our GPG key to communicate with us securely.
10 |
11 | To report an issue in any Red Hat branded website or online service, please contact Red Hat Information Security at
12 | site-security@redhat.com.
13 | https://access.redhat.com/security/team/contact
14 |
--------------------------------------------------------------------------------
/annotations/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
22 |
23 | 4.0.0
24 |
25 |
26 | org.jboss.logging
27 | jboss-logging-tools-parent
28 | 3.0.5.Final-SNAPSHOT
29 | ../pom.xml
30 |
31 |
32 | jboss-logging-annotations
33 | jar
34 |
35 | JBoss Logging I18n Annotations
36 |
37 |
38 |
39 | Apache License 2.0
40 | https://repository.jboss.org/licenses/apache-2.0.txt
41 | repo
42 |
43 |
44 |
45 |
46 |
47 |
48 | org.jboss.logging
49 | jboss-logging
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/annotations/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | module org.jboss.logging.annotations {
2 | requires org.jboss.logging;
3 | exports org.jboss.logging.annotations;
4 | }
5 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/BaseUrl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Messages on reports can have a link to a {@linkplain ResolutionDoc resolution document}. This annotation can be used
31 | * to provide a base URL for these documents.
32 | *
33 | * Expressions in the form of {@code ${property.key:default-value}} can be used for the values. If the property key is
34 | * prefixed with {@code sys.} a {@linkplain System#getProperty(String) system property} will be used. If the key is
35 | * prefixed with {@code env.} an {@linkplain System#getenv(String) environment variable} will be used. In all other cases
36 | * the {@code org.jboss.logging.tools.expressionProperties} processor argument is used to specify the path the properties
37 | * file which contains the values for the expressions.
38 | *
39 | *
40 | * @author James R. Perkins
41 | * @since 1.2
42 | */
43 | @Target(TYPE)
44 | @Retention(CLASS)
45 | @Documented
46 | public @interface BaseUrl {
47 |
48 | /**
49 | * The base URL used for links to resolution documentation on reports. This can be a fully qualified URL or a
50 | * relative URL.
51 | *
52 | * @return the base URL
53 | */
54 | String value();
55 | }
56 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Cause.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Mark a parameter as being the "exception cause" parameter rather than a positional format parameter.
31 | *
32 | * @author David M. Lloyd
33 | */
34 | @Retention(CLASS)
35 | @Target(PARAMETER)
36 | @Documented
37 | public @interface Cause {
38 | }
39 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/ConstructType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.METHOD;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Indicates the value of this annotation should be constructed and returned. This does not change the return type of
31 | * the method.
32 | *
33 | * This annotation is only allowed on bundle messages that have a throwable return type. The value must be assignable
34 | * to the return type.
35 | *
36 | *
37 | * @author James R. Perkins
38 | * @since 2.0.0
39 | */
40 | @Retention(CLASS)
41 | @Target(METHOD)
42 | @Documented
43 | public @interface ConstructType {
44 |
45 | /**
46 | * The actual type that should be constructed for the return type.
47 | *
48 | * @return the class to construct
49 | */
50 | Class extends Throwable> value();
51 | }
52 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Fields.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.METHOD;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Defines the default field properties to use on the resultant exception object.
31 | *
32 | * @author James R. Perkins
33 | */
34 | @Retention(CLASS)
35 | @Target(METHOD)
36 | @Documented
37 | public @interface Fields {
38 |
39 | /**
40 | * The fields to use on the resultant exception object. Note that the {@link Field#name() name} attribute is
41 | * required for these annotations.
42 | *
43 | * @return the fields
44 | */
45 | Field[] value();
46 | }
47 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/FormatWith.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Indicate that the given parameter should be wrapped with a formatting object of the given class. The class
31 | * must have a one-argument constructor which unambiguously accepts a value of this parameter's type. The resultant
32 | * object will be passed in as a parameter to the underlying format type; thus its {@link Object#toString() toString()}
33 | * method will be invoked (or, if the format style is {@link Message.Format#PRINTF PRINTF}, the object may implement
34 | * {@link java.util.Formattable Formattable} to get extra functionality).
35 | *
36 | * @author David M. Lloyd
37 | */
38 | @Target(PARAMETER)
39 | @Retention(CLASS)
40 | @Documented
41 | public @interface FormatWith {
42 |
43 | /**
44 | * The class of the formatting object to use.
45 | *
46 | * @return the class
47 | */
48 | Class> value();
49 | }
50 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/LogMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.METHOD;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | import org.jboss.logging.Logger;
30 |
31 | /**
32 | * A typed logger method. Indicates that this method will log the associated {@link Message} to the logger system, as
33 | * opposed to being a simple message lookup.
34 | *
35 | * @author David M. Lloyd
36 | * @author James R. Perkins
37 | */
38 | @Retention(CLASS)
39 | @Target(METHOD)
40 | @Documented
41 | public @interface LogMessage {
42 |
43 | /**
44 | * The log level at which this message should be logged. Defaults to {@code INFO}.
45 | *
46 | * @return the log level
47 | */
48 | Logger.Level level() default Logger.Level.INFO;
49 |
50 | /**
51 | * The logging class name to use for this message, if any.
52 | *
53 | * @return the logging class name
54 | */
55 | Class> loggingClass() default Void.class;
56 |
57 | /**
58 | * Indicates before the message is logged the {@linkplain Thread#currentThread() current threads}
59 | * {@linkplain Thread#setContextClassLoader(ClassLoader) context class loader} is set to the the class loader from
60 | * this type.
61 | *
62 | * Note that special permissions may be required if running under a {@linkplain SecurityManager security manager}.
63 | *
64 | *
65 | * It is suggested this not be used on methods which are invoked frequently as there is overhead to this.
66 | *
67 | *
68 | * @return {@code true} if the current threads context loader should be used for the log call
69 | *
70 | * @see Thread#getContextClassLoader()
71 | * @see Thread#setContextClassLoader(ClassLoader)
72 | * @since 2.3.0
73 | */
74 | boolean useThreadContext() default false;
75 | }
76 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/LoggingClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Mark a parameter as specifying the name of the logging class to use. The parameter
31 | * may have a type of {@link Class}.
32 | *
33 | * @author David M. Lloyd
34 | */
35 | @Retention(CLASS)
36 | @Target(PARAMETER)
37 | @Documented
38 | public @interface LoggingClass {
39 | }
40 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Message.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.METHOD;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Assigns a message string to a resource method. The method arguments are used to supply the positional parameter
31 | * values for the method.
32 | *
33 | * @author David M. Lloyd
34 | */
35 | @Target(METHOD)
36 | @Retention(CLASS)
37 | @Documented
38 | public @interface Message {
39 |
40 | /**
41 | * Indicates that this message has no ID.
42 | */
43 | int NONE = 0;
44 | /**
45 | * Indicates that this message should inherit the ID from another message with the same name.
46 | */
47 | int INHERIT = -1;
48 |
49 | /**
50 | * The message ID number. Only one message with a given name may specify an ID other than {@link #INHERIT}.
51 | *
52 | * @return the message ID number
53 | */
54 | int id() default INHERIT;
55 |
56 | /**
57 | * The default format string of this message.
58 | *
59 | * Expressions in the form of {@code ${property.key:default-value}} can be used for the value. If the property key is
60 | * prefixed with {@code sys.} a {@linkplain System#getProperty(String) system property} will be used. If the key is
61 | * prefixed with {@code env.} an {@linkplain System#getenv(String) environment variable} will be used. In all other cases
62 | * the {@code org.jboss.logging.tools.expressionProperties} processor argument is used to specify the path the properties
63 | * file which contains the values for the expressions.
64 | *
65 | *
66 | * @return the format string
67 | */
68 | String value();
69 |
70 | /**
71 | * The format type of this method (defaults to {@link Format#PRINTF}).
72 | *
73 | * @return the format type
74 | */
75 | Format format() default Format.PRINTF;
76 |
77 | /**
78 | * The possible format types.
79 | */
80 | enum Format {
81 |
82 | /**
83 | * A {@link java.util.Formatter}-type format string.
84 | */
85 | PRINTF,
86 | /**
87 | * A {@link java.text.MessageFormat}-type format string.
88 | */
89 | MESSAGE_FORMAT,
90 |
91 | /**
92 | * Indicates the message should not be formatted.
93 | */
94 | NO_FORMAT,
95 | }
96 |
97 | }
98 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/MessageBundle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 | import java.util.Locale;
29 |
30 | /**
31 | * Signify that an interface is a message bundle interface.
32 | *
33 | * @author David M. Lloyd
34 | */
35 | @Target(TYPE)
36 | @Retention(CLASS)
37 | @Documented
38 | public @interface MessageBundle {
39 |
40 | /**
41 | * Get the project code for messages that have an associated code. If no project code is associated
42 | * with this bundle, specify {@code ""} (the empty string).
43 | *
44 | * @return the project code
45 | */
46 | String projectCode();
47 |
48 | /**
49 | * The length of the padding used for each id in the message bundle. For example given the default padding length
50 | * of 6 and a message with an id of 100 would result would be {@code "000100"}.
51 | *
52 | * Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error
53 | * being produced.
54 | *
55 | * @return the length the id should be padded
56 | */
57 | int length() default 6;
58 |
59 | /**
60 | * Specifies the {@linkplain Locale locale} for formatting bundle messages. This is only used in the super
61 | * implementation. Subclasses will define their own locale to use based on the name of the resource bundle at
62 | * compile time.
63 | *
64 | * An empty string will default to {@link Locale#ROOT}.
65 | *
66 | *
67 | * A non-empty string will be parsed by the {@link Locale#forLanguageTag(String)}. This uses the
68 | * IETF BCP 47 format.
69 | *
70 | *
71 | * @return the default locale message bundles should use for formatting messages
72 | */
73 | String rootLocale() default "";
74 | }
75 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/MessageLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 | import java.util.Locale;
29 |
30 | /**
31 | * Signify that an interface is a typed logger interface. A message logger interface may optionally extend other
32 | * message logger interfaces and message bundle interfaces (see {@link org.jboss.logging.annotations.MessageBundle}, as
33 | * well as the {@link org.jboss.logging.BasicLogger} interface.
34 | *
35 | * @author David M. Lloyd
36 | */
37 | @Retention(CLASS)
38 | @Target(TYPE)
39 | @Documented
40 | public @interface MessageLogger {
41 |
42 | /**
43 | * Get the project code for messages that have an associated code. If no project code is associated
44 | * with this logger, specify {@code ""} (the empty string).
45 | *
46 | * @return the project code
47 | */
48 | String projectCode();
49 |
50 | /**
51 | * The length of the padding used for each id in the message bundle. For example given the default padding length
52 | * of 6 and a message with an id of 100 would result would be {@code "000100"}.
53 | *
54 | * Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error
55 | * being produced.
56 | *
57 | * @return the length the id should be padded
58 | */
59 | int length() default 6;
60 |
61 | /**
62 | * Specifies the {@linkplain Locale locale} for formatting bundle messages. This is only used in the super
63 | * implementation. Subclasses will define their own locale to use based on the name of the resource bundle at
64 | * compile time.
65 | *
66 | * An empty string will default to {@link Locale#ROOT}.
67 | *
68 | *
69 | * A non-empty string will be parsed by the {@link Locale#forLanguageTag(String)}. This uses the
70 | * IETF BCP 47 format.
71 | *
72 | *
73 | * @return the default locale message bundles should use for formatting messages
74 | */
75 | String rootLocale() default "";
76 | }
77 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Once.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.METHOD;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Indicates a message should only be logged once.
31 | *
32 | * Methods that use this annotation must be {@linkplain org.jboss.logging.annotations.LogMessage logger methods}. Overloaded
33 | * methods also annotated with {@code @Once} will inherit the same check only logging the message from the first
34 | * overloaded method invoked.
35 | *
36 | *
37 | * @author James R. Perkins
38 | */
39 | @Target(METHOD)
40 | @Retention(CLASS)
41 | @Documented
42 | public @interface Once {
43 | }
44 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Param.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Identifies a parameter is to be used for constructing an exception and excluded from the formatting of the message.
31 | *
32 | * Parameters will be order-matched first, then type-matched to resolve ambiguity. If a match fails an error should
33 | * occur.
34 | *
35 | * The {@link #value()} option will allow an optional class to be specified which will have to match the exact type of
36 | * the parameter in question, to enable unambiguous resolution. The value must be the fully qualified class name.
37 | *
38 | * @author James R. Perkins
39 | */
40 | @Target(PARAMETER)
41 | @Retention(CLASS)
42 | @Documented
43 | public @interface Param {
44 |
45 | /**
46 | * Defines an exact class the parameter must match for unambiguous resolution.
47 | *
48 | * @return the class the parameter must match.
49 | */
50 | Class> value() default Object.class;
51 | }
52 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Pos.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * @author James R. Perkins
31 | * @since 1.1.0
32 | */
33 | @Retention(CLASS)
34 | @Target(PARAMETER)
35 | @Documented
36 | public @interface Pos {
37 |
38 | /**
39 | * The positions the value should be used at.
40 | *
41 | * @return an array of the positions for the parameter
42 | */
43 | int[] value();
44 |
45 | /**
46 | * The transform types used on the parameter.
47 | *
48 | * @return an array of the transformer types
49 | *
50 | * @see Transform
51 | */
52 | Transform[] transform() default {};
53 | }
54 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Producer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Identifies a parameter has the ability to produce a {@link Throwable} or a super type of a {@code Throwable}. The
31 | * parameter type must be a {@link java.util.function.Function} or a {@link java.util.function.BiFunction}.
32 | *
33 | * For a {@link java.util.function.Function} the input parameter must be a {@link String} which will be the message
34 | * associated with the method. The result type must {@link Throwable} or a super type of a {@code Throwable}.
35 | *
36 | *
37 | *
38 | * For a {@link java.util.function.BiFunction} one of the input parameters must be a {@link String} which will be the
39 | * message associated with the method. The other input parameter must be a {@link Throwable} or a super type of a
40 | * {@code Throwable} and must be assignable from the parameter annotated with {@link Cause}. The result type must
41 | * {@link Throwable} or a super type of a {@code Throwable}.
42 | *
43 | *
44 | *
45 | * Example
46 | *
47 | *
48 | * @Message("The operation failed due to %s")
49 | * T operationFailed(@Producer Function function, String op);
50 | *
51 | * @Message("The operation failed due to %s")
52 | * T operationFailed(@Producer BiFunction function, @Cause Throwable cause, String op);
53 | *
54 | *
69 | *
70 | * @author James R. Perkins
71 | */
72 | @Target(PARAMETER)
73 | @Retention(CLASS)
74 | @Documented
75 | public @interface Producer {
76 | }
77 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Properties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.METHOD;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Defines the default properties to use on the resultant exception object.
31 | *
32 | * @author James R. Perkins
33 | */
34 | @Retention(CLASS)
35 | @Target(METHOD)
36 | @Documented
37 | public @interface Properties {
38 |
39 | /**
40 | * The properties to use on the resultant exception object. Note that the {@link Property#name() name} attribute is
41 | * required for these annotations.
42 | *
43 | * @return the properties
44 | */
45 | Property[] value();
46 | }
47 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Suppressed.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Indicates the parameter should be added as a {@linkplain Throwable#addSuppressed(Throwable) suppressed} exception to
31 | * the returned exception.
32 | *
33 | * The annotated parameter can be a single {@linkplain Throwable throwable type}, an array of
34 | * {@linkplain Throwable throwable types} or a {@linkplain java.util.Collection collection} of
35 | * {@linkplain Throwable throwable types}. Note this is only allowed on message bundle methods that return a
36 | * {@linkplain Throwable throwable type}.
37 | *
38 | *
39 | * @author James R. Perkins
40 | */
41 | @Retention(CLASS)
42 | @Target(PARAMETER)
43 | @Documented
44 | public @interface Suppressed {
45 | }
46 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/Transform.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Indicate the given parameter should be transformed in each of the
31 | * {@link org.jboss.logging.annotations.Transform.TransformType transform types}
32 | * provided. The parameter cannot be a primitive type.
33 | *
34 | * For the {@link TransformType#SIZE} type, the object must be a {@link String}, a {@link java.util.Collection}, a
35 | * {@link java.util.Map} or an array.
36 | *
37 | * The type {@link TransformType#GET_CLASS} can be used with {@link TransformType#HASH_CODE} or {@link
38 | * TransformType#IDENTITY_HASH_CODE}. The type {@link TransformType#SIZE} must be used on it's own.
39 | *
40 | * @author James R. Perkins
41 | * @since 1.1.0
42 | */
43 | @Retention(CLASS)
44 | @Target(PARAMETER)
45 | @Documented
46 | public @interface Transform {
47 |
48 | /**
49 | * The transform type
50 | */
51 | public enum TransformType {
52 | /**
53 | * Gets the class of the object object passed, {@link Object#getClass()}.
54 | */
55 | GET_CLASS,
56 | /**
57 | * Gets the hash code of the object, {@link Object#hashCode()}.
58 | */
59 | HASH_CODE,
60 | /**
61 | * Gets the identity hash code of the object, {@link System#identityHashCode(Object)}.
62 | */
63 | IDENTITY_HASH_CODE,
64 | /**
65 | * Gets the size or length of a {@link String}, {@link java.util.Collection}, {@link java.util.Map} or array.
66 | */
67 | SIZE,
68 | }
69 |
70 | /**
71 | * The transform types used on the parameter.
72 | *
73 | * Valid combinations:
74 | *
82 | *
83 | * @return an array of the transform types
84 | */
85 | TransformType[] value();
86 | }
87 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/TransformException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.PARAMETER;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Transforms the parameter into a new exception appending the {@linkplain Throwable#getLocalizedMessage() message} from
31 | * the parameter to the {@linkplain Message message} from the method. This annotation is only allowed on parameters that
32 | * are a super type of the return type.
33 | *
34 | * Note that the {@linkplain Message message} must include a {@code %s} for the message from the parameter.
35 | *
46 | *
47 | * In the above example an exception is created based on the {@code toCopy} parameter. If the {@code toCopy} parameter
48 | * is a {@link java.net.BindException} then a {@link java.net.BindException} is created and the stack trace from the
49 | * {@code toCopy} parameter is copied to the newly created exception. This will happen for each type listed as a value,
50 | * finally falling back to an {@link java.io.IOException} if the parameter is not an instance of the suggested types.
51 | *
52 | *
53 | * The message for the newly created exception will be; "Binding to {@code address.toString()} failed:
54 | * {@code toCopy.getLocalizedMessage()}".
55 | *
56 | *
57 | * @author James R. Perkins
58 | */
59 | @Retention(CLASS)
60 | @Target(PARAMETER)
61 | @Documented
62 | public @interface TransformException {
63 |
64 | /**
65 | * Indicates if the stack trace from the parameter should be copied to the exception returned.
66 | *
67 | * If {@code true}, the default, the parameters stack trace will be set as the stack trace on the newly created
68 | * exception that is returned.
69 | *
70 | *
71 | * @return {@code true} if the stack trace should be copied to the newly created exception
72 | */
73 | boolean copyStackTrace() default true;
74 |
75 | /**
76 | * An array of suggested types to create. Each type must be a super type of the parameter.
77 | *
78 | * @return the suggested types to create
79 | */
80 | Class extends Throwable>[] value() default {};
81 | }
82 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/ValidIdRange.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * Sets a range of valid id's allowed on the {@link org.jboss.logging.annotations.Message#id() message id}. Both {@link
31 | * Message#INHERIT} and {@link Message#NONE} are ignored when validating.
32 | *
33 | * Note: Message id's from inherited interfaces are not validated within the range provided. Super interfaces
34 | * would need their own annotation for range validation.
35 | *
36 | *
37 | *
47 | *
48 | *
49 | * @author James R. Perkins
50 | */
51 | @Target(TYPE)
52 | @Retention(CLASS)
53 | @Documented
54 | public @interface ValidIdRange {
55 |
56 | /**
57 | * The minimum id allowed in the {@link org.jboss.logging.annotations.Message#id() message id}. Both {@link
58 | * Message#INHERIT} and {@link Message#NONE} are ignored when validating.
59 | *
60 | * @return the minimum id allowed
61 | */
62 | int min() default 1;
63 |
64 | /**
65 | * The maximum id allowed in the {@link org.jboss.logging.annotations.Message#id() message id}. Both {@link
66 | * Message#INHERIT} and {@link Message#NONE} are ignored when validating.
67 | *
68 | * @return the maximum id allowed
69 | */
70 | int max() default 999999;
71 | }
72 |
--------------------------------------------------------------------------------
/annotations/src/main/java/org/jboss/logging/annotations/ValidIdRanges.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.annotations;
21 |
22 | import static java.lang.annotation.ElementType.TYPE;
23 | import static java.lang.annotation.RetentionPolicy.CLASS;
24 |
25 | import java.lang.annotation.Documented;
26 | import java.lang.annotation.Retention;
27 | import java.lang.annotation.Target;
28 |
29 | /**
30 | * @author James R. Perkins
31 | */
32 | @Target(TYPE)
33 | @Retention(CLASS)
34 | @Documented
35 | public @interface ValidIdRanges {
36 |
37 | /**
38 | * An array of valid id ranges.
39 | *
40 | * @return an array of valid id ranges
41 | */
42 | ValidIdRange[] value();
43 | }
44 |
--------------------------------------------------------------------------------
/dco.txt:
--------------------------------------------------------------------------------
1 | Developer Certificate of Origin
2 | Version 1.1
3 |
4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5 | 1 Letterman Drive
6 | Suite D4700
7 | San Francisco, CA, 94129
8 |
9 | Everyone is permitted to copy and distribute verbatim copies of this
10 | license document, but changing it is not allowed.
11 |
12 |
13 | Developer's Certificate of Origin 1.1
14 |
15 | By making a contribution to this project, I certify that:
16 |
17 | (a) The contribution was created in whole or in part by me and I
18 | have the right to submit it under the open source license
19 | indicated in the file; or
20 |
21 | (b) The contribution is based upon previous work that, to the best
22 | of my knowledge, is covered under an appropriate open source
23 | license and I have the right under that license to submit that
24 | work with modifications, whether created in whole or in part
25 | by me, under the same open source license (unless I am
26 | permitted to submit under a different license), as indicated
27 | in the file; or
28 |
29 | (c) The contribution was provided directly to me by some other
30 | person who certified (a), (b) or (c) and I have not modified
31 | it.
32 |
33 | (d) I understand and agree that this project and the contribution
34 | are public and that a record of the contribution (including all
35 | personal information I submit with it, including my sign-off) is
36 | maintained indefinitely and may be redistributed consistent with
37 | this project or the open source license(s) involved.
38 |
--------------------------------------------------------------------------------
/docs/apidocs/copy.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
27 |
28 |
34 |
--------------------------------------------------------------------------------
/docs/apidocs/element-list:
--------------------------------------------------------------------------------
1 | module:org.jboss.logging.annotations
2 | org.jboss.logging.annotations
3 |
--------------------------------------------------------------------------------
/docs/apidocs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JBoss Logging I18n Documentation 3.0.4.Final API
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docs/apidocs/legal/ADDITIONAL_LICENSE_INFO:
--------------------------------------------------------------------------------
1 | ADDITIONAL INFORMATION ABOUT LICENSING
2 |
3 | Certain files distributed by Oracle America, Inc. and/or its affiliates are
4 | subject to the following clarification and special exception to the GPLv2,
5 | based on the GNU Project exception for its Classpath libraries, known as the
6 | GNU Classpath Exception.
7 |
8 | Note that Oracle includes multiple, independent programs in this software
9 | package. Some of those programs are provided under licenses deemed
10 | incompatible with the GPLv2 by the Free Software Foundation and others.
11 | For example, the package includes programs licensed under the Apache
12 | License, Version 2.0 and may include FreeType. Such programs are licensed
13 | to you under their original licenses.
14 |
15 | Oracle facilitates your further distribution of this package by adding the
16 | Classpath Exception to the necessary parts of its GPLv2 code, which permits
17 | you to use that code in combination with other independent modules not
18 | licensed under the GPLv2. However, note that this would not permit you to
19 | commingle code under an incompatible license with Oracle's GPLv2 licensed
20 | code by, for example, cutting and pasting such code into a file also
21 | containing Oracle's GPLv2 licensed code and then distributing the result.
22 |
23 | Additionally, if you were to remove the Classpath Exception from any of the
24 | files to which it applies and distribute the result, you would likely be
25 | required to license some or all of the other code in that distribution under
26 | the GPLv2 as well, and since the GPLv2 is incompatible with the license terms
27 | of some items included in the distribution by Oracle, removing the Classpath
28 | Exception could therefore effectively compromise your ability to further
29 | distribute the package.
30 |
31 | Failing to distribute notices associated with some files may also create
32 | unexpected legal consequences.
33 |
34 | Proceed with caution and we recommend that you obtain the advice of a lawyer
35 | skilled in open source matters before removing the Classpath Exception or
36 | making modifications to this package which may subsequently be redistributed
37 | and/or involve the use of third party software.
38 |
--------------------------------------------------------------------------------
/docs/apidocs/legal/ASSEMBLY_EXCEPTION:
--------------------------------------------------------------------------------
1 |
2 | OPENJDK ASSEMBLY EXCEPTION
3 |
4 | The OpenJDK source code made available by Oracle America, Inc. (Oracle) at
5 | openjdk.org ("OpenJDK Code") is distributed under the terms of the GNU
6 | General Public License version 2
7 | only ("GPL2"), with the following clarification and special exception.
8 |
9 | Linking this OpenJDK Code statically or dynamically with other code
10 | is making a combined work based on this library. Thus, the terms
11 | and conditions of GPL2 cover the whole combination.
12 |
13 | As a special exception, Oracle gives you permission to link this
14 | OpenJDK Code with certain code licensed by Oracle as indicated at
15 | https://openjdk.org/legal/exception-modules-2007-05-08.html
16 | ("Designated Exception Modules") to produce an executable,
17 | regardless of the license terms of the Designated Exception Modules,
18 | and to copy and distribute the resulting executable under GPL2,
19 | provided that the Designated Exception Modules continue to be
20 | governed by the licenses under which they were offered by Oracle.
21 |
22 | As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
23 | to build an executable that includes those portions of necessary code that
24 | Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
25 | with the Classpath exception). If you modify or add to the OpenJDK code,
26 | that new GPL2 code may still be combined with Designated Exception Modules
27 | if the new code is made subject to this exception by its copyright holder.
28 |
--------------------------------------------------------------------------------
/docs/apidocs/legal/jquery.md:
--------------------------------------------------------------------------------
1 | ## jQuery v3.7.1
2 |
3 | ### jQuery License
4 | ```
5 | jQuery v 3.7.1
6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the
10 | "Software"), to deal in the Software without restriction, including
11 | without limitation the rights to use, copy, modify, merge, publish,
12 | distribute, sublicense, and/or sell copies of the Software, and to
13 | permit persons to whom the Software is furnished to do so, subject to
14 | the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be
17 | included in all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/apidocs/legal/jqueryUI.md:
--------------------------------------------------------------------------------
1 | ## jQuery UI v1.13.2
2 |
3 | ### jQuery UI License
4 | ```
5 | Copyright jQuery Foundation and other contributors, https://jquery.org/
6 |
7 | This software consists of voluntary contributions made by many
8 | individuals. For exact contribution history, see the revision history
9 | available at https://github.com/jquery/jquery-ui
10 |
11 | The following license applies to all parts of this software except as
12 | documented below:
13 |
14 | ====
15 |
16 | Permission is hereby granted, free of charge, to any person obtaining
17 | a copy of this software and associated documentation files (the
18 | "Software"), to deal in the Software without restriction, including
19 | without limitation the rights to use, copy, modify, merge, publish,
20 | distribute, sublicense, and/or sell copies of the Software, and to
21 | permit persons to whom the Software is furnished to do so, subject to
22 | the following conditions:
23 |
24 | The above copyright notice and this permission notice shall be
25 | included in all copies or substantial portions of the Software.
26 |
27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 |
35 | ====
36 |
37 | Copyright and related rights for sample code are waived via CC0. Sample
38 | code is defined as all source code contained within the demos directory.
39 |
40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/
41 |
42 | ====
43 |
44 | All files located in the node_modules and external directories are
45 | externally maintained libraries used by this software which have their
46 | own licenses; we recommend you read them, as their terms may differ from
47 | the terms above.
48 |
49 | ```
50 |
--------------------------------------------------------------------------------
/docs/apidocs/link.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
27 |
28 |
32 |
--------------------------------------------------------------------------------
/docs/apidocs/module-search-index.js:
--------------------------------------------------------------------------------
1 | moduleSearchIndex = [{"l":"org.jboss.logging.annotations"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/apidocs/org.jboss.logging.annotations/org/jboss/logging/annotations/class-use/Cause.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Uses of Annotation Type org.jboss.logging.annotations.Cause (JBoss Logging I18n Documentation 3.0.4.Final API)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
22 |
23 |
24 |
48 |
49 |
50 |
51 |
52 |
Uses of Annotation Type org.jboss.logging.annotations.Cause
53 |
54 | No usage of org.jboss.logging.annotations.Cause
55 |
59 |
Uses of Annotation Type org.jboss.logging.annotations.Pos
53 |
54 | No usage of org.jboss.logging.annotations.Pos
55 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/docs/apidocs/package-search-index.js:
--------------------------------------------------------------------------------
1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"m":"org.jboss.logging.annotations","l":"org.jboss.logging.annotations"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/apidocs/resources/glass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jboss-logging/jboss-logging-tools/5366c739f7d5788600a08d2fdb6c9b556713ed2c/docs/apidocs/resources/glass.png
--------------------------------------------------------------------------------
/docs/apidocs/resources/x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jboss-logging/jboss-logging-tools/5366c739f7d5788600a08d2fdb6c9b556713ed2c/docs/apidocs/resources/x.png
--------------------------------------------------------------------------------
/docs/apidocs/script-dir/jquery-ui.min.css:
--------------------------------------------------------------------------------
1 | /*! jQuery UI - v1.13.2 - 2023-02-27
2 | * http://jqueryui.com
3 | * Includes: core.css, autocomplete.css, menu.css
4 | * Copyright jQuery Foundation and other contributors; Licensed MIT */
5 |
6 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}
--------------------------------------------------------------------------------
/docs/apidocs/tag-search-index.js:
--------------------------------------------------------------------------------
1 | tagSearchIndex = [{"l":"Constant Field Values","h":"","u":"constant-values.html"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/apidocs/type-search-index.js:
--------------------------------------------------------------------------------
1 | typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"org.jboss.logging.annotations","l":"BaseUrl"},{"p":"org.jboss.logging.annotations","l":"Cause"},{"p":"org.jboss.logging.annotations","l":"ConstructType"},{"p":"org.jboss.logging.annotations","l":"Field"},{"p":"org.jboss.logging.annotations","l":"Fields"},{"p":"org.jboss.logging.annotations","l":"Message.Format"},{"p":"org.jboss.logging.annotations","l":"FormatWith"},{"p":"org.jboss.logging.annotations","l":"LoggingClass"},{"p":"org.jboss.logging.annotations","l":"LogMessage"},{"p":"org.jboss.logging.annotations","l":"Message"},{"p":"org.jboss.logging.annotations","l":"MessageBundle"},{"p":"org.jboss.logging.annotations","l":"MessageLogger"},{"p":"org.jboss.logging.annotations","l":"Once"},{"p":"org.jboss.logging.annotations","l":"Param"},{"p":"org.jboss.logging.annotations","l":"Pos"},{"p":"org.jboss.logging.annotations","l":"Producer"},{"p":"org.jboss.logging.annotations","l":"Properties"},{"p":"org.jboss.logging.annotations","l":"Property"},{"p":"org.jboss.logging.annotations","l":"ResolutionDoc"},{"p":"org.jboss.logging.annotations","l":"Signature"},{"p":"org.jboss.logging.annotations","l":"Suppressed"},{"p":"org.jboss.logging.annotations","l":"Transform"},{"p":"org.jboss.logging.annotations","l":"TransformException"},{"p":"org.jboss.logging.annotations","l":"Transform.TransformType"},{"p":"org.jboss.logging.annotations","l":"ValidIdRange"},{"p":"org.jboss.logging.annotations","l":"ValidIdRanges"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/js/links.js:
--------------------------------------------------------------------------------
1 | function annotationLinks() {
2 | var links = document.getElementsByTagName("a");
3 | for(var i = 0, max = links.length; i < max; i++) {
4 | var l = links[i];
5 | if (l.text.startsWith("@")) {
6 | l.href = l.href + "/org/jboss/logging/annotations/" + l.text.substring(1) + ".html";
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/default-notes.adoc:
--------------------------------------------------------------------------------
1 | NOTE: A message is inheritable if the two methods have the same name and same number of format parameters.
2 |
3 | NOTE: A format parameter is a parameter that has no annotations or is annotated with one of the following annotations; link:{javadocsdir}[`@FormatWith`], link:{javadocsdir}[`@Pos`] or link:{javadocsdir}[`@Transform`].
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/docinfo-footer.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/examples.adoc:
--------------------------------------------------------------------------------
1 |
2 | :sourcedir: java/org/jboss/logging/tools/examples
3 | :projecturl: https://github.com/jboss-logging/jboss-logging-tools/tree/main/docs/src/main
4 |
5 | == Example Use Cases
6 |
7 | Below are some example use case snippets from the link:{projecturl}/{sourcedir}[examples].
8 |
9 | [source,java,indent=0]
10 | ----
11 | include::../{sourcedir}/ContentWriter.java[tags=write;close]
12 | ----
13 | <1> Logs the application version. Note this uses the link:{javadocsdir}[@Once] annotation to indicate this should only be logged once regardless of which `write` method is used.
14 | <2> The `ErrorMessages.nullParam()` returns a `java.lang.function.Supplier`. This allows the message to be lazily formatted only if the `value` is `null`.
15 | <3> Throws a message if the `value` is an empty string.
16 | <4> Uses a `java.lang.function.BiFunction` to create a new `UncheckedIOException` with the caught exception set as the cause.
17 | <5> Logs the caught exception instead of throwing a new exception.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/examples/errors/CW000003.adoc:
--------------------------------------------------------------------------------
1 | == CW000003: Null Parameter
2 |
3 | This error indicates you've passed a `null` parameter where a `non-null` value
4 | is required.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/examples/errors/CW000100.adoc:
--------------------------------------------------------------------------------
1 | == CW000100: Close Failure
2 |
3 | This error indicates there was a failure closing a resource. Please see previous error messages and contact support if
4 | required.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/examples/errors/CW000101.adoc:
--------------------------------------------------------------------------------
1 | == CW000101: Encoding Error
2 |
3 | This error indicates an invalid encoding is attempting to be used and a default encoding of UTF-8 will be used. You can
4 | fix this by setting a valid encoding value.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/expressions.adoc:
--------------------------------------------------------------------------------
1 |
2 | NOTE: Expressions are in the form of `${key:defaultValue}`. If the key is prefixed with `sys.` a system property is
3 | used. If the key is prefixed with `env.` an environment variable is used. In all other cases the properties are resolved
4 | from the `org.jboss.logging.tools.expressionProperties` path. If the key is not found in the properties the default
5 | value will be used.
6 |
7 | IMPORTANT: Expressions are processed at compile time. The values will be hard-coded in the generated source files.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/getting-started.adoc:
--------------------------------------------------------------------------------
1 | :repourl: https://repository.jboss.org/org/jboss/logging
2 |
3 | == Getting Started
4 |
5 | To get started you need to include three dependencies in your project.
6 |
7 | [frame=none,grid=none,options="noheader"]
8 | |===
9 | | link:{repourl}/jboss-logging/[JBoss Logging] | Required at compile time and runtime.
10 | | link:{repourl}/jboss-logging-annotations/[JBoss Logging Annotations] | Required at compile time only.
11 | | link:{repourl}/jboss-logging-processor/[JBoss Logging Processor] | Required at compile time only.
12 | |===
13 |
14 | If you're using maven here is an example `pom.xml` snippet:
15 |
16 | [source,xml,subs="attributes+"]
17 | ----
18 |
19 |
20 |
21 |
22 | org.jboss.logging
23 | jboss-logging
24 |
25 |
26 |
27 | org.jboss.logging
28 | jboss-logging-annotations
29 | {version}
30 |
32 | provided
33 | true
34 |
35 |
36 |
37 |
38 |
39 |
40 | maven-compiler-plugin
41 |
42 |
44 |
45 |
46 | org.jboss.logging
47 | jboss-logging-processor
48 | {version}
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | ----
58 |
59 | Once your project is configured you can create either a <> or a <>. For detailed information see the link:{javadocsdir}/index.html[JavaDocs] for the annotations.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/index.adoc:
--------------------------------------------------------------------------------
1 | = JBoss Logging Tools
2 | :Author: James R. Perkins
3 | :Email:
4 | :docinfo: shared
5 | :toc: left
6 | :scriptsdir: ./js
7 |
8 | == Introduction
9 |
10 | The JBoss logging tools are used to create internationalized log statements and exceptions.
11 |
12 | include::getting-started.adoc[]
13 |
14 | include::message-bundle.adoc[]
15 |
16 | include::message-logger.adoc[]
17 |
18 | include::reports.adoc[]
19 |
20 | include::examples.adoc[]
21 |
22 | include::translation-property-files.adoc[]
23 |
24 | include::processor-options.adoc[]
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/js/links.js:
--------------------------------------------------------------------------------
1 | function annotationLinks() {
2 | var links = document.getElementsByTagName("a");
3 | for(var i = 0, max = links.length; i < max; i++) {
4 | var l = links[i];
5 | if (l.text.startsWith("@")) {
6 | l.href = l.href + "/org/jboss/logging/annotations/" + l.text.substring(1) + ".html";
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/message-bundle.adoc:
--------------------------------------------------------------------------------
1 |
2 | == Message Bundle Interfaces
3 |
4 | Message bundle interfaces provide a way to internationalize exceptions or strings. A message bundle interface is
5 | annotated with link:{javadocsdir}[`@MessageBundle`]. Each method in must be annotated with link:{javadocsdir}[`@Message`]
6 | which will be used to determine the String used for either the return type or the message for the exception being
7 | returned.
8 |
9 | The value for a link:{javadocsdir}[`@Message`] may contain an expression.
10 |
11 | include::expressions.adoc[]
12 |
13 | The following constraints are placed on methods in a message bundle:
14 |
15 | - The return type must be one of the follow
16 | * A `java.lang.String`
17 | * A `java.lang.Throwable` or a subtype of `java.lang.Throwable`
18 | * A `java.lang.function.Supplier` who's return type fits one of the other two constraints above.
19 | - The method must be annotated with link:{javadocsdir}[`@Message`] or a message must be inheritable.
20 | - A method can have only one link:{javadocsdir}[`@Cause`] parameter.
21 | - A method can only have one link:{javadocsdir}[`@Producer`] parameter.
22 |
23 | include::default-notes.adoc[]
24 |
25 | === Example Message Bundle
26 |
27 | [source,java]
28 | ----
29 | @MessageBundle(projectCode = "CW") <1>
30 | public interface ErrorMessages {
31 | ErrorMessages MESSAGES = Messages.getBundle(ErrorMessages.class);
32 |
33 | @Message("Version %d.%d.%d.%s") <2>
34 | String version(int major, int minor, int macro, String rel);
35 |
36 | @Message(id = 1, value = "Value '%s' is invalid")
37 | IllegalArgumentException invalidValue(Object value);
38 |
39 | @Message(id = 2, value = "Failure closing %s") <3>
40 | CloseException closeFailure(@Cause Throwable cause, @Param @Pos(1) Closeable c);
41 |
42 | CloseException closeFailure(@Cause Throwable cause, @Param @Pos(1) Closeable c, @Suppressed Throwable... errors);
43 |
44 | @Message(id = 3, value = "Parameter %s cannot be null")
45 | Supplier nullParam(String name);
46 |
47 | @Message(id = 4, value = "Operation %s failed.")
48 | T operationFailed(@Producer Function fn, String name); <4>
49 |
50 | T operationFailed(@Producer BiFunction fn, @Cause IOException cause, String name);
51 | }
52 | ----
53 | <1> The `projectCode` will be prepended to messages which have an `id` specified. For example with `id = 1` the message will be prepended with `CW000001`. You can control the number padding with the `length` property on the annotation.
54 | <2> No `id` is specified for this message which means no id will be prepended on this message.
55 | <3> The `@Param` annotation tells the generator that the parameter should be used to construct the `CloseException`. The `@Pos(1)` annotation indicates the parameter should also be used when formatting the message.
56 | <4> The `@Producer` annotation indicates that the `Function` should be used to create the exception being returned.
57 |
58 | TIP: Message bundle interfaces can also contain valid <>.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/message-logger.adoc:
--------------------------------------------------------------------------------
1 |
2 | == Message Logger Interfaces
3 |
4 | Logger interfaces provide a way to internationalize log messages. A logger interface is an interface annotated with
5 | link:{javadocsdir}[`@MessageLogger`]. Each method in must be annotated with link:{javadocsdir}[`@Message`] which will
6 | be used to determine the message to be logged.
7 |
8 | The value for a link:{javadocsdir}[`@Message`] may contain an expression.
9 |
10 | include::expressions.adoc[]
11 |
12 | The following constraints are placed on methods in a message logger:
13 |
14 | - The method must have a `void` return type
15 | - The method must be annotated with link:{javadocsdir}[`@LogMessage`]
16 | - The method must be annotated with link:{javadocsdir}[`@Message`] or a message must be inheritable.
17 | - A method can have only one link:{javadocsdir}[`@Cause`] parameter.
18 |
19 | include::default-notes.adoc[]
20 |
21 | A message logger interface may also extend the `org.jboss.logging.BasicLogger`. This allows the logging interface to be usable for standard logging. For example `AppLogger.LOGGER.debugf("Initializing %s", this);`
22 |
23 | === Example Message Logger
24 |
25 | [source,java]
26 | ----
27 | @MessageLogger(projectCode = "CW") <1>
28 | public interface AppLogger extends BasicLogger {
29 |
30 | AppLogger LOGGER = Logger.getMessageLogger(AppLogger.class, AppLogger.class.getPackage().getName());
31 |
32 | @LogMessage
33 | @Once <2>
34 | @Message("%s version %d.%d.%d.%s") <3>
35 | void appVersion(CharSequence name, int major, int minor, int macro, String rel);
36 |
37 | @LogMessage(level = Logger.Level.ERROR) <4>
38 | @Message(id = 100, value = "Failure while closing %s")
39 | void closeFailure(@Cause Throwable cause, Object obj);
40 |
41 | @LogMessage(level = Logger.Level.WARN)
42 | @Message(id = 101, value = "Encoding %s could not be found. Defaulting to %s.")
43 | void encodingNotFound(String encoding, Charset dft);
44 |
45 | @LogMessage
46 | @Message(id = 102, value = "Cache size changed to '%d'")
47 | void cacheSizeChanged(@Transform(Transform.TransformType.SIZE) Collection c);
48 |
49 | @LogMessage
50 | void cacheSizeChanged(@Transform(Transform.TransformType.SIZE) String... array);
51 |
52 | @LogMessage
53 | void cacheSizeChanged(@Transform(Transform.TransformType.SIZE) Map map);
54 | }
55 | ----
56 | <1> The `projectCode` will be prepended to messages which have an `id` specified. For example with `id = 100` the message will be prepended with `CW000100`. You can control the number padding with the `length` property on the annotation.
57 | <2> Ensures the log message is only written once.
58 | <3> No `id` is specified for this message which means no id will be prepended on this message.
59 | <4> Overrides the default level to `ERROR` to indicate an error message should be logged.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/processor-options.adoc:
--------------------------------------------------------------------------------
1 |
2 | == Annotation Processor Options
3 |
4 | You can pass options to an annotation processor with the `-A` compiler option. For example to disable generating the `@Generated` annotation from being placed on the generated source files you would pass `-Aorg.jboss.logging.tools.addGeneratedAnnotation=false` to the compiler command.
5 |
6 | === General
7 |
8 | [frame=none,grid=none]
9 | |===
10 | | Option | Description
11 |
12 | | `debug` | This option turns on debug logging for the processor
13 | | `org.jboss.logging.tools.expressionProperties` | This option allows you to define a path where, at compile-time, expressions in messages can be resolved.
14 | | `org.jboss.logging.tools.addGeneratedAnnotation` | If set to `false` the `@Generated` annotation will not be placed on the generated source files. The default is `true`.
15 | |===
16 |
17 | NOTE: In Java 9 the `@javax.annotation.Generated` was moved to `@javax.annotation.processor.Generated`. The processor attempts to determine which annotation to use by attempting to find the `@javax.annotation.Generated` first. If it fails the `@javax.annotation.processor.Generated` is attempted. If neither can be found no annotation will be placed on the generated implementations.
18 |
19 | include::expressions.adoc[]
20 |
21 | === Translation Options
22 |
23 | [frame=none,grid=none]
24 | |===
25 | | Option | Description
26 |
27 | | `translationsFilesPath` | The base path for the translated properties files. This defaults to the location where new class files are placed.
28 | | `skipTranslations` | If set to `true` source files with the translated tet will not be generated. The default is `false`.
29 | | `generatedTranslationFilesPath` | If defined this indicates the path a skeleton file should be generated for the interface. The generated skeleton file will be placed in a directory that matches the package with a name that matches the interface with a `.i18n_locale_COUNTRY_VARIANT.properties` suffix.
30 | | `org.jboss.logging.tools.level` | Sets the maximum level to include in the generated skeleton files. For example if set to `INFO` the skeleton files will not contain any properties where the log level was set to `DEBUG` or `TRACE`.
31 | | `org.jboss.logging.tools.generated.skip.index` | By default when generating a skeleton translation file an index will be appended to the format pattern. For example `Example %s and %d` becomes `Example %1$s and %2$d`. This option allows this behavior to be disabled.
32 |
33 | |===
34 |
35 | === Report Options
36 |
37 | [frame=none,grid=none]
38 | |===
39 | | Option | Description
40 |
41 | | `org.jboss.logging.tools.report.type` | Indicates the type of report that should be generated. The current report types are `adoc` for asciidoc or `xml` for XML.
42 | | `org.jboss.logging.tools.report.path` | The path where the generated reports should be placed. This defaults to the location where new class files are placed.
43 | | `org.jboss.logging.tools.report.title` | An optional title for the report. For asciidoc this defaults to `Messages`. For XML the `` element is left off.
44 |
45 | |===
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/reports.adoc:
--------------------------------------------------------------------------------
1 |
2 | == Reports
3 |
4 | There are currently two types of reports that can be generated. The options are `adoc` or `asciidoc` for asciidoc and `xml` for XML.
5 |
6 | The reports contain the following data:
7 |
8 | * The formatted message id.
9 | * A possible link to a resolution document for the error.
10 | * The unformatted message.
11 | * The log level, if applicable.
12 | * The return type, if applicable.
13 |
14 | === Annotations
15 |
16 | Two annotations can be used to assist withing linking resolution documents for messages.
17 |
18 | * link:{javadocsdir}[`@BaseUrl`]
19 | - This annotation can be used on a type to define the base URL for linking resolution documents. This annotation is
20 | not required for links to be created on reports.
21 | * link:{javadocsdir}[`@ResolutionDoc`]
22 | - This annotation is used to define information about the resolution document for creating links. If placed on an
23 | interface all methods that have a defined id will have a link generated. This can also be placed individually on
24 | the method to only generate links for specific id's.
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/translation-property-files.adoc:
--------------------------------------------------------------------------------
1 |
2 | == Translation Property Files
3 |
4 | The translation properties files must exist in the same directory structure as the interface. The name of the properties file `InterfaceName.i18n_language_country_variant.properties`. For example if you have a class named `org.jboss.logging.tools.examples.ErrorMessages` and you want to translate this into French you create a properties file called `ErrorMessages.i18n_fr.properties` in a directory `org/jboss/logging/tools/examples`.
--------------------------------------------------------------------------------
/docs/src/main/java/org/jboss/logging/tools/examples/CloseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2017 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.tools.examples;
21 |
22 | import java.io.Closeable;
23 |
24 | /**
25 | * An error with access to the failing {@link Closeable}.
26 | *
27 | * @author James R. Perkins
28 | */
29 | @SuppressWarnings("unused")
30 | public class CloseException extends RuntimeException {
31 | private final Closeable closeable;
32 |
33 | /**
34 | * Creates a new error.
35 | *
36 | * @param msg the message for the error
37 | * @param closeable the failed closeable
38 | */
39 | public CloseException(final String msg, final Closeable closeable) {
40 | super(msg);
41 | this.closeable = closeable;
42 | }
43 |
44 | /**
45 | * Creates a new error.
46 | *
47 | * @param msg the message for the error
48 | * @param cause the cause of the error
49 | * @param closeable the failed closeable
50 | */
51 | public CloseException(final String msg, final Throwable cause, final Closeable closeable) {
52 | super(msg, cause);
53 | this.closeable = closeable;
54 | }
55 |
56 | /**
57 | * Returns the failed closeable.
58 | *
59 | * @return the failed closeable
60 | */
61 | public Closeable getCloseable() {
62 | return closeable;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/apt/AbstractClassType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.apt;
21 |
22 | import javax.annotation.processing.ProcessingEnvironment;
23 | import javax.lang.model.element.Element;
24 | import javax.lang.model.type.TypeMirror;
25 | import javax.lang.model.util.Elements;
26 | import javax.lang.model.util.Types;
27 |
28 | import org.jboss.logging.processor.model.ClassType;
29 | import org.jboss.logging.processor.util.ElementHelper;
30 |
31 | /**
32 | * @author James R. Perkins
33 | */
34 | abstract class AbstractClassType implements ClassType {
35 | protected final ProcessingEnvironment processingEnv;
36 | protected final Elements elements;
37 | protected final Types types;
38 | protected final TypeMirror typeMirror;
39 |
40 | AbstractClassType(final ProcessingEnvironment processingEnv, final TypeMirror typeMirror) {
41 | this.processingEnv = processingEnv;
42 | this.elements = processingEnv.getElementUtils();
43 | this.types = processingEnv.getTypeUtils();
44 | this.typeMirror = typeMirror;
45 | }
46 |
47 | AbstractClassType(final ProcessingEnvironment processingEnv, final Element element) {
48 | this.processingEnv = processingEnv;
49 | this.elements = processingEnv.getElementUtils();
50 | this.types = processingEnv.getTypeUtils();
51 | this.typeMirror = element.asType();
52 | }
53 |
54 | @Override
55 | public final boolean isAssignableFrom(final Class> type) {
56 | return types.isAssignable(types.erasure(toType(type)), types.erasure(this.typeMirror));
57 | }
58 |
59 | @Override
60 | public final boolean isSubtypeOf(final Class> type) {
61 | return types.isSubtype(types.erasure(this.typeMirror), toType(type));
62 | }
63 |
64 | @Override
65 | public final boolean isSameAs(final Class> type) {
66 | return types.isSameType(types.erasure(this.typeMirror), toType(type));
67 | }
68 |
69 | /**
70 | * Creates a {@link TypeMirror} from a class type.
71 | *
72 | * @param type the type to create the {@link TypeMirror} for
73 | *
74 | * @return the {@code TypeMirror} to represent the type
75 | */
76 | private TypeMirror toType(final Class> type) {
77 | return types.erasure(ElementHelper.toType(elements, type));
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/apt/AbstractGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 | package org.jboss.logging.processor.apt;
20 |
21 | import java.util.Arrays;
22 | import java.util.Collections;
23 | import java.util.HashSet;
24 | import java.util.Set;
25 |
26 | import javax.annotation.processing.ProcessingEnvironment;
27 | import javax.annotation.processing.SupportedOptions;
28 | import javax.lang.model.element.TypeElement;
29 |
30 | import org.jboss.logging.processor.model.MessageInterface;
31 |
32 | /**
33 | * An abstract processor used process annotations.
34 | *
35 | * @author James R. Perkins
36 | * @author Kevin Pollet - SERLI - (kevin.pollet@serli.com)
37 | */
38 | public abstract class AbstractGenerator {
39 |
40 | private final ToolLogger logger;
41 |
42 | final ProcessingEnvironment processingEnv;
43 |
44 | /**
45 | * Constructs a new processor.
46 | *
47 | * @param processingEnv the processing environment.
48 | */
49 | AbstractGenerator(final ProcessingEnvironment processingEnv) {
50 | this.logger = ToolLogger.getLogger(processingEnv);
51 | this.processingEnv = processingEnv;
52 | }
53 |
54 | /**
55 | * Processes a type element.
56 | *
57 | * @param annotation the annotation who trigger the processing
58 | * @param element the element that contains the methods.
59 | * @param messageInterface the message interface to implement.
60 | */
61 | public abstract void processTypeElement(final TypeElement annotation, final TypeElement element,
62 | final MessageInterface messageInterface);
63 |
64 | /**
65 | * Returns the logger to log messages with.
66 | *
67 | * @return the logger to log messages with.
68 | */
69 | final ToolLogger logger() {
70 | return logger;
71 | }
72 |
73 | /**
74 | * Returns the name of the processor.
75 | *
76 | * @return the name of the processor.
77 | */
78 | public final String getName() {
79 | return this.getClass().getSimpleName();
80 | }
81 |
82 | /**
83 | * Returns the supported options set.
84 | *
85 | * @return the supported options set or empty set if none
86 | */
87 | public final Set getSupportedOptions() {
88 | SupportedOptions options = this.getClass().getAnnotation(SupportedOptions.class);
89 | if (options != null) {
90 | return new HashSet<>(Arrays.asList(options.value()));
91 | }
92 |
93 | return Collections.emptySet();
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/apt/ImplementationClassGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.apt;
21 |
22 | import java.io.IOException;
23 | import java.util.Map;
24 |
25 | import javax.annotation.processing.ProcessingEnvironment;
26 | import javax.lang.model.element.TypeElement;
27 |
28 | import org.jboss.logging.processor.generator.model.ClassModel;
29 | import org.jboss.logging.processor.generator.model.ClassModelFactory;
30 | import org.jboss.logging.processor.model.MessageInterface;
31 |
32 | /**
33 | * A generator for creating implementations of message bundle and logging
34 | * interfaces.
35 | *
36 | * @author James R. Perkins
37 | */
38 | final class ImplementationClassGenerator extends AbstractGenerator {
39 |
40 | private static final String LOGGING_VERSION = "loggingVersion";
41 |
42 | /**
43 | * @param processingEnv the processing environment.
44 | */
45 | public ImplementationClassGenerator(ProcessingEnvironment processingEnv) {
46 | super(processingEnv);
47 | final Map options = processingEnv.getOptions();
48 | if (options.containsKey(LOGGING_VERSION)) {
49 | logger().warn(null, "The option %s has been deprecated and is no longer used.", LOGGING_VERSION);
50 | }
51 | }
52 |
53 | @Override
54 | public void processTypeElement(final TypeElement annotation, final TypeElement element,
55 | final MessageInterface messageInterface) {
56 | try {
57 | final ClassModel classModel = ClassModelFactory.implementation(processingEnv, messageInterface);
58 | classModel.generateAndWrite();
59 | } catch (IllegalStateException | IOException e) {
60 | logger().error(element, e);
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/apt/report/ReportType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.apt.report;
21 |
22 | /**
23 | * Defines the report type for generating reports.
24 | *
25 | * @author James R. Perkins
26 | */
27 | public enum ReportType {
28 | ASCIIDOC(".adoc"),
29 | XML(".xml");
30 |
31 | private final String extension;
32 |
33 | ReportType(final String extension) {
34 | this.extension = extension;
35 | }
36 |
37 | /**
38 | * Returns the extension used for the file.
39 | *
40 | * @return the extension
41 | */
42 | public String getExtension() {
43 | return extension;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/generator/model/MessageBundleImplementor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generator.model;
21 |
22 | import java.util.LinkedHashSet;
23 | import java.util.Set;
24 |
25 | import javax.annotation.processing.ProcessingEnvironment;
26 |
27 | import org.jboss.jdeparser.JCall;
28 | import org.jboss.jdeparser.JClassDef;
29 | import org.jboss.jdeparser.JMod;
30 | import org.jboss.logging.annotations.MessageBundle;
31 | import org.jboss.logging.annotations.MessageLogger;
32 | import org.jboss.logging.processor.model.MessageInterface;
33 | import org.jboss.logging.processor.model.MessageMethod;
34 |
35 | /**
36 | * Used to generate a message bundle implementation.
37 | *
38 | * Creates an implementation of the interface passed in.
39 | *
40 | *
41 | * @author James R. Perkins
42 | * @author Kevin Pollet - SERLI - (kevin.pollet@serli.com)
43 | */
44 | class MessageBundleImplementor extends ImplementationClassModel {
45 |
46 | /**
47 | * Creates a new message bundle code model.
48 | *
49 | * @param processingEnv the processing environment
50 | * @param messageInterface the message interface to implement.
51 | */
52 | public MessageBundleImplementor(final ProcessingEnvironment processingEnv, final MessageInterface messageInterface) {
53 | super(processingEnv, messageInterface);
54 | }
55 |
56 | @Override
57 | protected JClassDef generateModel() throws IllegalStateException {
58 | final JClassDef classDef = super.generateModel();
59 | // Add default constructor
60 | classDef.constructor(JMod.PROTECTED);
61 | createReadResolveMethod();
62 | final JCall localeGetter = createLocaleGetter(null, false);
63 | final Set messageMethods = new LinkedHashSet<>();
64 | messageMethods.addAll(messageInterface().methods());
65 | for (MessageInterface messageInterface : messageInterface().extendedInterfaces()) {
66 | if (messageInterface.isAnnotatedWith(MessageBundle.class)
67 | || messageInterface.isAnnotatedWith(MessageLogger.class)) {
68 | messageMethods.addAll(messageInterface.methods());
69 | }
70 | }
71 | // Process the method descriptors and add to the model before
72 | // writing.
73 | for (MessageMethod messageMethod : messageMethods) {
74 | createBundleMethod(classDef, localeGetter, messageMethod);
75 | }
76 | return classDef;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/ClassType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | import javax.lang.model.AnnotatedConstruct;
23 |
24 | /**
25 | * Date: 23.08.2011
26 | *
27 | * @author James R. Perkins
28 | */
29 | public interface ClassType extends AnnotatedConstruct {
30 |
31 | /**
32 | * Determines if this type is either the same as, or is a supertype of, the class represented by the {@code type}
33 | * parameter. If this type is assignable from the class {@code true} is returned, otherwise {@code false}.
34 | *
35 | * @param type the class type to check.
36 | *
37 | * @return {@code true} if this type is the same as or a superclass of the class, otherwise {@code false}.
38 | */
39 | boolean isAssignableFrom(Class> type);
40 |
41 | /**
42 | * Determines if this type is a subtype of the class represented by the {@code type} parameter. If this type is a
43 | * subtype of the class {@code true} is returned, otherwise {@code false}.
44 | *
45 | * @param type the class type to check.
46 | *
47 | * @return {@code true} if this type is a subtype of the class, otherwise {@code false}.
48 | */
49 | boolean isSubtypeOf(Class> type);
50 |
51 | /**
52 | * Determines if this type is the same type as the class represented by the {@code type} parameter. If this type is
53 | * the same type as the class {@code true} is returned, otherwise {@code false}.
54 | *
55 | * @param type the class type to check.
56 | *
57 | * @return {@code true} if this type is the same type as the class, otherwise {@code false}.
58 | */
59 | boolean isSameAs(Class> type);
60 | }
61 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/DelegatingExecutableElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | import java.util.List;
23 |
24 | import javax.lang.model.element.AnnotationValue;
25 | import javax.lang.model.element.ExecutableElement;
26 | import javax.lang.model.element.Name;
27 | import javax.lang.model.element.TypeParameterElement;
28 | import javax.lang.model.element.VariableElement;
29 | import javax.lang.model.type.TypeMirror;
30 |
31 | /**
32 | * A delegating {@link ExecutableElement} interface. All methods are invoked on the {@linkplain #getDelegate() delegate element}
33 | * by default.
34 | *
35 | * @author James R. Perkins
36 | */
37 | public interface DelegatingExecutableElement extends ExecutableElement, DelegatingElement {
38 |
39 | @Override
40 | ExecutableElement getDelegate();
41 |
42 | @Override
43 | default TypeMirror asType() {
44 | return getDelegate().asType();
45 | }
46 |
47 | @Override
48 | default List extends TypeParameterElement> getTypeParameters() {
49 | return getDelegate().getTypeParameters();
50 | }
51 |
52 | @Override
53 | default TypeMirror getReturnType() {
54 | return getDelegate().getReturnType();
55 | }
56 |
57 | @Override
58 | default List extends VariableElement> getParameters() {
59 | return getDelegate().getParameters();
60 | }
61 |
62 | @Override
63 | default TypeMirror getReceiverType() {
64 | return getDelegate().getReceiverType();
65 | }
66 |
67 | @Override
68 | default boolean isVarArgs() {
69 | return getDelegate().isVarArgs();
70 | }
71 |
72 | @Override
73 | default boolean isDefault() {
74 | return getDelegate().isDefault();
75 | }
76 |
77 | @Override
78 | default List extends TypeMirror> getThrownTypes() {
79 | return getDelegate().getThrownTypes();
80 | }
81 |
82 | @Override
83 | default AnnotationValue getDefaultValue() {
84 | return getDelegate().getDefaultValue();
85 | }
86 |
87 | @Override
88 | default Name getSimpleName() {
89 | return getDelegate().getSimpleName();
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/DelegatingTypeElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | import java.util.List;
23 |
24 | import javax.lang.model.element.Element;
25 | import javax.lang.model.element.Name;
26 | import javax.lang.model.element.NestingKind;
27 | import javax.lang.model.element.TypeElement;
28 | import javax.lang.model.element.TypeParameterElement;
29 | import javax.lang.model.type.TypeMirror;
30 |
31 | /**
32 | * A delegating {@link TypeElement} interface. All methods are invoked on the {@linkplain #getDelegate() delegate element}
33 | * by default.
34 | *
35 | * @author James R. Perkins
36 | */
37 | public interface DelegatingTypeElement extends TypeElement, DelegatingElement {
38 |
39 | @Override
40 | TypeElement getDelegate();
41 |
42 | @Override
43 | default TypeMirror asType() {
44 | return getDelegate().asType();
45 | }
46 |
47 | @Override
48 | default List extends Element> getEnclosedElements() {
49 | return getDelegate().getEnclosedElements();
50 | }
51 |
52 | @Override
53 | default NestingKind getNestingKind() {
54 | return getDelegate().getNestingKind();
55 | }
56 |
57 | @Override
58 | default Name getQualifiedName() {
59 | return getDelegate().getQualifiedName();
60 | }
61 |
62 | @Override
63 | default Name getSimpleName() {
64 | return getDelegate().getSimpleName();
65 | }
66 |
67 | @Override
68 | default TypeMirror getSuperclass() {
69 | return getDelegate().getSuperclass();
70 | }
71 |
72 | @Override
73 | default List extends TypeMirror> getInterfaces() {
74 | return getDelegate().getInterfaces();
75 | }
76 |
77 | @Override
78 | default List extends TypeParameterElement> getTypeParameters() {
79 | return getDelegate().getTypeParameters();
80 | }
81 |
82 | @Override
83 | default Element getEnclosingElement() {
84 | return getDelegate().getEnclosingElement();
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/JavaDocComment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | /**
23 | * Represents the {@code JavaDoc's} documentation.
24 | *
25 | * @author James R. Perkins
26 | */
27 | public interface JavaDocComment {
28 |
29 | /**
30 | * The JavaDoc comments if available or {@code null} if there are no JavaDoc's present.
31 | *
32 | * @return the JavaDoc comments or {@code null}.
33 | */
34 | String getComment();
35 | }
36 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/LoggerMessageMethod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | import org.jboss.logging.Logger;
23 | import org.jboss.logging.annotations.Transform;
24 |
25 | /**
26 | * Represents a method which is annotated with {@link org.jboss.logging.annotations.LogMessage}.
27 | *
28 | * @author James R. Perkins
29 | */
30 | public interface LoggerMessageMethod extends MessageMethod {
31 |
32 | /**
33 | * Returns the log method to use.
34 | *
35 | * @return the log method to use
36 | */
37 | String loggerMethod();
38 |
39 | /**
40 | * Returns the log level parameter associated with the method.
41 | *
42 | * @return the enum name of the {@linkplain org.jboss.logging.Logger.Level log level}
43 | */
44 | String logLevel();
45 |
46 | /**
47 | * Indicates whether or not the {@linkplain org.jboss.logging.Logger#isEnabled(Logger.Level) level} should be
48 | * checked before any logging, or an expensive operation, is done.
49 | *
50 | * @return {@code true} if the statement should be wrapped in an {@code if (logger.isEnabled(level))} block,
51 | * otherwise {@code false}
52 | */
53 | default boolean wrapInEnabledCheck() {
54 | return !parametersAnnotatedWith(Transform.class).isEmpty();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/Parameter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | /**
23 | * @author James R. Perkins - 20.Feb.2011
24 | */
25 | public interface Parameter extends Comparable, ClassType, DelegatingElement {
26 |
27 | /**
28 | * The variable name of the parameter.
29 | *
30 | * @return the variable name of the parameter.
31 | */
32 | String name();
33 |
34 | /**
35 | * Returns {@code true} if the type is an array, otherwise {@code false}.
36 | *
37 | * @return {@code true} if an array, otherwise {@code false}
38 | */
39 | boolean isArray();
40 |
41 | /**
42 | * Returns {@code true} if the type is a primitive type, otherwise {@code false}.
43 | *
44 | * @return {@code true} if primitive type, otherwise {@code false}
45 | */
46 | boolean isPrimitive();
47 |
48 | /**
49 | * Returns {@code true} if the parameter is a var args parameter, otherwise {@code false}.
50 | *
51 | * @return {@code true} if var args parameter, otherwise {@code false}.
52 | */
53 | boolean isVarArgs();
54 |
55 | /**
56 | * Indicates whether or not the parameter is used a format parameter for the message.
57 | *
58 | * @return {@code true} if this parameter that should used as a format parameter for the message
59 | */
60 | default boolean isFormatParameter() {
61 | return true;
62 | }
63 |
64 | /**
65 | * Indicates whether or not this parameter represents the message method.
66 | *
67 | * @return {@code true} if this is the message method parameter
68 | */
69 | default boolean isMessageMethod() {
70 | return false;
71 | }
72 |
73 | /**
74 | * The formatter class, or {@code null} if there is none.
75 | *
76 | * @return the formatter class
77 | */
78 | String formatterClass();
79 |
80 | /**
81 | * Returns the name of the target field or method. For example if the parameter is annotated with
82 | * {@link org.jboss.logging.annotations.Field @Field} the target name is the name of the field to set on the
83 | * {@link org.jboss.logging.processor.model.ReturnType return type}. If no target name is defined an empty String
84 | * is returned.
85 | *
86 | * @return the target field name, method name or an empty string.
87 | */
88 | String targetName();
89 | }
90 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/model/ReturnType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.model;
21 |
22 | import java.util.List;
23 |
24 | import javax.lang.model.type.DeclaredType;
25 | import javax.lang.model.type.TypeMirror;
26 |
27 | import org.jboss.logging.processor.util.ElementHelper;
28 |
29 | /**
30 | * Date: 29.07.2011
31 | *
32 | * @author James R. Perkins
33 | */
34 | public interface ReturnType extends ClassType, DelegatingElement {
35 |
36 | /**
37 | * Checks to see if the return type is an exception, extends Throwable or the value of a
38 | * {@link java.util.function.Supplier} is a Throwable type.
39 | *
40 | * @return {@code true} if the return type is an exception, otherwise {@code false}.
41 | *
42 | * @see #resolvedType()
43 | */
44 | boolean isThrowable();
45 |
46 | /**
47 | * Returns the qualified class name of the return type.
48 | *
49 | * @return the qualified class name fo the return type.
50 | */
51 | String name();
52 |
53 | /**
54 | * Returns the exception return type if {@link #isThrowable()} returns {@code true}. Otherwise {@code null} is
55 | * returned.
56 | *
57 | * @return an exception return type, otherwise {@code null}.
58 | */
59 | ThrowableType throwableReturnType();
60 |
61 | /**
62 | * Checks this {@linkplain #asType() type} to see if there are any
63 | * {@linkplain DeclaredType#getTypeArguments() type arguments}. If any type arguments are found the first type is
64 | * returned and assumed to be the resolved type. Otherwise this {@linkplain #asType() type} is returned.
65 | *
66 | * This is useful for the {@link java.util.function.Supplier Supplier} return type.
67 | *
68 | *
69 | * @return the resolved return type
70 | */
71 | default TypeMirror resolvedType() {
72 | final TypeMirror type = asType();
73 | final List extends TypeMirror> typeArgs = ElementHelper.getTypeArguments(type);
74 | if (typeArgs.isEmpty()) {
75 | return type;
76 | }
77 | // Assume the first type only
78 | return typeArgs.get(0);
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/AbstractFormatPart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | import org.jboss.logging.processor.util.Comparison;
23 |
24 | /**
25 | * Abstract class that only implements Comparable for convenience. Uses the
26 | * {@link org.jboss.logging.processor.validation.FormatPart#position()} for
27 | * the comparison.
28 | *
29 | * Date: 13.06.2011
30 | *
31 | * @author James R. Perkins
32 | */
33 | abstract class AbstractFormatPart implements FormatPart {
34 |
35 | @Override
36 | public int compareTo(final FormatPart other) {
37 | return Comparison.begin().compare(position(), other.position()).result();
38 | }
39 |
40 | @Override
41 | public String toString() {
42 | return new StringBuilder(getClass().getSimpleName()).append("[")
43 | .append("index=")
44 | .append(index())
45 | .append(", position=")
46 | .append(position())
47 | .append(", part=")
48 | .append(part())
49 | .toString();
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/AbstractFormatValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | /**
23 | * Date: 12.08.2011
24 | *
25 | * @author James R. Perkins
26 | */
27 | abstract class AbstractFormatValidator implements FormatValidator {
28 | private String summaryMessage;
29 | private String detailMessage;
30 |
31 | AbstractFormatValidator() {
32 | detailMessage = "";
33 | summaryMessage = "";
34 | }
35 |
36 | final void setDetailMessage(final String detailMessage) {
37 | this.detailMessage = detailMessage;
38 | }
39 |
40 | final void setDetailMessage(final String format, final Object... args) {
41 | this.detailMessage = String.format(format, args);
42 | }
43 |
44 | final void setSummaryMessage(final String summaryMessage) {
45 | this.summaryMessage = summaryMessage;
46 | }
47 |
48 | final void setSummaryMessage(final String format, final Object... args) {
49 | this.summaryMessage = String.format(format, args);
50 | }
51 |
52 | @Override
53 | public final String detailMessage() {
54 | return (detailMessage.isEmpty() ? summaryMessage : detailMessage);
55 | }
56 |
57 | @Override
58 | public final String summaryMessage() {
59 | return summaryMessage;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/FormatPart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | /**
23 | * Date: 13.06.2011
24 | *
25 | * @author James R. Perkins
26 | */
27 | interface FormatPart extends Comparable {
28 |
29 | /**
30 | * The default string index.
31 | */
32 | int STRING = -2;
33 |
34 | /**
35 | * The parameter index. For default strings (non-parameters) the value is {@code -2}.
36 | *
37 | * @return the index.
38 | */
39 | int index();
40 |
41 | /**
42 | * The position for the part.
43 | *
44 | * @return the position.
45 | */
46 | int position();
47 |
48 | /**
49 | * The part of the format.
50 | *
51 | * @return the part of the format.
52 | */
53 | String part();
54 | }
55 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/FormatValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | /**
23 | * Date: 14.06.2011
24 | *
25 | * @author James R. Perkins
26 | */
27 | public interface FormatValidator {
28 |
29 | /**
30 | * The number of arguments needed for the format.
31 | *
32 | * @return the number of arguments needed.
33 | */
34 | int argumentCount();
35 |
36 | /**
37 | * Returns the format string used for validation.
38 | *
39 | * @return the format string.
40 | */
41 | String format();
42 |
43 | /**
44 | * Returns {@code true} of the format is valid, otherwise {@code false}.
45 | *
46 | * @return {@code true} of the format is valid, otherwise {@code false}.
47 | */
48 | boolean isValid();
49 |
50 | /**
51 | * A detail message if {@link #isValid()} returns {@code false}, otherwise an empty string.
52 | *
53 | * @return a detailed message.
54 | */
55 | String detailMessage();
56 |
57 | /**
58 | * A summary message if {@link #isValid()} returns {@code false}, otherwise an empty string.
59 | *
60 | * @return a summary message.
61 | */
62 | String summaryMessage();
63 | }
64 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/IdLengthValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | import static org.jboss.logging.processor.validation.ValidationMessageFactory.createError;
23 |
24 | import java.util.Collection;
25 | import java.util.HashMap;
26 | import java.util.LinkedList;
27 | import java.util.List;
28 | import java.util.Map;
29 |
30 | import org.jboss.logging.processor.model.MessageInterface;
31 |
32 | /**
33 | * @author James R. Perkins
34 | */
35 | public class IdLengthValidator {
36 | private final Map lengths = new HashMap<>();
37 |
38 | public Collection validate(final MessageInterface messageInterface) {
39 | final List messages = new LinkedList<>();
40 | final String projectCode = messageInterface.projectCode();
41 | final int idLength = messageInterface.getIdLength();
42 | if ((idLength > 0 && idLength < 3) || idLength > 8) {
43 | messages.add(createError(messageInterface,
44 | "The length of the message id padding must be between 3 and 8. The value %d is invalid.", idLength));
45 | } else {
46 | synchronized (this) {
47 | // Check the length id's
48 | if (lengths.containsKey(projectCode)) {
49 | final int len = lengths.get(projectCode);
50 | if (len != idLength) {
51 | messages.add(createError(messageInterface, "A length of %d was already used for project code '%s'.",
52 | len, projectCode));
53 | }
54 | } else {
55 | lengths.put(projectCode, idLength);
56 | }
57 | }
58 | }
59 | return messages;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/NoFormatValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | /**
23 | * @author James R. Perkins
24 | */
25 | final class NoFormatValidator extends AbstractFormatValidator {
26 | static final NoFormatValidator INSTANCE = new NoFormatValidator();
27 |
28 | @Override
29 | public int argumentCount() {
30 | return 0;
31 | }
32 |
33 | @Override
34 | public String format() {
35 | return "none";
36 | }
37 |
38 | @Override
39 | public boolean isValid() {
40 | return true;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/processor/src/main/java/org/jboss/logging/processor/validation/StringPart.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | /**
23 | * Represents the string portions of a format string.
24 | *
25 | * Date: 13.06.2011
26 | *
27 | * @author James R. Perkins
28 | */
29 | class StringPart extends AbstractFormatPart {
30 |
31 | private final int position;
32 | private final String part;
33 |
34 | /**
35 | * Creates a new string part.
36 | *
37 | * @param position the position.
38 | * @param part the string.
39 | */
40 | public StringPart(final int position, final String part) {
41 | this.position = position;
42 | this.part = part;
43 | }
44 |
45 | /**
46 | * Creates a new string part.
47 | *
48 | * @param position the position.
49 | * @param part the string.
50 | *
51 | * @return the string part.
52 | */
53 | public static StringPart of(final int position, final String part) {
54 | return new StringPart(position, part);
55 | }
56 |
57 | @Override
58 | public int index() {
59 | return STRING;
60 | }
61 |
62 | @Override
63 | public int position() {
64 | return position;
65 | }
66 |
67 | @Override
68 | public String part() {
69 | return part;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/processor/src/main/resources/META-INF/gradle/incremental.annotation.processors:
--------------------------------------------------------------------------------
1 | org.jboss.logging.processor.apt.LoggingToolsProcessor,isolating
2 |
--------------------------------------------------------------------------------
/processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor:
--------------------------------------------------------------------------------
1 | org.jboss.logging.processor.apt.LoggingToolsProcessor
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/DefaultMessages.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated;
21 |
22 | import org.jboss.logging.annotations.Message;
23 | import org.jboss.logging.annotations.MessageBundle;
24 | import org.jboss.logging.annotations.ValidIdRange;
25 |
26 | /**
27 | * @author James R. Perkins Jr. (jrp)
28 | */
29 | @MessageBundle(projectCode = TestConstants.PROJECT_CODE)
30 | @ValidIdRange(min = 10000, max = 10050)
31 | public interface DefaultMessages {
32 |
33 | @Message(id = 10000, value = "Hello %s.")
34 | String hello(String name);
35 |
36 | @Message(id = 10001, value = "How are you %s?")
37 | String howAreYou(String name);
38 |
39 | @SuppressWarnings("unused")
40 | @Message(id = 10002, value = "Username %s is invalid.")
41 | RuntimeException invalidUser(String name);
42 | }
43 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/ExpressionLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated;
21 |
22 | import org.jboss.logging.Logger;
23 | import org.jboss.logging.Logger.Level;
24 | import org.jboss.logging.annotations.LogMessage;
25 | import org.jboss.logging.annotations.Message;
26 | import org.jboss.logging.annotations.MessageLogger;
27 |
28 | /**
29 | * @author James R. Perkins
30 | */
31 | @MessageLogger(projectCode = TestConstants.PROJECT_CODE)
32 | public interface ExpressionLogger {
33 |
34 | ExpressionLogger LOGGER = Logger.getMessageLogger(ExpressionLogger.class, TestConstants.CATEGORY);
35 |
36 | @LogMessage(level = Level.INFO)
37 | @Message(value = "${test.property}")
38 | void logProperty();
39 |
40 | @LogMessage(level = Level.INFO)
41 | @Message(value = "${test.property.nonexistent:default value}")
42 | void logPropertyDefault();
43 |
44 | @Message(value = "${test.property}")
45 | String property();
46 |
47 | @Message(value = "${test.property.nonexistent:default value}")
48 | String propertyDefault();
49 | }
50 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/ExtendedLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated;
21 |
22 | import org.jboss.logging.Logger.Level;
23 | import org.jboss.logging.annotations.LogMessage;
24 | import org.jboss.logging.annotations.Message;
25 | import org.jboss.logging.annotations.MessageLogger;
26 | import org.jboss.logging.annotations.ValidIdRange;
27 |
28 | /**
29 | * @author James R. Perkins
30 | */
31 | @SuppressWarnings("unused")
32 | @ValidIdRange(min = 1000, max = 1500)
33 | @MessageLogger(projectCode = TestConstants.PROJECT_CODE)
34 | public interface ExtendedLogger extends DefaultLogger {
35 |
36 | @LogMessage(level = Level.ERROR)
37 | @Message(id = 1000, value = "Extension error")
38 | void extensionError();
39 | }
40 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/LogOnceLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated;
21 |
22 | import java.lang.reflect.Member;
23 | import java.util.Collection;
24 | import java.util.Map;
25 |
26 | import org.jboss.logging.Logger;
27 | import org.jboss.logging.Logger.Level;
28 | import org.jboss.logging.annotations.LogMessage;
29 | import org.jboss.logging.annotations.Message;
30 | import org.jboss.logging.annotations.MessageLogger;
31 | import org.jboss.logging.annotations.Once;
32 | import org.jboss.logging.annotations.Transform;
33 | import org.jboss.logging.annotations.Transform.TransformType;
34 |
35 | /**
36 | * @author James R. Perkins
37 | */
38 | @MessageLogger(projectCode = TestConstants.PROJECT_CODE)
39 | public interface LogOnceLogger {
40 |
41 | LogOnceLogger LOGGER = Logger.getMessageLogger(LogOnceLogger.class, LogOnceLogger.class.getName());
42 |
43 | @LogMessage(level = Level.WARN)
44 | @Once
45 | @Message("'%s' has been deprecated.")
46 | void deprecated(String key);
47 |
48 | @LogMessage(level = Level.WARN, useThreadContext = true)
49 | @Once
50 | @Message("'%s' has been deprecated. Please use '%s'.")
51 | void deprecated(String key, String replacement);
52 |
53 | @LogMessage
54 | void deprecated(Member member);
55 |
56 | @LogMessage
57 | @Once
58 | @Message("Cache size changed to '%d'")
59 | void cacheSizeChanged(@Transform(TransformType.SIZE) Collection c);
60 |
61 | @LogMessage
62 | void cacheSizeChanged(@Transform(TransformType.SIZE) String... array);
63 |
64 | @LogMessage
65 | @Once
66 | void cacheSizeChanged(@Transform(TransformType.SIZE) Map map);
67 | }
68 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/RootLocaleLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated;
21 |
22 | import org.jboss.logging.Logger.Level;
23 | import org.jboss.logging.annotations.LogMessage;
24 | import org.jboss.logging.annotations.Message;
25 | import org.jboss.logging.annotations.MessageLogger;
26 |
27 | /**
28 | * @author James R. Perkins
29 | */
30 | @SuppressWarnings("unused")
31 | @MessageLogger(projectCode = "LOCALE", rootLocale = "en-UK")
32 | public interface RootLocaleLogger {
33 |
34 | @LogMessage(level = Level.INFO)
35 | @Message(id = 10, value = "Initialised %s")
36 | void init(Object object);
37 |
38 | @LogMessage(level = Level.ERROR)
39 | @Message(id = 20, value = "Initialisation failed, behaviour may be unpredictable.")
40 | void initFailed();
41 |
42 | @Message(id = 50, value = "Authorisation failed for %s")
43 | RuntimeException authFailed(String user);
44 | }
45 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/StringFormatLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated;
21 |
22 | import java.util.Date;
23 |
24 | import org.jboss.logging.Logger.Level;
25 | import org.jboss.logging.annotations.LogMessage;
26 | import org.jboss.logging.annotations.Message;
27 | import org.jboss.logging.annotations.MessageLogger;
28 |
29 | /**
30 | * @author James R. Perkins
31 | */
32 | @MessageLogger(projectCode = "TEST")
33 | public interface StringFormatLogger {
34 |
35 | @LogMessage(level = Level.INFO)
36 | @Message("String %s integer %d")
37 | void stringInt(String s, int i);
38 |
39 | @LogMessage(level = Level.INFO)
40 | @Message("String %s integer %d")
41 | void stringIntFailure(String s, int i);
42 |
43 | @LogMessage(level = Level.INFO)
44 | @Message("Duke's Birthday: %1$tm %James R. Perkins
30 | */
31 | @MessageBundle(projectCode = "TEST")
32 | public interface StringFormatMessages {
33 |
34 | StringFormatMessages MESSAGES = Messages.getBundle(StringFormatMessages.class);
35 |
36 | @Message("String %s integer %d")
37 | String stringInt(String s, int i);
38 |
39 | @Message("Duke's Birthday: %1$tm %James R. Perkins
24 | */
25 | public class TestConstants {
26 | public static final String PROJECT_CODE = "LOGL";
27 | public static final String CATEGORY = TestConstants.class.getPackage().getName();
28 | }
29 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/tests/AbstractLoggerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated.tests;
21 |
22 | import java.util.regex.Matcher;
23 | import java.util.regex.Pattern;
24 |
25 | import org.jboss.logging.processor.generated.TestConstants;
26 | import org.junit.jupiter.api.AfterAll;
27 | import org.junit.jupiter.api.BeforeAll;
28 |
29 | /**
30 | * @author James R. Perkins
31 | */
32 | public abstract class AbstractLoggerTest {
33 |
34 | static final QueuedMessageHandler HANDLER = new QueuedMessageHandler();
35 | static final String LOGGER_ID_PATTERN = "LOG.*[0-9]:\\s";
36 |
37 | private static final org.jboss.logmanager.Logger LOGGER = org.jboss.logmanager.Logger.getLogger(TestConstants.CATEGORY);
38 |
39 | @BeforeAll
40 | public static void installHandler() {
41 | LOGGER.addHandler(HANDLER);
42 | }
43 |
44 | @AfterAll
45 | public static void uninstallHandler() {
46 | LOGGER.removeHandler(HANDLER);
47 | HANDLER.close();
48 | }
49 |
50 | protected String parseStringLoggerId(final String message) {
51 | final Pattern p = Pattern.compile(LOGGER_ID_PATTERN);
52 | final Matcher m = p.matcher(message);
53 | if (m.find()) {
54 | return m.group();
55 | }
56 | return null;
57 | }
58 |
59 | protected int parseLoggerId(final String message) {
60 | final String stringId = parseStringLoggerId(message);
61 | if (stringId != null) {
62 | final String s = message.replaceAll("([a-zA-z]|:.*)", "");
63 | return Integer.parseInt(s);
64 | }
65 | return 0;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/tests/ExpressionMessagesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated.tests;
21 |
22 | import org.jboss.logging.processor.generated.ExpressionLogger;
23 | import org.junit.jupiter.api.AfterEach;
24 | import org.junit.jupiter.api.Assertions;
25 | import org.junit.jupiter.api.Test;
26 |
27 | /**
28 | * @author James R. Perkins
29 | */
30 | public class ExpressionMessagesTest extends AbstractLoggerTest {
31 |
32 | @AfterEach
33 | public void clearHandler() {
34 | HANDLER.close();
35 | }
36 |
37 | @Test
38 | public void testExpressions() throws Exception {
39 | ExpressionLogger.LOGGER.logProperty();
40 | Assertions.assertEquals("test property value", HANDLER.getMessage());
41 |
42 | ExpressionLogger.LOGGER.logPropertyDefault();
43 | Assertions.assertEquals("default value", HANDLER.getMessage());
44 |
45 | Assertions.assertEquals("test property value", ExpressionLogger.LOGGER.property());
46 | Assertions.assertEquals("default value", ExpressionLogger.LOGGER.propertyDefault());
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/tests/LevelIdCheckTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated.tests;
21 |
22 | import org.jboss.logging.processor.generated.ValidLogger;
23 | import org.junit.jupiter.api.AfterEach;
24 | import org.junit.jupiter.api.Assertions;
25 | import org.junit.jupiter.api.Test;
26 |
27 | /**
28 | * @author James R. Perkins
29 | */
30 | public class LevelIdCheckTest extends AbstractLoggerTest {
31 |
32 | @AfterEach
33 | public void clearHandler() {
34 | HANDLER.close();
35 | }
36 |
37 | @SuppressWarnings("MagicNumber")
38 | @Test
39 | public void inheritedId() throws Exception {
40 | ValidLogger.LOGGER.processingError();
41 | ValidLogger.LOGGER.processingError(new IllegalArgumentException());
42 | ValidLogger.LOGGER.processingError(new IllegalArgumentException(), "generated");
43 | ValidLogger.LOGGER.processingError(this, "invalid reference");
44 | Assertions.assertEquals(203, parseLoggerId(HANDLER.getMessage()));
45 | Assertions.assertEquals(203, parseLoggerId(HANDLER.getMessage()));
46 | Assertions.assertEquals(203, parseLoggerId(HANDLER.getMessage()));
47 | Assertions.assertEquals(203, parseLoggerId(HANDLER.getMessage()));
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/tests/LoggerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated.tests;
21 |
22 | import java.util.logging.Level;
23 | import java.util.logging.Logger;
24 |
25 | import org.jboss.logging.processor.generated.TestConstants;
26 | import org.jboss.logging.processor.generated.ValidLogger;
27 | import org.junit.jupiter.api.AfterEach;
28 | import org.junit.jupiter.api.Assertions;
29 | import org.junit.jupiter.api.BeforeEach;
30 | import org.junit.jupiter.api.Test;
31 |
32 | /**
33 | * @author James R. Perkins
34 | */
35 | public class LoggerTest extends AbstractLoggerTest {
36 |
37 | private Level currentLevel = Level.ALL;
38 |
39 | @BeforeEach
40 | public void setup() {
41 | currentLevel = Logger.getLogger(TestConstants.CATEGORY).getLevel();
42 | }
43 |
44 | @AfterEach
45 | public void cleanup() {
46 | Logger.getLogger(TestConstants.CATEGORY).setLevel(currentLevel);
47 | }
48 |
49 | @Test
50 | public void testSupplierLogger() throws Exception {
51 | ValidLogger.LOGGER.expensiveLog(() -> "supplier value");
52 | ValidLogger.LOGGER.expensiveLogArray(() -> new String[] { "value1", "value2" });
53 | ValidLogger.LOGGER.expectedValues("value1", "value2", "value3");
54 |
55 | // Check the expected logs
56 | Assertions.assertEquals("Error: supplier value", HANDLER.getMessage());
57 | Assertions.assertEquals("Error: [value1, value2]", HANDLER.getMessage());
58 | Assertions.assertEquals("Expected: [value1, value2, value3]", HANDLER.getMessage());
59 |
60 | Logger.getLogger(TestConstants.CATEGORY).setLevel(Level.INFO);
61 | ValidLogger.LOGGER.debugValues(() -> {
62 | Assertions.fail("This should not be invoked.");
63 | return "debug values";
64 | });
65 | // The message should not exist
66 | Assertions.assertEquals(0, HANDLER.size(), () -> String.format("More than one message was found: %s", HANDLER));
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/generated/tests/QueuedMessageHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.generated.tests;
21 |
22 | import java.util.concurrent.BlockingQueue;
23 | import java.util.concurrent.LinkedBlockingQueue;
24 | import java.util.concurrent.TimeUnit;
25 |
26 | import org.jboss.logging.processor.util.Objects;
27 | import org.jboss.logmanager.ExtHandler;
28 | import org.jboss.logmanager.ExtLogRecord;
29 |
30 | /**
31 | * @author James R. Perkins
32 | */
33 | class QueuedMessageHandler extends ExtHandler {
34 | private final BlockingQueue messages = new LinkedBlockingQueue<>();
35 |
36 | @Override
37 | protected void doPublish(final ExtLogRecord record) {
38 | messages.add(record.getFormattedMessage());
39 | }
40 |
41 | /**
42 | * Polls the message from queue waiting for up to 1 second for the message to appear.
43 | *
44 | * @return the message
45 | *
46 | * @throws InterruptedException if the poll was interrupted
47 | */
48 | String getMessage() throws InterruptedException {
49 | return messages.poll(1, TimeUnit.SECONDS);
50 | }
51 |
52 | int size() {
53 | return messages.size();
54 | }
55 |
56 | @Override
57 | public void flush() {
58 | // no-op
59 | }
60 |
61 | @Override
62 | public void close() throws SecurityException {
63 | messages.clear();
64 | }
65 |
66 | @Override
67 | public String toString() {
68 | return Objects.ToStringBuilder.of(this)
69 | .add("messages", messages)
70 | .toString();
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/report/TestReportLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.report;
21 |
22 | import org.jboss.logging.Logger.Level;
23 | import org.jboss.logging.annotations.LogMessage;
24 | import org.jboss.logging.annotations.Message;
25 | import org.jboss.logging.annotations.MessageLogger;
26 | import org.jboss.logging.annotations.ResolutionDoc;
27 |
28 | /**
29 | * Used for validating the XML for a {@code resolutionUrl} attribute.
30 | *
31 | * @author James R. Perkins
32 | */
33 | @SuppressWarnings("unused")
34 | @MessageLogger(projectCode = "RPTL", length = 5)
35 | @ResolutionDoc
36 | public interface TestReportLogger {
37 |
38 | @LogMessage(level = Level.INFO)
39 | @Message(id = 1, value = "Test message")
40 | @ResolutionDoc(suffix = ".html")
41 | void containsUrl();
42 |
43 | @LogMessage(level = Level.INFO)
44 | @Message("Test message")
45 | void noUrl();
46 |
47 | @LogMessage(level = Level.INFO)
48 | @Message(id = 2, value = "Test message")
49 | void defaultResolutionUrl();
50 | }
51 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/report/TestReportMessages.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.report;
21 |
22 | import org.jboss.logging.annotations.BaseUrl;
23 | import org.jboss.logging.annotations.Message;
24 | import org.jboss.logging.annotations.MessageBundle;
25 | import org.jboss.logging.annotations.ResolutionDoc;
26 |
27 | /**
28 | * Used for validating the XML for a {@code resolutionUrl} attribute.
29 | *
30 | * @author James R. Perkins
31 | */
32 | @SuppressWarnings("unused")
33 | @BaseUrl("https://jboss.org/")
34 | @MessageBundle(projectCode = "RPTM")
35 | public interface TestReportMessages {
36 |
37 | @Message(id = 1, value = "Test message")
38 | @ResolutionDoc
39 | RuntimeException defaultUrl();
40 |
41 | @Message("Test message")
42 | RuntimeException noUrl();
43 |
44 | @Message(id = 2, value = "Test message")
45 | @ResolutionDoc
46 | RuntimeException containsUrl();
47 | }
48 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/util/ExpressionsTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.util;
21 |
22 | import java.io.IOException;
23 | import java.util.Properties;
24 |
25 | import org.junit.jupiter.api.Assertions;
26 | import org.junit.jupiter.api.BeforeAll;
27 | import org.junit.jupiter.api.Test;
28 |
29 | /**
30 | * @author James R. Perkins
31 | */
32 | public class ExpressionsTest {
33 |
34 | private static final Properties PROPERTIES = new Properties();
35 |
36 | @BeforeAll
37 | public static void configureProperties() throws IOException {
38 | PROPERTIES.load(ExpressionsTest.class.getResourceAsStream("/expression.properties"));
39 | }
40 |
41 | @Test
42 | public void testEnvironmentVariables() {
43 | Assertions.assertEquals("envValue", Expressions.resolve(PROPERTIES, "${env.JBOSS_LOGGING_TEST_VAR}"));
44 | Assertions.assertEquals("defaultValue",
45 | Expressions.resolve(PROPERTIES, "${env.JBOSS_LOGGING_TEST_INVALID:defaultValue}"));
46 | }
47 |
48 | @Test
49 | public void testSystemProperties() {
50 | Assertions.assertEquals(System.getProperty("user.home"), Expressions.resolve(PROPERTIES, "${sys.user.home}"));
51 | Assertions.assertEquals("sysValue", Expressions.resolve(PROPERTIES, "${sys.test.property}"));
52 | Assertions.assertEquals("defaultValue", Expressions.resolve(PROPERTIES, "${sys.invalid.property:defaultValue}"));
53 | }
54 |
55 | @Test
56 | public void testProperties() {
57 | Assertions.assertEquals("test property value", Expressions.resolve(PROPERTIES, "${test.property}"));
58 | Assertions.assertEquals("defaultValue", Expressions.resolve(PROPERTIES, "${invalid.property:defaultValue}"));
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/util/VersionComparatorTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.util;
21 |
22 | import org.junit.jupiter.api.Assertions;
23 | import org.junit.jupiter.api.Test;
24 |
25 | /**
26 | * Date: 09.11.2011
27 | *
28 | * @author James R. Perkins
29 | */
30 | public class VersionComparatorTest {
31 |
32 | @Test
33 | public void testComparator() {
34 | final String version = "3.1";
35 | Assertions.assertTrue(VersionComparator.compareVersion("3.1.1", version) > 0);
36 | Assertions.assertEquals(0, VersionComparator.compareVersion("3.1", version));
37 | Assertions.assertTrue(VersionComparator.compareVersion("3.0", version) < 0);
38 | Assertions.assertTrue(VersionComparator.compareVersion("3.0.1", version) < 0);
39 | Assertions.assertTrue(VersionComparator.compareVersion("3.0.1", version) < 0);
40 | Assertions.assertEquals(0, VersionComparator.compareVersion("3.1.x", version));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/processor/src/test/java/org/jboss/logging/processor/validation/MessageFormatValidatorTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * JBoss, Home of Professional Open Source.
3 | *
4 | * Copyright 2023 Red Hat, Inc., and individual contributors
5 | * as indicated by the @author tags.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | package org.jboss.logging.processor.validation;
21 |
22 | import static org.junit.jupiter.api.Assertions.assertFalse;
23 | import static org.junit.jupiter.api.Assertions.assertTrue;
24 |
25 | import org.junit.jupiter.api.Test;
26 |
27 | /**
28 | * Date: 14.06.2011
29 | *
30 | * @author James R. Perkins
31 | */
32 | public class MessageFormatValidatorTest {
33 |
34 | @Test
35 | public void validFormats() {
36 | MessageFormatValidator validator = MessageFormatValidator.of("Message {} is valid.");
37 | assertTrue(validator.isValid(), validator.detailMessage());
38 |
39 | validator = MessageFormatValidator.of("Parameter {1} is not compatible with {2}.");
40 | assertTrue(validator.isValid(), validator.detailMessage());
41 | }
42 |
43 | @Test
44 | public void invalidFormats() {
45 | MessageFormatValidator validator = MessageFormatValidator.of("Invalid parameter { is not valid.");
46 | assertFalse(validator.isValid());
47 | }
48 |
49 | @Test
50 | public void validateParameterCount() {
51 | MessageFormatValidator validator = MessageFormatValidator.of("{}", "Test");
52 | assertTrue(validator.isValid(), validator.detailMessage());
53 |
54 | validator = MessageFormatValidator.of("{1} {0}", "Test", "Test2");
55 | assertTrue(validator.isValid(), validator.detailMessage());
56 |
57 | validator = MessageFormatValidator.of("{0} {0}", "Test");
58 | assertTrue(validator.isValid(), validator.detailMessage());
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/processor/src/test/resources/expression.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | test.property=test property value
--------------------------------------------------------------------------------
/processor/src/test/resources/logging.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | # Additional logger names to configure (root logger is always configured)
21 | #loggers=
22 |
23 | # Root logger level
24 | logger.level=ALL
25 | # Root logger handlers
26 | logger.handlers=CONSOLE
27 |
28 | # Console handler configuration
29 | handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
30 | handler.CONSOLE.properties=autoFlush
31 | handler.CONSOLE.level=${jboss.boot.server.log.console.level:ALL}
32 | handler.CONSOLE.autoFlush=true
33 | handler.CONSOLE.formatter=PATTERN
34 |
35 | # Formatter pattern configuration
36 | formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
37 | formatter.PATTERN.properties=pattern
38 | formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] %s%n
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_de.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=Hallo %s
20 | howAreYou=Wie gehts %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_de_DE.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=Hallo %s
20 | howAreYou=Wie gehts %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_en.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Hello %s
21 | howAreYou=How are you %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_en_CA.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Hello %s
21 | howAreYou=How are you %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_en_UK.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Hello %s
21 | howAreYou=How are you %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_en_US.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Hello %s
21 | howAreYou=How are you %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_es.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=¡Hola %s!
20 | howAreYou=¿Cómo estás %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_fr.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=Bonjour %s
20 | howAreYou=Comment êtes-vous %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_fr_CA.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Bonjour %s
21 | howAreYou=Comment êtes-vous %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_fr_FR.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Bonjour %s
21 | howAreYou=Comment êtes-vous %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_it.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Ciao %s
21 | howAreYou=Come stai %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_it_IT.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=Ciao %s
21 | howAreYou=Come stai %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_ja.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=こんにちは %s
21 | howAreYou=\u304a\u5143\u6c17\u3067\u3059\u304b %s
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_ja_JP.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=こんにちは %s
21 | howAreYou=\u304a\u5143\u6c17\u3067\u3059\u304b %s
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_ko.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=\uc5ec\ubcf4\uc138\uc694 %s
21 | howAreYou=\uc798 \uc788\uc5c8 \ub2c8 %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_ko_KR.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | hello=\uc5ec\ubcf4\uc138\uc694 %s
21 | howAreYou=\uc798 \uc788\uc5c8 \ub2c8 %s?
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_zh.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=\u4f60\u597d %s
20 | howAreYou=\u4f60\u597d\u5417 %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_zh_CN.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=\u4f60\u597d %s
20 | howAreYou=\u4f60\u597d\u5417 %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultLogger.i18n_zh_TW.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=\u4f60\u597d %s
20 | howAreYou=\u4f60\u597d\u55ce %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultMessages.i18n_de.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=Hallo %s
20 | howAreYou=Wie gehts %s?
21 | invalidUser=Benutzername %s ist ungültig
22 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultMessages.i18n_es.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=¡Hola %s!
20 | howAreYou=¿Cómo estás %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/DefaultMessages.i18n_fr.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | hello=Bonjour %s
20 | howAreYou=Comment êtes-vous %s?
21 |
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/RootLocaleLogger.i18n_en_US.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 |
20 | init=Initialized %s
21 | initFailed=Initialization failed, behavior may be unpredictable.
22 | authFailed=Authorization failed for %s
--------------------------------------------------------------------------------
/processor/src/test/resources/org/jboss/logging/processor/generated/StringFormatLogger.i18n_es.properties:
--------------------------------------------------------------------------------
1 | #
2 | # JBoss, Home of Professional Open Source.
3 | #
4 | # Copyright 2023 Red Hat, Inc., and individual contributors
5 | # as indicated by the @author tags.
6 | #
7 | # Licensed under the Apache License, Version 2.0 (the "License");
8 | # you may not use this file except in compliance with the License.
9 | # You may obtain a copy of the License at
10 | #
11 | # http://www.apache.org/licenses/LICENSE-2.0
12 | #
13 | # Unless required by applicable law or agreed to in writing, software
14 | # distributed under the License is distributed on an "AS IS" BASIS,
15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | # See the License for the specific language governing permissions and
17 | # limitations under the License.
18 | #
19 | stringInt=Entero %2$d String %s
20 | stringIntFailure=Integer %d String %s
21 |
22 | dukesBirthday=Duke's de cumpleaños: %1$tm %