com.artemis.annotations.Wire Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of artemis-odb Show documentation
Show all versions of artemis-odb Show documentation
Fork of Artemis Entity System Framework.
package com.artemis.annotations;
import com.artemis.*;
import java.lang.annotation.*;
/**
* Customizes reflective injection of {@link ComponentMapper}, {@link EntitySystem},
* {@link Manager}, and registered types via {@link WorldConfiguration#register}.
*
* Odb automatically injects above types into entity systems, during initialization.
*
* Inject into any object using @Wire
and {@link World#inject(Object)}
*
* Nonstandard dependency fields must be explicitly annotated with
* @Wire(name="myName")
to inject by name, or @Wire
* to inject by type. Class level @Wire
annotation is not enough.
*
* By default, systems inject inherited fields from superclasses.
* Override this behavior with @Wire(injectInherited=false)
.
*
* By default, if @Wire
fails to inject a field - typically because the requested
* type hasn't been added to the world instance - a MundaneWireException is thrown.
* Override this behavior via @Wire(failOnNull=false)
.
*
* To specify which nonstandard dependencies to inject, use
* {@link com.artemis.WorldConfiguration#register(String, Object)} and
* {@link com.artemis.WorldConfiguration#register(Object)}.
*
* @see AspectDescriptor
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
@Documented
public @interface Wire {
/**
* If true, also inject inherited fields.
*/
boolean injectInherited() default false;
/**
* Throws a {@link NullPointerException} if field can't be injected.
*/
boolean failOnNull() default true;
/**
*
*/
String name() default "";
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy