Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[util] Addd the annotation DefaultSpace.
This annotation may be used by the SARL developers in order to inject the default space instance into a space specification. see #66 Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
69538e4
commit 6549c38
Showing
3 changed files
with
59 additions
and
3 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
54 changes: 54 additions & 0 deletions
54
main/apiplugins/io.sarl.util/src/io/sarl/util/DefaultSpace.sarl
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,54 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2019 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.util | ||
|
||
import java.lang.annotation.ElementType | ||
import java.lang.annotation.Retention | ||
import java.lang.annotation.RetentionPolicy | ||
import java.lang.annotation.Target | ||
import com.google.inject.BindingAnnotation | ||
|
||
/** | ||
* Annotation that is used for marking formal parameters and object fields in order to | ||
* received the default space instance of a SARL context. | ||
* | ||
* <p>This annotation has the contract to be associated to: i) a formal parameter or an object field | ||
* of type {@link OpenEventspace} and to the {@code @Inject} annotation, and ii) to be used only | ||
* inside a subtype of {@code Space}. | ||
* | ||
* <p>When a formal parameter or a field is in a subtype of {@code Space} and it is injectable and | ||
* marked with this annotation, the SARL run-time environment is supposed to inject the instance | ||
* of the default space of the context in which the injected space is located. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.10 | ||
*/ | ||
@Target(ElementType::PARAMETER, ElementType::FIELD) | ||
@Retention(RetentionPolicy::RUNTIME) | ||
@BindingAnnotation | ||
annotation DefaultSpace { | ||
// | ||
} | ||
|
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