org.springframework.expression.spel.ast

Class Operator.DescriptorComparison

  • java.lang.Object
    • org.springframework.expression.spel.ast.Operator.DescriptorComparison
  • Enclosing class:
    Operator


    protected static final class Operator.DescriptorComparison
    extends java.lang.Object
    A descriptor comparison encapsulates the result of comparing descriptor for two operands and describes at what level they are compatible.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static Operator.DescriptorComparison checkNumericCompatibility(java.lang.String leftDeclaredDescriptor, java.lang.String rightDeclaredDescriptor, java.lang.String leftActualDescriptor, java.lang.String rightActualDescriptor)
      Return an object that indicates whether the input descriptors are compatible.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkNumericCompatibility

        public static Operator.DescriptorComparison checkNumericCompatibility(@Nullable
                                                                              java.lang.String leftDeclaredDescriptor,
                                                                              @Nullable
                                                                              java.lang.String rightDeclaredDescriptor,
                                                                              @Nullable
                                                                              java.lang.String leftActualDescriptor,
                                                                              @Nullable
                                                                              java.lang.String rightActualDescriptor)
        Return an object that indicates whether the input descriptors are compatible.

        A declared descriptor is what could statically be determined (e.g. from looking at the return value of a property accessor method) whilst an actual descriptor is the type of an actual object that was returned, which may differ.

        For generic types with unbound type variables, the declared descriptor discovered may be 'Object' but from the actual descriptor it is possible to observe that the objects are really numeric values (e.g. ints).

        Parameters:
        leftDeclaredDescriptor - the statically determinable left descriptor
        rightDeclaredDescriptor - the statically determinable right descriptor
        leftActualDescriptor - the dynamic/runtime left object descriptor
        rightActualDescriptor - the dynamic/runtime right object descriptor
        Returns:
        a DescriptorComparison object indicating the type of compatibility, if any