return aggregators;
}
private void importFunction(final Method m) {
final FunctionSpec annotation = m.getAnnotation(FunctionSpec.class);
final String[] formalParameters = annotation.formalParameters();
final SizzleType[] formalParameterTypes = new SizzleType[formalParameters.length];
for (int i = 0; i < formalParameters.length; i++) {
final String id = formalParameters[i];
// check for varargs
if (id.endsWith("..."))
formalParameterTypes[i] = new SizzleVarargs(this.getType(id.substring(0, id.indexOf('.'))));
else
formalParameterTypes[i] = this.getType(id);
}
for (final String dep : annotation.typeDependencies())
if (dep.endsWith(".proto"))
this.importProto(dep);
else if (dep.endsWith(".avro"))
this.importAvro(dep);
else
throw new TypeException("unknown dependency in " + dep);
this.setFunction(annotation.name(),
new SizzleFunction(m.getDeclaringClass().getCanonicalName() + '.' + m.getName(), this.getType(annotation.returnType()), formalParameterTypes));
}