-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[all] Split
@IssueOnCall
into @ErrorOnCall
, @WarningOnCall
, `@I…
…nfoOnCall`. Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
5503a4f
commit 9174118
Showing
14 changed files
with
631 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/annotation/InfoOnCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2020 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* 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 io.sarl.lang.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Annotation for marking an element with a SARL compiler issue than the element is invoked from the SARL code. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.12 | ||
*/ | ||
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD }) | ||
@Retention(RetentionPolicy.CLASS) | ||
public @interface InfoOnCall { | ||
|
||
/** Replies the message to provide to the SARL developer. | ||
* | ||
* @return the issue message. If empty or {@code null}, no issue will be generated by the compiler. | ||
*/ | ||
String value(); | ||
|
||
/** Replies if the issue is always an error. | ||
* It not, the result of {@link #warning()} is used. | ||
* | ||
* @return {@code true} if it is an error; {@code false} if the error level depends on {@link #warning()}. | ||
* @see #warning() | ||
*/ | ||
boolean error() default false; | ||
|
||
/** Replies if the issue is always a warning. | ||
* If the function {@link #error()} replies {@code true}, the result of this function should be ignored. | ||
* If this function replies {@code true}, the message is a warning message. | ||
* It not, the result of {@link #info()} is used. | ||
* | ||
* @return {@code true} if it is a warning; {@code false} if the error level depends on {@link #info()}. | ||
* @see #error() | ||
* @see #info() | ||
*/ | ||
boolean warning() default false; | ||
|
||
/** Replies if the issue is always a warning. | ||
* If one of the functions {@link #error()} or {@link #warning()} replies {@code true}, | ||
* the result of this function should be ignored. | ||
* If this function replies {@code true}, the message is an information message. | ||
* If this function replies {@code false}, the message level depends on the user preferences. | ||
* In this last case, the error level could be "error", "warning", "info", or "ignore" | ||
* | ||
* @return {@code true} if it is an information message; {@code false} if the error level depends the user preferences. | ||
* @see #error() | ||
* @see #warning() | ||
*/ | ||
boolean info() default false; | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/annotation/WarningOnCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2020 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* 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 io.sarl.lang.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** Annotation for marking an element with a SARL compiler's warning when the element is invoked from the SARL code. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.12 | ||
*/ | ||
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD }) | ||
@Retention(RetentionPolicy.CLASS) | ||
public @interface WarningOnCall { | ||
|
||
/** Replies the message to provide to the SARL developer. | ||
* | ||
* @return the issue message. If empty or {@code null}, no issue will be generated by the compiler. | ||
*/ | ||
String value(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.