Class 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 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