Examples of MetaConstructor


Examples of org.jboss.errai.codegen.meta.MetaConstructor

    @Override
    public Collection<Object> getAllInjectors() {
      final List<Object> allInjectors = new ArrayList<Object>(getFieldInjectors());
      allInjectors.addAll(getMethodInjectors());
      final MetaConstructor injectorConstructor = getInjectorConstructor();
      if (injectorConstructor != null) {
        allInjectors.add(injectorConstructor);
      }

      return allInjectors;
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaConstructor

    if (constructors.length == 0) {
      return null;
    }

    MetaParameter[] parmTypes;
    MetaConstructor bestCandidate = null;
    int bestScore = 0;
    int score;
    boolean retry = false;

    do {
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaConstructor

     * In case of constructor injection, search for the data binder parameter annotated with @AutoBound
     */
    Statement dataBinderRef = null;
    MetaClass dataModelType = null;
    BeanMetric beanMetric = InjectUtil.analyzeBean(ctx.getInjectionContext(), ctx.getEnclosingType());
    MetaConstructor mc = beanMetric.getInjectorConstructor();
    if (mc != null) {
      for (MetaParameter mp : mc.getParameters()) {
        if (mp.getType().getErased().isAssignableTo(MetaClassFactory.get(DataBinder.class))
            && mp.isAnnotationPresent(AutoBound.class)) {
          dataModelType = (MetaClass) mp.getType().getParameterizedType().getTypeParameters()[0];
          if (dataBinderRef != null) {
            throw new GenerationException("Multiple @AutoBound data binders found in constructor of " +
                mc.getDeclaringClass());
          }
          dataBinderRef = ctx.getInjectionContext().getInlineBeanReference(mp);
        }
      }
    }
View Full Code Here

Examples of org.jboss.errai.ioc.rebind.ioc.codegen.meta.MetaConstructor

      if (constructorInjectionPoints.size() > 1) {
        throw new InjectionFailure("more than one constructor in "
                + type.getFullyQualifiedName() + " is marked as the injection point!");
      }

      final MetaConstructor constructor = constructorInjectionPoints.get(0);

      for (Class<? extends Annotation> a : ctx.getDecoratorAnnotationsBy(ElementType.TYPE)) {
        if (type.isAnnotationPresent(a)) {
          DecoratorTask task = new DecoratorTask(injector, type, ctx.getDecorator(a));
          injectionTasks.add(task);
        }
      }

      return new ConstructionStrategy() {
        @Override
        public void generateConstructor() {
          Statement[] parameterStatements = resolveInjectionDependencies(constructor.getParameters(), ctx, constructor);

          IOCProcessingContext processingContext = ctx.getProcessingContext();

          processingContext.append(
                  Stmt.declareVariable(type)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.