Class ConditionalTagHandler

java.lang.Object
com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.BaseTagHandler
com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.ConditionalTagHandler
All Implemented Interfaces:
SqlTagHandler
Direct Known Subclasses:
IsEmptyTagHandler, IsEqualTagHandler, IsGreaterEqualTagHandler, IsGreaterThanTagHandler, IsLessEqualTagHandler, IsLessThanTagHandler, IsNullTagHandler, IsParameterPresentTagHandler, IsPropertyAvailableTagHandler

public abstract class ConditionalTagHandler extends BaseTagHandler
The Class ConditionalTagHandler.
  • Field Details

    • NOT_COMPARABLE

      public static final long NOT_COMPARABLE
      The Constant NOT_COMPARABLE.
      See Also:
  • Constructor Details

    • ConditionalTagHandler

      public ConditionalTagHandler()
  • Method Details

    • isCondition

      public abstract boolean isCondition(SqlTagContext ctx, SqlTag tag, Object parameterObject)
      Checks if is condition.
      Parameters:
      ctx - the ctx
      tag - the tag
      parameterObject - the parameter object
      Returns:
      true, if is condition
    • doStartFragment

      public int doStartFragment(SqlTagContext ctx, SqlTag tag, Object parameterObject)
      Description copied from interface: SqlTagHandler
      Do start fragment.
      Specified by:
      doStartFragment in interface SqlTagHandler
      Overrides:
      doStartFragment in class BaseTagHandler
      Parameters:
      ctx - the ctx
      tag - the tag
      parameterObject - the parameter object
      Returns:
      the int
    • doEndFragment

      public int doEndFragment(SqlTagContext ctx, SqlTag tag, Object parameterObject, StringBuilder bodyContent)
      Description copied from interface: SqlTagHandler
      Do end fragment.
      Specified by:
      doEndFragment in interface SqlTagHandler
      Overrides:
      doEndFragment in class BaseTagHandler
      Parameters:
      ctx - the ctx
      tag - the tag
      parameterObject - the parameter object
      bodyContent - the body content
      Returns:
      the int
    • compare

      protected long compare(SqlTagContext ctx, SqlTag tag, Object parameterObject)
      Compare.
      Parameters:
      ctx - the ctx
      tag - the tag
      parameterObject - the parameter object
      Returns:
      the long
    • compareValues

      protected long compareValues(Class type, Object value1, Object value2)
      Compare values.
      Parameters:
      type - the type
      value1 - the value 1
      value2 - the value 2
      Returns:
      the long
    • convertValue

      protected Object convertValue(Class type, String value)
      Convert value.
      Parameters:
      type - the type
      value - the value
      Returns:
      the object
    • getResolvedProperty

      protected String getResolvedProperty(SqlTagContext ctx, SqlTag tag)
      This method will add the proper index values to an indexed property string if we are inside an iterate tag.
      Parameters:
      ctx - the ctx
      tag - the tag
      Returns:
      the resolved property