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 Details

    • QueryStringBuilder

      public QueryStringBuilder(String template)
      Creates a new builder from the given template.
      Parameters:
      template -
  • Method Details

    • 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 $invalid input: '<'...> 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)