Interface ExpressionProblems

All Superinterfaces:
ProblemFactory

public interface ExpressionProblems extends ProblemFactory

Factory for creating problems involving an expression

  • Method Details

    • get

      static ExpressionProblems get()

      Handy accessor to save on precious keystrokes

    • cannotParse

      static Problem cannotParse(Object expectedThing, String expression)

      General purpose error for invalid expressions that cannot be parsed. Produces an error: "Failed to parse [expectedThing] expression '[expression]' e.g. Failed to parse type expression 'foo.bar'

    • notAValid

      Problem notAValid(Class<?> typeOfThing, String expression)

      Similar to cannotParse(Object, String) but for cases where mentioning 'parsing' is less appropriate. Produces an error: "'[expression]' is not a valid [typeOfThing] expression"

    • constantRequired

      Problem constantRequired(Expression expr)

      Something required a constant expression, but was given a non-constant expression, e.g. "Expected expression 'foo + bar' to be a constant value"

    • mismatch

      Problem mismatch(Expression expr, Class<? extends Expression> requiredType, String example)

      expr is expected to be of requiredType but is not.

    • noSuchOperatorFunction

      Problem noSuchOperatorFunction(String op, List<Type> argTypes)
    • pointlessSelectAllInStruct

      Problem pointlessSelectAllInStruct(StructDeclaration.Member memberDeclaration)

      The user has done something like {foo: bar.*} which is probably a mistake - it should be either {bar.*} or {foo: bar}

    • pointlessSelectAll

      Problem pointlessSelectAll(PropertyAccess expression)

      The user has done something like bar.* outside of a struct, which makes no sense

    • duplicateSelectAll

      Problem duplicateSelectAll(Token duplicate)

      A second * has been put in a struct

    • malformedExpression

      Problem malformedExpression(String expression)

      A parent problem that wraps a more specific problem within the expression

    • selectAllRequiresAStruct

      Problem selectAllRequiresAStruct(StructDeclaration.Member memberDeclaration, Type resultType)

      Given during realization when a .* is found against a non-struct type, like a list or a number

    • malformedExpressionTip

      Problem malformedExpressionTip()

      Give the user some idea of what to do when an unexpected token exception occurs

    • failedToRealize

      Problem failedToRealize(Expression expression, Type inputType)

      Wraps other problems to give the context for realization failing

    • lambdaArityError

      Problem lambdaArityError(Expression givenExpression, int found, int expected)
      Returns:
      from function realization when a lambda expression has the wrong number of args
    • propertyOutsideOfAggregationFunction

      Problem propertyOutsideOfAggregationFunction(PropertyAccess expression)

      returned when an aggregate expression has property access expressions that aren't within an aggregate function

    • aggregateFunctionNotSupportedInExpression

      Problem aggregateFunctionNotSupportedInExpression(FunctionCall fc)
    • noSuchStructMember

      Problem noSuchStructMember(String path, List<String> members)
      Returns:
      when a property expression fails to realize because a member doesn't exist
    • parametersNotAllowed

      Problem parametersNotAllowed(ParameterToken found)

      Generic error that says that an expression is no good in the current context as parameters are not allowed, i.e. there's no opportunity for the user to replace them, so it's never going to work.

    • canNotReplaceMember

      Problem canNotReplaceMember(String name, StructDeclaration.Member first, StructDeclaration.Member second)
    • emptyStringNotValid

      Problem emptyStringNotValid()

      Special case parsing error for when the user gives us an empty string