Class Keyword

java.lang.Object
com.jk.data.dynamic.query.Keyword
All Implemented Interfaces:
QueryComponent

public class Keyword extends Object implements QueryComponent
This class represents a query component that defines common keywords used in query construction.

It implements the QueryComponent interface.

Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Field Details

    • SELECT

      public static final QueryComponent SELECT
      Represents the SELECT keyword.
    • FROM

      public static final QueryComponent FROM
      Represents the FROM keyword.
    • AND

      public static final QueryComponent AND
      Represents the AND keyword.
    • OR

      public static final QueryComponent OR
      Represents the OR keyword.
    • LEFT_JOIN

      public static final QueryComponent LEFT_JOIN
      Represents the LEFT JOIN keyword.
    • RIGHT_JOIN

      public static final QueryComponent RIGHT_JOIN
      Represents the RIGHT JOIN keyword.
    • WHERE

      public static final QueryComponent WHERE
      Represents the WHERE keyword.
    • INSERT

      public static final QueryComponent INSERT
      Represents the INSERT keyword.
    • VALUES

      public static final QueryComponent VALUES
      Represents the VALUES keyword.
    • INTO

      public static final QueryComponent INTO
      Represents the INTO keyword.
    • COMMA

      public static final QueryComponent COMMA
      Represents the comma keyword.
    • VARIABLE

      public static final QueryComponent VARIABLE
      Represents the variable keyword.
    • LEFT_PARENTHESES

      public static final QueryComponent LEFT_PARENTHESES
      Represents the left parentheses keyword.
    • RIGHT_PARENTHESES

      public static final QueryComponent RIGHT_PARENTHESES
      Represents the right parentheses keyword.
    • SEMICOLON

      public static final QueryComponent SEMICOLON
      Represents the semicolon keyword.
  • Constructor Details

    • Keyword

      public Keyword()
      This method constructs a new Keyword.
    • Keyword

      public Keyword(String name)
      This method constructs a new Keyword with the specified name.
      Parameters:
      name - Specifies the name of the keyword.
    • Keyword

      public Keyword(String name, boolean inline)
      This method constructs a new Keyword with the specified name and in-line setting.
      Parameters:
      name - Specifies the name of the keyword.
      inline - Indicates whether the keyword should be rendered in-line in the query or not.
  • Method Details

    • getName

      public String getName()
      This method gets the name of the keyword.
      Returns:
      the keyword name.
    • isInline

      public boolean isInline()
      This method determines whether the query component should be rendered in-line in the query structure (true) or not (false).
      Specified by:
      isInline in interface QueryComponent
      Returns:
      true, if the component is in-line, false otherwise.
    • setInline

      public void setInline(boolean inline)
      This method sets whether the keyword should be rendered in-line in the query or not.
      Parameters:
      inline - Indicates whether the keyword should be rendered in-line in the query (true) or not (false).
    • setName

      public void setName(String name)
      This method sets the keyword name to the provided one.
      Parameters:
      name - Specifies the new keyword name.
    • toQueryElement

      public Object toQueryElement()
      This method converts the query component into a query element that can be included in the query structure.
      Specified by:
      toQueryElement in interface QueryComponent
      Returns:
      the query element, which can be a string or any appropriate object representation.