001/* 002 * JKNIV, SQLegance keeping queries maintainable. 003 * 004 * Copyright (C) 2017, the original author or authors. 005 * 006 * This library is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 2.1 of the License. 010 * 011 * This library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with this library; if not, write to the Free Software Foundation, Inc., 018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 019 */ 020package net.sf.jkniv.sqlegance.params; 021 022/** 023 * No make the parser from sql parameter, used at tag without support like 024 * (<code>IncludeTag</code>, <code>ProcedureTag</code>, etc) 025 * 026 * @author alisson gomes 027 * 028 */ 029public class ParamParserNoMark implements ParamParser 030{ 031 private static final ParamParser emptyParser = new ParamParserNoMark(); 032 033 private ParamParserNoMark() 034 { 035 } 036 037 /** 038 * Empty parser from sql parameter 039 * @return implementation doesn't make the parser 040 */ 041 public static ParamParser emptyParser() { 042 return emptyParser; 043 } 044 045 @Override 046 public String[] find(String query) 047 { 048 return new String[0]; 049 } 050 051 @Override 052 public String replaceForPlaceholder(String query, Object params) 053 { 054 return query; 055 } 056 057 @Override 058 public String replaceForPlaceholderWithNumber(String query, Object params) 059 { 060 return query; 061 } 062 063 @Override 064 public String replaceForPlaceholder(String query) 065 { 066 return query; 067 } 068 069 @Override 070 public ParamMarkType getType() 071 { 072 return ParamMarkType.NO_MARK; 073 } 074 075 @Override 076 public String getPlaceholder() 077 { 078 return "?"; 079 } 080 081}