Package sizzle.aggregators

Examples of sizzle.aggregators.AggregatorSpec


      }
    }

    final SizzleType type = n.f5.accept(this, argu);

    final AggregatorSpec annotation = argu.getAggregators(n.f1.f0.tokenImage, type).get(0).getAnnotation(AggregatorSpec.class);

    SizzleScalar tweight = null;
    if (n.f6.present()) {
      if (annotation.weightType().equals("none"))
        throw new TypeException("unexpected weight for table declaration");

      final SizzleType aweight = argu.getType(annotation.weightType());
      tweight = (SizzleScalar) ((NodeSequence) n.f6.node).nodes.get(1).accept(this, argu);

      if (!aweight.assigns(tweight))
        throw new TypeException("incorrect weight type for table declaration");
    } else if (!annotation.weightType().equals("none"))
      throw new TypeException("missing weight for table declaration");

    if (n.f2.present())
      if (annotation.formalParameters().length == 0)
        throw new TypeException("no arguments for table " + n.f1.f0.tokenImage);

    return new SizzleTable(type, indexTypes, tweight);
  }
View Full Code Here


  private void importAggregator(final Class<?> clazz) {
    if (!clazz.isAnnotationPresent(AggregatorSpec.class))
      return;

    final AggregatorSpec annotation = clazz.getAnnotation(AggregatorSpec.class);

    final String type = annotation.type();
    if (type.equals("any"))
      this.aggregators.put(annotation.name(), clazz);
    else
      this.aggregators.put(annotation.name() + ":" + type, clazz);
  }
View Full Code Here

TOP

Related Classes of sizzle.aggregators.AggregatorSpec

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.