Package net.sf.jkniv.sqlegance.params
Class AbstractParamParser
- java.lang.Object
-
- net.sf.jkniv.sqlegance.params.AbstractParamParser
-
- All Implemented Interfaces:
ParamParser
- Direct Known Subclasses:
ParamParserColonMark,ParamParserDollarMark,ParamParserHashMark,ParamParserQuestionMark
public abstract class AbstractParamParser extends Object implements ParamParser
- Since:
- 0.6.0
- Author:
- Alisson Gomes
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlogprotected static StringREGEX_COLON_MARKprotected static StringREGEX_DOLLAR_MARKprotected static StringREGEX_HASH_MARKprotected static StringREGEX_INprotected static StringREGEX_QUESTION_MARKprotected static StringREGEX_SINGLE_QUOTE
-
Constructor Summary
Constructors Constructor Description AbstractParamParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object[]getParamsClauseIN(Object params, String name)StringgetPlaceholder()Specifies a character that will be replaced to in SQL query.protected Stringpadspace(int size, int index)StringreplaceForPlaceholder(String query)Replace the parameters names for question marksStringreplaceForPlaceholder(String query, Object params)Replace the parameters names for question marksStringreplaceForPlaceholderWithNumber(String query, Object params)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jkniv.sqlegance.params.ParamParser
find, getType
-
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
REGEX_SINGLE_QUOTE
protected static final String REGEX_SINGLE_QUOTE
- See Also:
- Constant Field Values
-
REGEX_IN
protected static final String REGEX_IN
- See Also:
- Constant Field Values
-
REGEX_HASH_MARK
protected static final String REGEX_HASH_MARK
- See Also:
- Constant Field Values
-
REGEX_COLON_MARK
protected static final String REGEX_COLON_MARK
- See Also:
- Constant Field Values
-
REGEX_DOLLAR_MARK
protected static final String REGEX_DOLLAR_MARK
- See Also:
- Constant Field Values
-
REGEX_QUESTION_MARK
protected static final String REGEX_QUESTION_MARK
- See Also:
- Constant Field Values
-
-
Method Detail
-
replaceForPlaceholder
public String replaceForPlaceholder(String query)
Description copied from interface:ParamParserReplace the parameters names for question marks- Specified by:
replaceForPlaceholderin interfaceParamParser- Parameters:
query- the SQL sentence- Returns:
- the new SQL sentence with question marks.
-
replaceForPlaceholderWithNumber
public String replaceForPlaceholderWithNumber(String query, Object params)
- Specified by:
replaceForPlaceholderWithNumberin interfaceParamParser
-
replaceForPlaceholder
public String replaceForPlaceholder(String query, Object params)
Description copied from interface:ParamParserReplace the parameters names for question marks- Specified by:
replaceForPlaceholderin interfaceParamParser- Parameters:
query- the SQL sentenceparams- parameters used at query, its necessary when the query use IN clause- Returns:
- the new SQL sentence with question marks.
-
getPlaceholder
public String getPlaceholder()
Description copied from interface:ParamParserSpecifies a character that will be replaced to in SQL query. Default is?- Specified by:
getPlaceholderin interfaceParamParser- Returns:
- the place holder from parser
-
padspace
protected String padspace(int size, int index)
-
-