pax_global_header 0000666 0000000 0000000 00000000064 13565604617 0014527 g ustar 00root root 0000000 0000000 52 comment=d194911d16ef58d6b14db8c136592e3d6ea59845
jboss-logging-tools-2.2.1.Final/ 0000775 0000000 0000000 00000000000 13565604617 0016463 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/.gitignore 0000664 0000000 0000000 00000000376 13565604617 0020461 0 ustar 00root root 0000000 0000000 #Ignore Maven target folder
target/
#Ignore Eclipse files
.settings/
.classpath
.project
#Ignore Intellij files
*.iml
*.iws
*.ipr
.idea/
#Ignore Mac files
.DS_Store
/core/target/
/base/target/
nb-configuration.xml
/processor/target/
/generator/target/ jboss-logging-tools-2.2.1.Final/README.adoc 0000664 0000000 0000000 00000000751 13565604617 0020253 0 ustar 00root root 0000000 0000000 = JBoss Logging Tools
The JBoss logging tools are used to create internationalized log statements and exceptions.
For user documentation see https://jboss-logging.github.io/jboss-logging-tools/. For annotation JavaDoc's see
https://jboss-logging.github.io/jboss-logging-tools/apidocs/.
== Building
Standard Maven build:
mvn clean install
To generate the site use the `-Pgenerate-site` profile or `-Dgenerate-site` system property when building.
mvn clean install -Dgenerate-site
jboss-logging-tools-2.2.1.Final/annotations/ 0000775 0000000 0000000 00000000000 13565604617 0021020 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/pom.xml 0000664 0000000 0000000 00000003470 13565604617 0022341 0 ustar 00root root 0000000 0000000
4.0.0org.jboss.loggingjboss-logging-tools-parent2.2.1.Final../pom.xmljboss-logging-annotationsjarJBoss Logging I18n AnnotationsApache License, version 2.0http://www.apache.org/licenses/LICENSE-2.0.txtrepoorg.jboss.loggingjboss-loggingprovided
jboss-logging-tools-2.2.1.Final/annotations/src/ 0000775 0000000 0000000 00000000000 13565604617 0021607 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/ 0000775 0000000 0000000 00000000000 13565604617 0022533 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/ 0000775 0000000 0000000 00000000000 13565604617 0023454 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/ 0000775 0000000 0000000 00000000000 13565604617 0024243 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/ 0000775 0000000 0000000 00000000000 13565604617 0025363 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/ 0000775 0000000 0000000 00000000000 13565604617 0027011 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/ 0000775 0000000 0000000 00000000000 13565604617 0031346 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/BaseUrl.java0000664 0000000 0000000 00000004025 13565604617 0033547 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2017 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Messages on reports can have a link to a {@linkplain ResolutionDoc resolution document}. This annotation can be used
* to provide a base URL for these documents.
*
* Expressions in the form of {@code ${property.key:default-value}} can be used for the values. If the property key is
* prefixed with {@code sys.} a {@linkplain System#getProperty(String) system property} will be used. If the key is
* prefixed with {@code env.} an {@linkplain System#getenv(String) environment variable} will be used. In all other cases
* the {@code org.jboss.logging.tools.expressionProperties} processor argument is used to specify the path the properties
* file which contains the values for the expressions.
*
*
* @author James R. Perkins
* @since 1.2
*/
@Target(TYPE)
@Retention(CLASS)
@Documented
public @interface BaseUrl {
/**
* The base URL used for links to resolution documentation on reports. This can be a fully qualified URL or a
* relative URL.
*
* @return the base URL
*/
String value();
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Cause.java 0000664 0000000 0000000 00000002336 13565604617 0033255 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Mark a parameter as being the "exception cause" parameter rather than a positional format parameter.
*
* @author David M. Lloyd
*/
@Retention(CLASS)
@Target(PARAMETER)
@Documented
public @interface Cause {
}
ConstructType.java 0000664 0000000 0000000 00000003125 13565604617 0034761 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicates the value of this annotation should be constructed and returned. This does not change the return type of
* the method.
*
* This annotation is only allowed on bundle messages that have a throwable return type. The value must be assignable
* to the return type.
*
*
* @author James R. Perkins
* @since 2.0.0
*/
@Retention(CLASS)
@Target(METHOD)
@Documented
public @interface ConstructType {
/**
* The actual type that should be constructed for the return type.
*
* @return the class to construct
*/
Class extends Throwable> value();
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Field.java 0000664 0000000 0000000 00000007327 13565604617 0033245 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate that a method parameter value should be applied to a field on the resultant exception object.
*
* If this annotation is placed on a method the {@linkplain #name() name} attribute becomes a required parameter and one
* default attribute needs to be set. The value of the default attribute is used to set the filed on the resultant
* exception object.
*
*
* @author David M. Lloyd
* @author James R. Perkins
*/
@Retention(CLASS)
@Target({PARAMETER, METHOD})
@Repeatable(Fields.class)
@Documented
public @interface Field {
/**
* The field name. If not specified, the parameter name is assumed to be the field name.
*
* This becomes a required attrubyte if this annotation is present on a method.
*
*
* @return the field name
*/
String name() default "";
/**
* The default {@code boolean} value if this annotation is used on a method.
*
* @return the default value to use
*/
boolean booleanValue() default false;
/**
* The default boolean value if this annotation is used on a method.
*
* @return the default value to use
*/
byte byteValue() default 0x00;
/**
* The default {@code byte} value if this annotation is used on a method.
*
* @return the default value to use
*/
char charValue() default 0x00;
/**
* The default {@link Class} value if this annotation is used on a method.
*
* @return the default value to use
*/
Class> classValue() default Object.class;
/**
* The default {@code double} value if this annotation is used on a method.
*
* @return the default value to use
*/
double doubleValue() default 0.0d;
/**
* The default {@code float} value if this annotation is used on a method.
*
* @return the default value to use
*/
float floatValue() default 0.0f;
/**
* The default {@code int} value if this annotation is used on a method.
*
* @return the default value to use
*/
int intValue() default 0;
/**
* The default {@code long} value if this annotation is used on a method.
*
* @return the default value to use
*/
long longValue() default 0L;
/**
* The default {@code short} value if this annotation is used on a method.
*
* @return the default value to use
*/
short shortValue() default 0;
/**
* The default {@link String} value if this annotation is used on a method.
*
* @return the default value to use
*/
String stringValue() default "";
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Fields.java 0000664 0000000 0000000 00000002642 13565604617 0033423 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2016 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Defines the default field properties to use on the resultant exception object.
*
* @author James R. Perkins
*/
@Retention(CLASS)
@Target(METHOD)
@Documented
public @interface Fields {
/**
* The fields to use on the resultant exception object. Note that the {@link Field#name() name} attribute is
* required for these annotations.
*
* @return the fields
*/
Field[] value();
}
FormatWith.java 0000664 0000000 0000000 00000003417 13565604617 0034223 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate that the given parameter should be wrapped with a formatting object of the given class. The class
* must have a one-argument constructor which unambiguously accepts a value of this parameter's type. The resultant
* object will be passed in as a parameter to the underlying format type; thus its {@link Object#toString() toString()}
* method will be invoked (or, if the format style is {@link Message.Format#PRINTF PRINTF}, the object may implement
* {@link java.util.Formattable Formattable} to get extra functionality).
*
* @author David M. Lloyd
*/
@Target(PARAMETER)
@Retention(CLASS)
@Documented
public @interface FormatWith {
/**
* The class of the formatting object to use.
*
* @return the class
*/
Class> value();
}
LogMessage.java 0000664 0000000 0000000 00000003251 13565604617 0034161 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.jboss.logging.Logger;
/**
* A typed logger method. Indicates that this method will log the associated {@link Message} to the logger system, as
* opposed to being a simple message lookup.
*
* @author David M. Lloyd
*/
@Retention(CLASS)
@Target(METHOD)
@Documented
public @interface LogMessage {
/**
* The log level at which this message should be logged. Defaults to {@code INFO}.
*
* @return the log level
*/
Logger.Level level() default Logger.Level.INFO;
/**
* The logging class name to use for this message, if any.
*
* @return the logging class name
*/
Class> loggingClass() default Void.class;
}
LoggingClass.java 0000664 0000000 0000000 00000002371 13565604617 0034511 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Mark a parameter as specifying the name of the logging class to use. The parameter
* may have a type of {@link Class}.
*
* @author David M. Lloyd
*/
@Retention(CLASS)
@Target(PARAMETER)
@Documented
public @interface LoggingClass {
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Message.java0000664 0000000 0000000 00000005632 13565604617 0033603 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Assigns a message string to a resource method. The method arguments are used to supply the positional parameter
* values for the method.
*
* @author David M. Lloyd
*/
@Target(METHOD)
@Retention(CLASS)
@Documented
public @interface Message {
/**
* Indicates that this message has no ID.
*/
int NONE = 0;
/**
* Indicates that this message should inherit the ID from another message with the same name.
*/
int INHERIT = -1;
/**
* The message ID number. Only one message with a given name may specify an ID other than {@link #INHERIT}.
*
* @return the message ID number
*/
int id() default INHERIT;
/**
* The default format string of this message.
*
* Expressions in the form of {@code ${property.key:default-value}} can be used for the value. If the property key is
* prefixed with {@code sys.} a {@linkplain System#getProperty(String) system property} will be used. If the key is
* prefixed with {@code env.} an {@linkplain System#getenv(String) environment variable} will be used. In all other cases
* the {@code org.jboss.logging.tools.expressionProperties} processor argument is used to specify the path the properties
* file which contains the values for the expressions.
*
*
* @return the format string
*/
String value();
/**
* The format type of this method (defaults to {@link Format#PRINTF}).
*
* @return the format type
*/
Format format() default Format.PRINTF;
/**
* The possible format types.
*/
enum Format {
/**
* A {@link java.util.Formatter}-type format string.
*/
PRINTF,
/**
* A {@link java.text.MessageFormat}-type format string.
*/
MESSAGE_FORMAT,
/**
* Indicates the message should not be formatted.
*/
NO_FORMAT,
}
}
MessageBundle.java 0000664 0000000 0000000 00000005060 13565604617 0034651 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.Locale;
/**
* Signify that an interface is a message bundle interface.
*
* @author David M. Lloyd
*/
@Target(TYPE)
@Retention(CLASS)
@Documented
public @interface MessageBundle {
/**
* Get the project code for messages that have an associated code. If no project code is associated
* with this bundle, specify {@code ""} (the empty string).
*
* @return the project code
*/
String projectCode();
/**
* The length of the padding used for each id in the message bundle. For example given the default padding length
* of 6 and a message with an id of 100 would result would be {@code "000100"}.
*
* Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error
* being produced.
*
* @return the length the id should be padded
*/
int length() default 6;
/**
* Specifies the {@linkplain Locale locale} for formatting bundle messages. This is only used in the super
* implementation. Subclasses will define their own locale to use based on the name of the resource bundle at
* compile time.
*
* An empty string will default to {@link Locale#ROOT}.
*
*
* A non-empty string will be parsed by the {@link Locale#forLanguageTag(String)}. This uses the
* IETF BCP 47 format.
*
*
* @return the default locale message bundles should use for formatting messages
*/
String rootLocale() default "";
}
MessageLogger.java 0000664 0000000 0000000 00000005436 13565604617 0034666 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.Locale;
/**
* Signify that an interface is a typed logger interface. A message logger interface may optionally extend other
* message logger interfaces and message bundle interfaces (see {@link org.jboss.logging.annotations.MessageBundle}, as
* well as the {@link org.jboss.logging.BasicLogger} interface.
*
* @author David M. Lloyd
*/
@Retention(CLASS)
@Target(TYPE)
@Documented
public @interface MessageLogger {
/**
* Get the project code for messages that have an associated code. If no project code is associated
* with this logger, specify {@code ""} (the empty string).
*
* @return the project code
*/
String projectCode();
/**
* The length of the padding used for each id in the message bundle. For example given the default padding length
* of 6 and a message with an id of 100 would result would be {@code "000100"}.
*
* Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error
* being produced.
*
* @return the length the id should be padded
*/
int length() default 6;
/**
* Specifies the {@linkplain Locale locale} for formatting bundle messages. This is only used in the super
* implementation. Subclasses will define their own locale to use based on the name of the resource bundle at
* compile time.
*
* An empty string will default to {@link Locale#ROOT}.
*
*
* A non-empty string will be parsed by the {@link Locale#forLanguageTag(String)}. This uses the
* IETF BCP 47 format.
*
*
* @return the default locale message bundles should use for formatting messages
*/
String rootLocale() default "";
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Once.java 0000664 0000000 0000000 00000002674 13565604617 0033106 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicates a message should only be logged once.
*
* Methods that use this annotation must be {@linkplain org.jboss.logging.annotations.LogMessage logger methods}. Overloaded
* methods also annotated with {@code @Once} will inherit the same check only logging the message from the first
* overloaded method invoked.
*
*
* @author James R. Perkins
*/
@Target(METHOD)
@Retention(CLASS)
@Documented
public @interface Once {
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Param.java 0000664 0000000 0000000 00000003454 13565604617 0033257 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Identifies a parameter is to be used for constructing an exception and excluded from the formatting of the message.
*
* Parameters will be order-matched first, then type-matched to resolve ambiguity. If a match fails an error should
* occur.
*
* The {@link #value()} option will allow an optional class to be specified which will have to match the exact type of
* the parameter in question, to enable unambiguous resolution. The value must be the fully qualified class name.
*
* @author James R. Perkins
*/
@Target(PARAMETER)
@Retention(CLASS)
@Documented
public @interface Param {
/**
* Defines an exact class the parameter must match for unambiguous resolution.
*
* @return the class the parameter must match.
*/
Class> value() default Object.class;
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations/Pos.java 0000664 0000000 0000000 00000002730 13565604617 0032754 0 ustar 00root root 0000000 0000000 /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* @author James R. Perkins
* @since 1.1.0
*/
@Retention(CLASS)
@Target(PARAMETER)
@Documented
public @interface Pos {
/**
* The positions the value should be used at.
*
* @return an array of the positions for the parameter
*/
int[] value();
/**
* The transform types used on the parameter.
*
* @return an array of the transformer types
*
* @see Transform
*/
Transform[] transform() default {};
}
Producer.java 0000664 0000000 0000000 00000005326 13565604617 0033723 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2017 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Identifies a parameter has the ability to produce a {@link Throwable} or a super type of a {@code Throwable}. The
* parameter type must be a {@link java.util.function.Function} or a {@link java.util.function.BiFunction}.
*
* For a {@link java.util.function.Function} the input parameter must be a {@link String} which will be the message
* associated with the method. The result type must {@link Throwable} or a super type of a {@code Throwable}.
*
*
*
* For a {@link java.util.function.BiFunction} one of the input parameters must be a {@link String} which will be the
* message associated with the method. The other input parameter must be a {@link Throwable} or a super type of a
* {@code Throwable} and must be assignable from the parameter annotated with {@link Cause}. The result type must
* {@link Throwable} or a super type of a {@code Throwable}.
*
*
*
* Example
*
*
* @Message("The operation failed due to %s")
* T operationFailed(@Producer Function function, String op);
*
* @Message("The operation failed due to %s")
* T operationFailed(@Producer BiFunction function, @Cause Throwable cause, String op);
*
*
*
* @author James R. Perkins
*/
@Target(PARAMETER)
@Retention(CLASS)
@Documented
public @interface Producer {
}
Properties.java 0000664 0000000 0000000 00000002656 13565604617 0034277 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2016 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Defines the default properties to use on the resultant exception object.
*
* @author James R. Perkins
*/
@Retention(CLASS)
@Target(METHOD)
@Documented
public @interface Properties {
/**
* The properties to use on the resultant exception object. Note that the {@link Property#name() name} attribute is
* required for these annotations.
*
* @return the properties
*/
Property[] value();
}
Property.java 0000664 0000000 0000000 00000007410 13565604617 0033760 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate that a method parameter value should be applied to a property (with a setter method) on the resultant
* exception object.
*
* If this annotation is placed on a method the {@linkplain #name() name} attribute becomes a required parameter and one
* default attribute needs to be set. The value of the default attribute is used to set the property on the resultant
* exception object.
*
*
* @author David M. Lloyd
* @author James R. Perkins
*/
@Retention(CLASS)
@Target({PARAMETER, METHOD})
@Repeatable(Properties.class)
@Documented
public @interface Property {
/**
* The property name. If not specified, the parameter name is assumed to be the property name.
*
* This becomes a required attribute if this annotation is present on a method.
*
*
* @return the property name
*/
String name() default "";
/**
* The default {@code boolean} value if this annotation is used on a method.
*
* @return the default value to use
*/
boolean booleanValue() default false;
/**
* The default boolean value if this annotation is used on a method.
*
* @return the default value to use
*/
byte byteValue() default 0x00;
/**
* The default {@code byte} value if this annotation is used on a method.
*
* @return the default value to use
*/
char charValue() default 0x00;
/**
* The default {@link Class} value if this annotation is used on a method.
*
* @return the default value to use
*/
Class> classValue() default Object.class;
/**
* The default {@code double} value if this annotation is used on a method.
*
* @return the default value to use
*/
double doubleValue() default 0.0d;
/**
* The default {@code float} value if this annotation is used on a method.
*
* @return the default value to use
*/
float floatValue() default 0.0f;
/**
* The default {@code int} value if this annotation is used on a method.
*
* @return the default value to use
*/
int intValue() default 0;
/**
* The default {@code long} value if this annotation is used on a method.
*
* @return the default value to use
*/
long longValue() default 0L;
/**
* The default {@code short} value if this annotation is used on a method.
*
* @return the default value to use
*/
short shortValue() default 0;
/**
* The default {@link String} value if this annotation is used on a method.
*
* @return the default value to use
*/
String stringValue() default "";
}
ResolutionDoc.java 0000664 0000000 0000000 00000010355 13565604617 0034727 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2017 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Allows a link to be created for messages on a report which contain a possible resolution to the issue reported . If
* the method does not include an {@linkplain Message#id() id} no link will be created for the report unless a
* {@link #path()} is defined.
*
*
* The rules for building the URL are as follows:
*
*
{@link #url() url}: If left empty and the type is annotated with a {@link BaseUrl} the value for the
* {@code @BaseUrl} will be used. If defined this will override the value of the {@link BaseUrl}. If neither are
* defined the rules for the {@link #path()} will be followed.
*
{@link #path() path}: If defined this will be the path appended to the {@link #url()} or the value of the
* {@link BaseUrl}. Note that neither {@link #url()} nor {@link BaseUrl} are required. If the value is left
* undefined the id (project code plus the {@linkplain Message#id() message id}) will be used for the path.
*
{@link #suffix() suffix}: The suffix to append to the {@link #path()}. This is mostly useful if the path
* is left undefined and a suffix should be appended to the messages id. If left undefined and the {@link #path()}
* is not defined, the suffix will be determined based on the report type.
*
*
*
*
* If placed on a type links will be created for all methods on the type.
*
*
*
* Do note that the processor does not validate the resolution document exists. It simply attempts to create links to
* the resolution document.
*
*
* Expressions in the form of {@code ${property.key:default-value}} can be used for the values with the exception of the
* {@link #skip() skip} attribute. If the property key is prefixed with {@code sys.} a
* {@linkplain System#getProperty(String) system property} will be used. If the key is prefixed with {@code env.} an
* {@linkplain System#getenv(String) environment variable} will be used. In all other cases the
* {@code org.jboss.logging.tools.expressionProperties} processor argument is used to specify the path the properties
* file which contains the values for the expressions.
*
*
* @author James R. Perkins
* @since 1.2
*/
@Target({METHOD, TYPE})
@Retention(CLASS)
@Documented
public @interface ResolutionDoc {
/**
* The URL, fully qualified or relative, to use for the resolution document. If defined this will override the value
* of the {@link BaseUrl} if the annotation is used.
*
* @return the URL or an empty string
*/
String url() default "";
/**
* The path to the resolution document. If left undefined this will default to the message id.
*
* @return the path to the resolution document
*/
String path() default "";
/**
* The suffix to append to the path. If left undefined this will default to the extension for the report type. For
* example if the report type is {@code xml} the default suffix would be {@code .xml}.
*
* @return the suffix for the resolution document
*/
String suffix() default "";
/**
* Allows the creation of a link to be skipped.
*
* @return {@code true} if creating the link should be skipped
*/
boolean skip() default false;
}
Signature.java 0000664 0000000 0000000 00000006675 13565604617 0034111 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2016 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Specifies the exact signature to use when creating a {@link Throwable} return type.
*
*
* Given the following exception and message bundle interface method the {@code InvalidIntValueException(final RuntimeException cause, final String msg, final int value)}
* constructor would be used.
*
*
*
* public class InvalidIntValueException extends RuntimeException {
* private final RuntimeException causeAsRuntime;
* private final int value;
* public InvalidIntValueException(final Throwable cause, final String msg, final int value) {
* super(msg, cause);
* causeAsRuntime = new RuntimeException(cause);
* this.value = value;
* }
*
* public InvalidIntValueException(final RuntimeException cause, final String msg, final int value) {
* super(msg, cause);
* causeAsRuntime = cause;
* this.value = value;
* }
* public InvalidIntValueException(final RuntimeException cause, final String msg, final Integer value) {
* super(msg, cause);
* causeAsRuntime = cause;
* this.value = value;
* }
* }
*
*
*
*
*
* @Message("Invalid value %d")
* @Signature(causeIndex = 0, messageIndex = 1, value = {RuntimeException.class, String.class, int.class}
* InvalidIntValueException invalidValue(@Cause RuntimeException cause, @Param int value);
*
*
*
*
* @author James R. Perkins
*/
@Retention(CLASS)
@Target(METHOD)
@Documented
public @interface Signature {
/**
* An array of types matching the exact signature to use for the exception being created.
*
* @return an array of types used to find the signature
*/
Class>[] value();
/**
* The index for the {@linkplain Cause cause} of the exception being created. A value of less than zero assumes
* there is no cause parameter in the constructor. A {@link Cause} annotation can still be used and the
* {@link Throwable#initCause(Throwable)} will be used to initialize the cause of the exception.
*
* @return the index for the cause parameter
*/
int causeIndex() default -1;
/**
* The index for the message. This is the formatted messaged from the {@link Message#value()}. This is a required
* value defaulting to 0 which would be the first parameter.
*
* @return the index for the message parameter
*/
int messageIndex() default 0;
}
Suppressed.java 0000664 0000000 0000000 00000003160 13565604617 0034267 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2016 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicates the parameter should be added as a {@linkplain Throwable#addSuppressed(Throwable) suppressed} exception to
* the returned exception.
*
* The annotated parameter can be a single {@linkplain Throwable throwable type}, an array of
* {@linkplain Throwable throwable types} or a {@linkplain java.util.Collection collection} of
* {@linkplain Throwable throwable types}. Note this is only allowed on message bundle methods that return a
* {@linkplain Throwable throwable type}.
*
*
* @author James R. Perkins
*/
@Retention(CLASS)
@Target(PARAMETER)
@Documented
public @interface Suppressed {
}
Transform.java 0000664 0000000 0000000 00000005574 13565604617 0034120 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate the given parameter should be transformed in each of the {@link org.jboss.logging.annotations.Transform.TransformType transform types}
* provided. The parameter cannot be a primitive type.
*
* For the {@link TransformType#SIZE} type, the object must be a {@link String}, a {@link java.util.Collection}, a
* {@link java.util.Map} or an array.
*
* The type {@link TransformType#GET_CLASS} can be used with {@link TransformType#HASH_CODE} or {@link
* TransformType#IDENTITY_HASH_CODE}. The type {@link TransformType#SIZE} must be used on it's own.
*
* @author James R. Perkins
* @since 1.1.0
*/
@Retention(CLASS)
@Target(PARAMETER)
@Documented
public @interface Transform {
/**
* The transform type
*/
public enum TransformType {
/**
* Gets the class of the object object passed, {@link Object#getClass()}.
*/
GET_CLASS,
/**
* Gets the hash code of the object, {@link Object#hashCode()}.
*/
HASH_CODE,
/**
* Gets the identity hash code of the object, {@link System#identityHashCode(Object)}.
*/
IDENTITY_HASH_CODE,
/**
* Gets the size or length of a {@link String}, {@link java.util.Collection}, {@link java.util.Map} or array.
*/
SIZE,
}
/**
* The transform types used on the parameter.
*
* Valid combinations:
*
*
* @return an array of the transform types
*/
TransformType[] value();
}
ValidIdRange.java 0000664 0000000 0000000 00000004565 13565604617 0034435 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Sets a range of valid id's allowed on the {@link org.jboss.logging.annotations.Message#id() message id}. Both {@link
* Message#INHERIT} and {@link Message#NONE} are ignored when validating.
*
* Note: Message id's from inherited interfaces are not validated within the range provided. Super interfaces
* would need their own annotation for range validation.
*
*
*
*
*
* @author James R. Perkins
*/
@Target(TYPE)
@Retention(CLASS)
@Documented
public @interface ValidIdRange {
/**
* The minimum id allowed in the {@link org.jboss.logging.annotations.Message#id() message id}. Both {@link
* Message#INHERIT} and {@link Message#NONE} are ignored when validating.
*
* @return the minimum id allowed
*/
int min() default 1;
/**
* The maximum id allowed in the {@link org.jboss.logging.annotations.Message#id() message id}. Both {@link
* Message#INHERIT} and {@link Message#NONE} are ignored when validating.
*
* @return the maximum id allowed
*/
int max() default 999999;
}
ValidIdRanges.java 0000664 0000000 0000000 00000002363 13565604617 0034612 0 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/java/org/jboss/logging/annotations /*
* JBoss, Home of Professional Open Source.
*
* Copyright 2015 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging.annotations;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* @author James R. Perkins
*/
@Target(TYPE)
@Retention(CLASS)
@Documented
public @interface ValidIdRanges {
/**
* An array of valid id ranges.
*
* @return an array of valid id ranges
*/
ValidIdRange[] value();
}
jboss-logging-tools-2.2.1.Final/annotations/src/main/resources/ 0000775 0000000 0000000 00000000000 13565604617 0024545 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/resources/META-INF/ 0000775 0000000 0000000 00000000000 13565604617 0025705 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/annotations/src/main/resources/META-INF/LICENSE.txt 0000664 0000000 0000000 00000026135 13565604617 0027537 0 ustar 00root root 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. jboss-logging-tools-2.2.1.Final/docs/ 0000775 0000000 0000000 00000000000 13565604617 0017413 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/docs/apidocs/ 0000775 0000000 0000000 00000000000 13565604617 0021035 5 ustar 00root root 0000000 0000000 jboss-logging-tools-2.2.1.Final/docs/apidocs/allclasses-frame.html 0000664 0000000 0000000 00000010365 13565604617 0025146 0 ustar 00root root 0000000 0000000
All Classes (JBoss Logging I18n Documentation 2.2.1.Final API)
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
Interfaces (italic)
Classes
Enums
Exceptions
Errors
Annotation Types
Class/Interface
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
Class inheritance diagram
Direct Subclasses
All Known Subinterfaces
All Known Implementing Classes
Class/interface declaration
Class/interface description
Nested Class Summary
Field Summary
Constructor Summary
Method Summary
Field Detail
Constructor Detail
Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
Annotation Type
Each annotation type has its own separate page with the following sections:
Annotation Type declaration
Annotation Type description
Required Element Summary
Optional Element Summary
Element Detail
Enum
Each enum has its own separate page with the following sections:
Enum declaration
Enum description
Enum Constant Summary
Enum Constant Detail
Use
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
Tree (Class Hierarchy)
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
Deprecated API
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
Index
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
Prev/Next
These links take you to the next or previous class, interface, package, or related page.
Frames/No Frames
These links show and hide the HTML frames. All pages are available with or without frames.
All Classes
The All Classes link shows all classes and interfaces except non-static nested types.
Serialized Form
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
Messages on reports can have a link to a resolution document. This annotation can be used
to provide a base URL for these documents.
Expressions in the form of ${property.key:default-value} can be used for the values. If the property key is
prefixed with sys. a system property will be used. If the key is
prefixed with env. an environment variable will be used. In all other cases
the org.jboss.logging.tools.expressionProperties processor argument is used to specify the path the properties
file which contains the values for the expressions.
Indicate that a method parameter value should be applied to a field on the resultant exception object.
If this annotation is placed on a method the name attribute becomes a required parameter and one
default attribute needs to be set. The value of the default attribute is used to set the filed on the resultant
exception object.
Indicate that the given parameter should be wrapped with a formatting object of the given class. The class
must have a one-argument constructor which unambiguously accepts a value of this parameter's type. The resultant
object will be passed in as a parameter to the underlying format type; thus its toString()
method will be invoked (or, if the format style is PRINTF, the object may implement
Formattable to get extra functionality).
Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Message.Format c : Message.Format.values())
System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Expressions in the form of ${property.key:default-value} can be used for the value. If the property key is
prefixed with sys. a system property will be used. If the key is
prefixed with env. an environment variable will be used. In all other cases
the org.jboss.logging.tools.expressionProperties processor argument is used to specify the path the properties
file which contains the values for the expressions.
Returns:
the format string
id
public abstract int id
The message ID number. Only one message with a given name may specify an ID other than INHERIT.
Get the project code for messages that have an associated code. If no project code is associated
with this bundle, specify "" (the empty string).
Returns:
the project code
length
public abstract int length
The length of the padding used for each id in the message bundle. For example given the default padding length
of 6 and a message with an id of 100 would result would be "000100".
Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error
being produced.
Specifies the locale for formatting bundle messages. This is only used in the super
implementation. Subclasses will define their own locale to use based on the name of the resource bundle at
compile time.
Signify that an interface is a typed logger interface. A message logger interface may optionally extend other
message logger interfaces and message bundle interfaces (see MessageBundle, as
well as the BasicLogger interface.
Get the project code for messages that have an associated code. If no project code is associated
with this logger, specify "" (the empty string).
Returns:
the project code
length
public abstract int length
The length of the padding used for each id in the message bundle. For example given the default padding length
of 6 and a message with an id of 100 would result would be "000100".
Valid values a range of 3 to 8. Any value less than 0 turns off padding. Any other value will result in an error
being produced.
Specifies the locale for formatting bundle messages. This is only used in the super
implementation. Subclasses will define their own locale to use based on the name of the resource bundle at
compile time.
Methods that use this annotation must be logger methods. Overloaded
methods also annotated with @Once will inherit the same check only logging the message from the first
overloaded method invoked.
Identifies a parameter is to be used for constructing an exception and excluded from the formatting of the message.
Parameters will be order-matched first, then type-matched to resolve ambiguity. If a match fails an error should
occur.
The value() option will allow an optional class to be specified which will have to match the exact type of
the parameter in question, to enable unambiguous resolution. The value must be the fully qualified class name.
Identifies a parameter has the ability to produce a Throwable or a super type of a Throwable. The
parameter type must be a Function or a BiFunction.
For a Function the input parameter must be a String which will be the message
associated with the method. The result type must Throwable or a super type of a Throwable.
For a BiFunction one of the input parameters must be a String which will be the
message associated with the method. The other input parameter must be a Throwable or a super type of a
Throwable and must be assignable from the parameter annotated with Cause. The result type must
Throwable or a super type of a Throwable.
Example
@Message("The operation failed due to %s")
T operationFailed(@Producer Function function, String op);
@Message("The operation failed due to %s")
T operationFailed(@Producer BiFunction function, @Cause Throwable cause, String op);
Indicate that a method parameter value should be applied to a property (with a setter method) on the resultant
exception object.
If this annotation is placed on a method the name attribute becomes a required parameter and one
default attribute needs to be set. The value of the default attribute is used to set the property on the resultant
exception object.
Allows a link to be created for messages on a report which contain a possible resolution to the issue reported . If
the method does not include an id no link will be created for the report unless a
path() is defined.
The rules for building the URL are as follows:
url: If left empty and the type is annotated with a BaseUrl the value for the
@BaseUrl will be used. If defined this will override the value of the BaseUrl. If neither are
defined the rules for the path() will be followed.
path: If defined this will be the path appended to the url() or the value of the
BaseUrl. Note that neither url() nor BaseUrl are required. If the value is left
undefined the id (project code plus the message id) will be used for the path.
suffix: The suffix to append to the path(). This is mostly useful if the path
is left undefined and a suffix should be appended to the messages id. If left undefined and the path()
is not defined, the suffix will be determined based on the report type.
If placed on a type links will be created for all methods on the type.
Do note that the processor does not validate the resolution document exists. It simply attempts to create links to
the resolution document.
Expressions in the form of ${property.key:default-value} can be used for the values with the exception of the
skip attribute. If the property key is prefixed with sys. a
system property will be used. If the key is prefixed with env. an
environment variable will be used. In all other cases the
org.jboss.logging.tools.expressionProperties processor argument is used to specify the path the properties
file which contains the values for the expressions.
The URL, fully qualified or relative, to use for the resolution document. If defined this will override the value
of the BaseUrl if the annotation is used.
The suffix to append to the path. If left undefined this will default to the extension for the report type. For
example if the report type is xml the default suffix would be .xml.
Specifies the exact signature to use when creating a Throwable return type.
Given the following exception and message bundle interface method the InvalidIntValueException(final RuntimeException cause, final String msg, final int value)
constructor would be used.
public class InvalidIntValueException extends RuntimeException {
private final RuntimeException causeAsRuntime;
private final int value;
public InvalidIntValueException(final Throwable cause, final String msg, final int value) {
super(msg, cause);
causeAsRuntime = new RuntimeException(cause);
this.value = value;
}
public InvalidIntValueException(final RuntimeException cause, final String msg, final int value) {
super(msg, cause);
causeAsRuntime = cause;
this.value = value;
}
public InvalidIntValueException(final RuntimeException cause, final String msg, final Integer value) {
super(msg, cause);
causeAsRuntime = cause;
this.value = value;
}
}
@Message("Invalid value %d")
@Signature(causeIndex = 0, messageIndex = 1, value = {RuntimeException.class, String.class, int.class}
InvalidIntValueException invalidValue(@Cause RuntimeException cause, @Param int value);
An array of types matching the exact signature to use for the exception being created.
Returns:
an array of types used to find the signature
causeIndex
public abstract int causeIndex
The index for the cause of the exception being created. A value of less than zero assumes
there is no cause parameter in the constructor. A Cause annotation can still be used and the
Throwable.initCause(Throwable) will be used to initialize the cause of the exception.
Returns:
the index for the cause parameter
Default:
-1
messageIndex
public abstract int messageIndex
The index for the message. This is the formatted messaged from the Message.value(). This is a required
value defaulting to 0 which would be the first parameter.
Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Transform.TransformType c : Transform.TransformType.values())
System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Sets a range of valid id's allowed on the message id. Both Message.INHERIT and Message.NONE are ignored when validating.
Note: Message id's from inherited interfaces are not validated within the range provided. Super interfaces
would need their own annotation for range validation.
@MessageLogger(projectCode = "EXAMPLE")
@ValidIdRange(min = 100, max = 200)
public interface ExampleLogger {
@LogMessage
@Message(id = 100, value = "Example message")
void example();
}