Example #1
0
        private Stream <CompilationMessage> ValidateAggregationUpdateMethod(ExecutableElement aggregationFunction, Element returnType, IList <ExecutableElement> updateMethods)
        {
            if (updateMethods.Count != 1)
            {
                return(Stream.of(MissingAnnotation(aggregationFunction, returnType, updateMethods, typeof(UserAggregationUpdate))));
            }

            Stream <CompilationMessage> errors = Stream.empty();

            ExecutableElement updateMethod = updateMethods.GetEnumerator().next();

            if (!IsValidUpdateSignature(updateMethod))
            {
                errors = Stream.of(new AggregationError(updateMethod, "@%s usage error: method should be public, non-static and define 'void' as return type.", typeof(UserAggregationUpdate).Name));
            }
            return(Stream.concat(errors, _functionVisitor.validateParameters(updateMethod.Parameters)));
        }
Example #2
0
 public override Stream <CompilationMessage> VisitExecutable(ExecutableElement executableElement, Void ignored)
 {
     return(Stream.of <Stream <CompilationMessage> >(_functionVisitor.validateEnclosingClass(executableElement), _functionVisitor.validateParameters(executableElement.Parameters), _functionVisitor.validateName(executableElement), _functionVisitor.validateReturnType(executableElement)).flatMap(System.Func.identity()));
 }