Class Expression

    • Method Detail

      • of

        public static Expression of​(boolean value)
      • of

        public static Expression of​(int value)
        Construct an integer literal for the given value, and returns it as an expression.
        Parameters:
        value - the integer value.
        Returns:
        the integer value as a literal expression.
      • of

        public static Literal of​(java.lang.String value)
        Constructs a string literal for the given values.
        Parameters:
        value - the string value.
        Returns:
        the string value as a literal.
      • fromNode

        public static Expression fromNode​(Node node)
        Constructs an expression from the provided Node.
        Parameters:
        node - the node to construct the expression from.
        Returns:
        the expression.
      • parseShortform

        public static Expression parseShortform​(java.lang.String shortForm,
                                                FromSourceLocation context)
        Parse a value from a "short form" used within a template.
        Parameters:
        shortForm - the shortform value
        Returns:
        the parsed expression
      • literal

        public static Literal literal​(StringNode node)
        Constructs a Literal from the given StringNode.
        Parameters:
        node - the node to construct the literal from.
        Returns:
        the string node as a literal.
      • accept

        public abstract <R> R accept​(ExpressionVisitor<R> visitor)
        Invoke the ExpressionVisitor functions for this expression.
        Type Parameters:
        R - the visitor return type.
        Parameters:
        visitor - the visitor to be invoked.
        Returns:
        the return value of the visitor.
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public abstract boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getAttr

        public GetAttr getAttr​(java.lang.String path)
        Constructs a GetAttr expression containing the given path string.
        Parameters:
        path - the path.
        Returns:
        the GetAttr expression.
      • type

        public Type type()
        Returns the type for this expression, throws a runtime exception if typeCheck has not been invoked.
        Returns:
        the type.
      • isSet

        public IsSet isSet()
        Returns an IsSet expression for this instance.
        Returns:
        the IsSet expression.
      • equal

        public Function equal​(boolean value)
        Returns a BooleanEquals expression comparing this expression to the provided boolean value.
        Parameters:
        value - the value to compare against.
        Returns:
        the BooleanEquals Function.
      • not

        public Not not()
        Returns a Not expression of this instance.
        Returns:
        the Not expression.
      • equal

        public Function equal​(java.lang.String value)
        Returns a StringEquals function of this expression and the given string value.
        Parameters:
        value - the string value to compare this expression to.
        Returns:
        the StringEquals Function.
      • parseArn

        public Function parseArn()
        Returns a ParseArn function of this expression.
        Returns:
        the ParseArn function expression.
      • substring

        public Function substring​(int startIndex,
                                  int stopIndex,
                                  java.lang.Boolean reverse)
        Returns a substring expression of this expression.
        Parameters:
        startIndex - the starting index of the string.
        stopIndex - the ending index of the string.
        reverse - whether the indexing is should start from end of the string to start.
        Returns:
        the Substring function expression.
      • isValidHostLabel

        public Function isValidHostLabel​(boolean allowDots)
        Returns a isValidHostLabel expression of this expression.
        Parameters:
        allowDots - whether the UTF-8 . is considered valid within a host label.
        Returns:
        the isValidHostLabel function expression.
      • isVirtualHostableS3Bucket

        public Function isVirtualHostableS3Bucket​(boolean allowDots)
        Returns a isVirtualHostableS3Bucket expression of this expression.
        Parameters:
        allowDots - whether the UTF-8 . is considered valid within a host label.
        Returns:
        the isVirtualHostableS3Bucket function expression.
      • parseUrl

        public Function parseUrl()
        Returns a parseUrl expression of this expression.
        Returns:
        the parseUrl function expression.
      • template

        public java.lang.String template()
        Converts this expression to a string template. By default this implementation returns a RuntimeException.
        Returns:
        the string template.