Class ImportELResolver

java.lang.Object
jakarta.el.ELResolver
jakarta.servlet.jsp.el.ImportELResolver

public class ImportELResolver extends ELResolver
Defines variable resolution behavior for Class imports and static imports.
Since:
JSP 3.1
  • Constructor Details

    • ImportELResolver

      public ImportELResolver()
  • Method Details

    • getValue

      public Object getValue(ELContext context, Object base, Object property)
      If the base object is null, searches the Class and static imports for an import with the given name and returns it if an import exists with the given name.

      The propertyResolved property of the ELContext object must be set to true by this resolver before returning if an import is matched. If this property is not true after this method is called, the caller should ignore the return value.

      Specified by:
      getValue in class ELResolver
      Parameters:
      context - The context of this evaluation.
      base - Only null is handled by this resolver. Other values will result in an immediate return.
      property - The name of the import to resolve.
      Returns:
      If the propertyResolved property of ELContext was set to true, then the import; otherwise undefined.
      Throws:
      NullPointerException - if context is null
      ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
    • getType

      public Class<Object> getType(ELContext context, Object base, Object property)
      Always returns null since in normal usage ScopedAttributeELResolver will handle calls to ELResolver.getType(ELContext, Object, Object).
      Specified by:
      getType in class ELResolver
      Parameters:
      context - The context of this evaluation.
      base - Ignored
      property - Ignored
      Returns:
      Always null
      Throws:
      NullPointerException - if context is null
      ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
    • setValue

      public void setValue(ELContext context, Object base, Object property, Object val)
      Always a NO-OP since in normal usage ScopedAttributeELResolver will handle calls to ELResolver.setValue(ELContext, Object, Object, Object).
      Specified by:
      setValue in class ELResolver
      Parameters:
      context - The context of this evaluation.
      base - Ignored
      property - Ignored
      val - Ignored
      Throws:
      NullPointerException - if context is null.
      ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
    • isReadOnly

      public boolean isReadOnly(ELContext context, Object base, Object property)
      Always returns false since in normal usage ScopedAttributeELResolver will handle calls to ELResolver.isReadOnly(ELContext, Object, Object).
      Specified by:
      isReadOnly in class ELResolver
      Parameters:
      context - The context of this evaluation.
      base - Ignored
      property - Ignored
      Returns:
      Always false
      Throws:
      NullPointerException - if context is null.
      ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
    • getCommonPropertyType

      public Class<String> getCommonPropertyType(ELContext context, Object base)
      Always returns null since in normal usage ScopedAttributeELResolver will handle calls to ELResolver.getCommonPropertyType(ELContext, Object).
      Specified by:
      getCommonPropertyType in class ELResolver
      Parameters:
      context - Ignored
      base - Ignored
      Returns:
      Always null