Class ClausesFragment

java.lang.Object
overit.geocall.sql.code.fragment.Fragment
overit.geocall.sql.code.fragment.ClausesFragment

public class ClausesFragment extends Fragment
The class extends Fragment and aims to representing a sets of clauses, how field-value couples should be translated and how they should be separated (with a comma, with an 'AND' condition ecc.).
  • Field Details

    • _re

      protected Pattern[] _re
    • _separator

      protected String _separator
  • Constructor Details

    • ClausesFragment

      public ClausesFragment(String[] re, String separator)
      Creates a new ClausesFragment
      Parameters:
      re - Array of string with rhe regular expression
      separator - The separator
  • Method Details

    • appendTo

      public boolean appendTo(StringBuilder sb, String header, Criterion criterion, Map<String,Object> context)
      Description copied from class: Fragment
      This method is used to create the Fragment's SQL string.
      Specified by:
      appendTo in class Fragment
      Parameters:
      sb - The StringBuilder used to add the current piece (Fragment) of SQL cod, to create the complete SQL string.
      header - The string previus the Fragment's code.
      criterion - The Criterion, set by default, to apply.
      context - The input values to define the clauses of the sql string.
      Returns:
      true if there's a Fragment to add, false otherwise.