Package org.eclipse.rdf4j.workbench.util

## Class QueryStringBuilder

- java.lang.Object
- - org.eclipse.rdf4j.workbench.util.QueryStringBuilder

-     public class QueryStringBuilder
      extends Object

  Helper class for substituting in variables to query templates for the purpose of saving and retrieving user queries to a repository local to the workbench.
  Author:
    Dale Visser

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QueryStringBuilder​(String template)` | Creates a new builder from the given template.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected static String` | `quote​(String value, String left, String right)` |
    `protected void` | `replace​(String paramText, String newText)` | Replace instances of the old text with a copy of the new text.
    `protected void` | `replaceQuote​(String paramText, String newText)` |
    `protected void` | `replaceURI​(String paramText, Object uri)` | Replace the repository variable with the current repository URL.
    `String` | `toString()` | Returns the internal string being constructed.
    `protected static String` | `xsdQuote​(String value, String type)` | Place double quotes around the given string and append an XSD data type.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### QueryStringBuilder

          public QueryStringBuilder​(String template)

      Creates a new builder from the given template.
      Parameters:
        `template` -

  - ### Method Detail

    - #### toString

          public String toString()

      Returns the internal string being constructed.
      Overrides:
        `toString` in class `Object`

    - #### replaceURI

          protected void replaceURI​(String paramText,
                                    Object uri)

      Replace the repository variable with the current repository URL.
      Parameters:
        `paramText` - the $<...> formatted parameter name
        `uri` - any object who's toString() returns a valid URI

    - #### replace

          protected void replace​(String paramText,
                                 String newText)

      Replace instances of the old text with a copy of the new text.
      Parameters:
        `paramText` - parameter in the form "$"
        `newText` - the new text

    - #### replaceQuote

          protected void replaceQuote​(String paramText,
                                      String newText)

    - #### xsdQuote

          protected static String xsdQuote​(String value,
                                           String type)

      Place double quotes around the given string and append an XSD data type.
      Parameters:
        `value` - the value to quote
        `type` - the XSD data type name
      Returns:
        a copy of the given string quoted with XSD data type appended

    - #### quote

          protected static String quote​(String value,
                                        String left,
                                        String right)