Class EagerExpressionResolver.EagerExpressionResult

    • Method Detail

      • toString

        public String toString()
        Returns a string representation of the resolved expression. If there are multiple, they will be separated by commas, but not surrounded with brackets.
        Overrides:
        toString in class Object
        Returns:
        String representation of the result.
      • toString

        public String toString​(boolean forOutput)
        When forOutput is true, the result will always be unquoted.
        Parameters:
        forOutput - Whether the result is going to be included in the final output, such as in an expression, or not such as when reconstructing tags.
        Returns:
        String representation of the result
      • toList

        public List<?> toList()
      • isFullyResolved

        public boolean isFullyResolved()
      • getDeferredWords

        public Set<String> getDeferredWords()
      • fromString

        public static EagerExpressionResolver.EagerExpressionResult fromString​(String resolvedString)
        Method to wrap a string value in the EagerExpressionResult class. It is not evaluated, rather it's allows a the class to be manually built from a partially resolved string.
        Parameters:
        resolvedString - Partially resolved string to wrap.
        Returns:
        A EagerExpressionResult that toString() returns resolvedString.
      • fromSupplier

        public static EagerExpressionResolver.EagerExpressionResult fromSupplier​(Supplier<String> stringSupplier,
                                                                                 JinjavaInterpreter interpreter)
        Method to supply a string value to the EagerExpressionResult class. In the event that a DeferredValueException is thrown, the message will be the wrapped value, and the resolutionState will be NONE Manually provide whether the string has been fully resolved.
        Parameters:
        stringSupplier - Supplier function to run, which could potentially throw a DeferredValueException.
        interpreter - The JinjavaInterpreter
        Returns:
        A EagerExpressionResult that wraps either stringSupplier.get() or the thrown DeferredValueException's message.