Package com.jk.data.dynamic.query
Class Keyword
java.lang.Object
com.jk.data.dynamic.query.Keyword
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final QueryComponent
Represents the AND keyword.static final QueryComponent
Represents the comma keyword.static final QueryComponent
Represents the FROM keyword.static final QueryComponent
Represents the INSERT keyword.static final QueryComponent
Represents the INTO keyword.static final QueryComponent
Represents the LEFT JOIN keyword.static final QueryComponent
Represents the left parentheses keyword.static final QueryComponent
Represents the OR keyword.static final QueryComponent
Represents the RIGHT JOIN keyword.static final QueryComponent
Represents the right parentheses keyword.static final QueryComponent
Represents the SELECT keyword.static final QueryComponent
Represents the semicolon keyword.static final QueryComponent
Represents the VALUES keyword.static final QueryComponent
Represents the variable keyword.static final QueryComponent
Represents the WHERE keyword. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
This method gets the name of the keyword.boolean
isInline()
This method determines whether the query component should be rendered in-line in the query structure (true) or not (false).void
setInline
(boolean inline) This method sets whether the keyword should be rendered in-line in the query or not.void
This method sets the keyword name to the provided one.This method converts the query component into a query element that can be included in the query structure.
-
Field Details
-
SELECT
Represents the SELECT keyword. -
FROM
Represents the FROM keyword. -
AND
Represents the AND keyword. -
OR
Represents the OR keyword. -
LEFT_JOIN
Represents the LEFT JOIN keyword. -
RIGHT_JOIN
Represents the RIGHT JOIN keyword. -
WHERE
Represents the WHERE keyword. -
INSERT
Represents the INSERT keyword. -
VALUES
Represents the VALUES keyword. -
INTO
Represents the INTO keyword. -
COMMA
Represents the comma keyword. -
VARIABLE
Represents the variable keyword. -
LEFT_PARENTHESES
Represents the left parentheses keyword. -
RIGHT_PARENTHESES
Represents the right parentheses keyword. -
SEMICOLON
Represents the semicolon keyword.
-
-
Constructor Details
-
Keyword
public Keyword()This method constructs a newKeyword
. -
Keyword
This method constructs a newKeyword
with the specified name.- Parameters:
name
- Specifies the name of the keyword.
-
Keyword
This method constructs a newKeyword
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
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 interfaceQueryComponent
- 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
This method sets the keyword name to the provided one.- Parameters:
name
- Specifies the new keyword name.
-
toQueryElement
This method converts the query component into a query element that can be included in the query structure.- Specified by:
toQueryElement
in interfaceQueryComponent
- Returns:
- the query element, which can be a string or any appropriate object representation.
-