Class UrlFragment


  • public class UrlFragment
    extends Object
    Encapsulates the JavaScripts used to edit the URL fragment in the browser.
    Author:
    Martin Knopf
    • Method Detail

      • set

        public UrlFragment set​(Object urlFragment)
        Sets the value of window.location.hash to the given String.
        Parameters:
        urlFragment - JS function to handle location hash
        Returns:
        this for chaining
      • set

        public UrlFragment set​(String parameterName,
                               Object parameterValue)
        Sets the value of window.location.hash to the given key-value-pair.
        Parameters:
        parameterName - the name to be set
        parameterValue - the value of the parameter being set
        Returns:
        this for chaining
      • putParameter

        public UrlFragment putParameter​(String parameterName,
                                        Object parameterValue)
        Puts the given key-value-pair into window.location.hash.
        Parameters:
        parameterName - the name to be set
        parameterValue - the value of the parameter being set
        Returns:
        this for chaining
      • putParameter

        public UrlFragment putParameter​(String parameterName,
                                        Object parameterValue,
                                        String valueDelimiter)
        Puts the given key-value-pair into window.location.hash. If the key already exists the value will be appended to the existing value with the given delimiter.
        Parameters:
        parameterName - the name to be set
        parameterValue - the value of the parameter being set
        valueDelimiter - parameter value delimiter to set multiple values
        Returns:
        this for chaining
      • removeParameter

        public UrlFragment removeParameter​(String parameterName)
        Removes the key-value-pair from window.location.hash that is identified by the given parameter name.
        Parameters:
        parameterName - the name to be removed
        Returns:
        this for chaining