Package com.artemis.annotations

Examples of com.artemis.annotations.Wire


    public void inject(Object target) throws RuntimeException {
      try {
        Class<?> clazz = target.getClass();

        if (ClassReflection.isAnnotationPresent(clazz, Wire.class)) {
          Wire wire = ClassReflection.getAnnotation(clazz, Wire.class);
          if (wire != null) {
            injectValidFields(target, clazz, wire.failOnNull(), wire.injectInherited());
          }
        } else {
          injectAnnotatedFields(target, clazz);
        }
      } catch (ReflectionException e) {
View Full Code Here


        if (failOnNotInjected && factory == null) {
          throw new MundaneWireException("Factory not found for " + fieldType);
        }
        field.set(target, factory);
      } else if (field.isAnnotationPresent(Wire.class)) {
        final Wire wire = field.getAnnotation(Wire.class);
        String key = wire.name();
        if ("".equals(key))
          key = field.getType().getName();
       
        if (pojos.containsKey(key))
          field.set(target, pojos.get(key));
View Full Code Here

TOP

Related Classes of com.artemis.annotations.Wire

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.