Skip to content
Snippets Groups Projects
Commit b8138111 authored by gmantele's avatar gmantele
Browse files

[ADQL] Allow modification of JDBCTranslator.appendIdentifier(., ., boolean).

This function was originally static. Since no other classes benefits of this
static state, this function is no longer static. This might however raise a
small incompatibility for the users of the library which used it.
parent 9a0f1022
Branches
No related tags found
No related merge requests found
...@@ -16,14 +16,13 @@ package adql.translator; ...@@ -16,14 +16,13 @@ package adql.translator;
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>. * along with ADQLLibrary. If not, see <http://www.gnu.org/licenses/>.
* *
* Copyright 2015 - Astronomisches Rechen Institut (ARI) * Copyright 2015-2016 - Astronomisches Rechen Institut (ARI)
*/ */
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import tap.data.DataReadException;
import adql.db.DBColumn; import adql.db.DBColumn;
import adql.db.DBTable; import adql.db.DBTable;
import adql.db.DBType; import adql.db.DBType;
...@@ -78,6 +77,7 @@ import adql.query.operand.function.geometry.IntersectsFunction; ...@@ -78,6 +77,7 @@ import adql.query.operand.function.geometry.IntersectsFunction;
import adql.query.operand.function.geometry.PointFunction; import adql.query.operand.function.geometry.PointFunction;
import adql.query.operand.function.geometry.PolygonFunction; import adql.query.operand.function.geometry.PolygonFunction;
import adql.query.operand.function.geometry.RegionFunction; import adql.query.operand.function.geometry.RegionFunction;
import tap.data.DataReadException;
/** /**
* <p>Implementation of {@link ADQLTranslator} which translates ADQL queries in SQL queries.</p> * <p>Implementation of {@link ADQLTranslator} which translates ADQL queries in SQL queries.</p>
...@@ -167,7 +167,7 @@ import adql.query.operand.function.geometry.RegionFunction; ...@@ -167,7 +167,7 @@ import adql.query.operand.function.geometry.RegionFunction;
* </p> * </p>
* *
* @author Gr&eacute;gory Mantelet (ARI) * @author Gr&eacute;gory Mantelet (ARI)
* @version 1.4 (09/2015) * @version 1.4 (04/2016)
* @since 1.4 * @since 1.4
* *
* @see PostgreSQLTranslator * @see PostgreSQLTranslator
...@@ -294,13 +294,26 @@ public abstract class JDBCTranslator implements ADQLTranslator { ...@@ -294,13 +294,26 @@ public abstract class JDBCTranslator implements ADQLTranslator {
} }
/** /**
* Appends the given identifier in the given StringBuffer. * <p>Appends the given identifier in the given StringBuffer.</p>
*
* <p>
* This function just call {@link #appendIdentifier(StringBuffer, String, boolean)}
* with the same 2 first parameters. The third one is the result of:
* <code>{@link #isCaseSensitive(IdentifierField) isCaseSensitive(field)}</code>.
* </p>
*
* <p><i>Note:
* In order to keep a consistent output of the <code>appendIdentifier(...)</code> functions,
* this function can not be overwritten ; it is just a shortcut function.
* </i></p>
* *
* @param str The string buffer. * @param str The string buffer.
* @param id The identifier to append. * @param id The identifier to append.
* @param field The type of identifier (column, table, schema, catalog or alias ?). * @param field The type of identifier (column, table, schema, catalog or alias ?).
* *
* @return The string buffer + identifier. * @return The string buffer + identifier.
*
* @see #appendIdentifier(StringBuffer, String, boolean)
*/ */
public final StringBuffer appendIdentifier(final StringBuffer str, final String id, final IdentifierField field){ public final StringBuffer appendIdentifier(final StringBuffer str, final String id, final IdentifierField field){
return appendIdentifier(str, id, isCaseSensitive(field)); return appendIdentifier(str, id, isCaseSensitive(field));
...@@ -315,7 +328,7 @@ public abstract class JDBCTranslator implements ADQLTranslator { ...@@ -315,7 +328,7 @@ public abstract class JDBCTranslator implements ADQLTranslator {
* *
* @return The string buffer + identifier. * @return The string buffer + identifier.
*/ */
public static final StringBuffer appendIdentifier(final StringBuffer str, final String id, final boolean caseSensitive){ public StringBuffer appendIdentifier(final StringBuffer str, final String id, final boolean caseSensitive){
if (caseSensitive) if (caseSensitive)
return str.append('"').append(id).append('"'); return str.append('"').append(id).append('"');
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment