Enum Class QuoteStrategy

java.lang.Object
java.lang.Enum<QuoteStrategy>
org.firebirdsql.jdbc.QuoteStrategy
All Implemented Interfaces:
Serializable, Comparable<QuoteStrategy>, Constable

@InternalApi public enum QuoteStrategy extends Enum<QuoteStrategy>
Strategy for quoting object names and literals (or no quoting of object names in the case of dialect 1).

This class is internal API of Jaybird. Future versions may radically change, move, or make inaccessible this type.

Since:
2.2
  • Enum Constant Details

    • DIALECT_1

      public static final QuoteStrategy DIALECT_1
      Dialect 1 doesn't support quoting of object names, and uses double quotes for literals.
      Since:
      6
    • DIALECT_3

      public static final QuoteStrategy DIALECT_3
      Dialect 3 (and 2) supports quoting of object names, and uses single quotes for literals.
      Since:
      6
    • NO_QUOTES

      @Deprecated(since="6", forRemoval=true) public static final QuoteStrategy NO_QUOTES
      Deprecated, for removal: This API element is subject to removal in a future version.
      Will be removed in Jaybird 7, use DIALECT_1 instead
      Basically an alias for DIALECT_1 for backwards compatibility.
    • QUOTES

      @Deprecated(since="6", forRemoval=true) public static final QuoteStrategy QUOTES
      Deprecated, for removal: This API element is subject to removal in a future version.
      Will be removed in Jaybird 7, use DIALECT_3 instead
      Basically an alias for DIALECT_3 for backwards compatibility.
  • Method Details

    • values

      public static QuoteStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static QuoteStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • appendQuoted

      public abstract StringBuilder appendQuoted(String objectName, StringBuilder sb)
      Appends the objectName with (or in the case of dialect 1: without) quotes to sb.
      Parameters:
      objectName - The object name to append
      sb - StringBuilder for appending
      Returns:
      The StringBuilder for method chaining
    • quoteObjectName

      public abstract String quoteObjectName(String objectName)
      Returns the object name appropriately quoted according to this quote strategy.
      Parameters:
      objectName - The object name
      Returns:
      The transformed object name
      Since:
      3.0.6
    • appendLiteral

      public abstract StringBuilder appendLiteral(String value, StringBuilder sb)
      Appends value as a CHAR literal with the right quotes and escaping for this quote strategy to sb.
      Parameters:
      value - The value to append as a literal
      sb - StringBuilder for appending
      Returns:
      The StringBuilder for method chaining
      Since:
      6
    • quoteLiteral

      public String quoteLiteral(String value)
      Returns value as a CHAR literal with the right quotes and escaping for this quote strategy.
      Parameters:
      value - The value to append as a literal
      Returns:
      The transformed value as a literal
      Since:
      6
    • forDialect

      public static QuoteStrategy forDialect(int dialect)
      Obtain the QuoteStrategy for the specified dialect.
      Parameters:
      dialect - Dialect
      Returns:
      Appropriate QuoteStrategy