org.netbeans.modules.db/1 1.44.1 30

org.netbeans.api.db.sql.support
Class SQLIdentifiers.Quoter

java.lang.Object
  extended by org.netbeans.api.db.sql.support.SQLIdentifiers.Quoter
Enclosing class:
SQLIdentifiers

public abstract static class SQLIdentifiers.Quoter
extends Object

This is a utility class that is used to quote identifiers.


Method Summary
 String getQuoteString()
           
abstract  String quoteAlways(String identifier)
          Quotes an SQL identifier, even if the quoteIfNeeded(java.lang.String) method would not have quoted it.
abstract  String quoteIfNeeded(String identifier)
          Quotes an SQL identifier if needed.
 String unquote(String identifier)
          Unquotes an identifier if it is quoted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

quoteIfNeeded

public abstract String quoteIfNeeded(String identifier)
Quotes an SQL identifier if needed.

Anyone generating SQL that will be visible and/or editable by the user should use this method. This helps to avoid unecessary quoting, which affects the readability and clarity of the resulting SQL.

An identifier needs to be quoted if one of the following is true:

Parameters:
identifier - a SQL identifier. Can not be null.
Returns:
the identifier, quoted if needed.

quoteAlways

public abstract String quoteAlways(String identifier)
Quotes an SQL identifier, even if the quoteIfNeeded(java.lang.String) method would not have quoted it.

Parameters:
identifier - a SQL identifier. Can not be null.
Returns:
the quoted identifier.
Since:
1.29

unquote

public String unquote(String identifier)
Unquotes an identifier if it is quoted.

Parameters:
identifier - a SQL identifier. Can not be null.
Returns:
the unquoted identifier.
Since:
1.29

getQuoteString

public String getQuoteString()

org.netbeans.modules.db/1 1.44.1 30

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.