public interface

ParameterBuilder

com.microstrategy.web.platform.ParameterBuilder
Known Indirect Subclasses

Class Overview

This defines the interface between the WebEvent and the format that its content are persisted. For example, the contents of a WebEvent include:

  • The numeric event ID
  • The source of the event (a path from the root to the WebComponent)
  • A list of arguments that pertain to the event
  • A serialized set of states for all WebComponents
All or any of these elements can be serialized into one of several different forms. The two most common forms are:
  • As a URL
  • As a set of hidden input (used in the context of a larger FORM
This interface defines the minimum information that a WebEvent sends to persist an element of WebEvent information. Each different implementation of ParameterBuilder will choose to how to persist each name/value pair.

Summary

Public Methods
abstract void addEventInfo(WebEvent event, int eventElements, int howMuchChildState)
Add the event information, which is represented in key/value pairs.
abstract void addFragment(String fragment)
Add a fragment of key/value pairs.
abstract void addParameter(String name, String value)
Add a name/value pair.
abstract NamespaceEncoder getNamespaceEncoder()
Each ParameterBuilder instance is associated with a NamespaceEncoder instance that is may choose to use for encoding a namespace into the output form.
abstract String getTargetBase()
Returns the target base supplied to this ParameterBuilder via setTargetBase(String).
abstract String getTargetPrefix()
Returns the target prefix supplied to this ParameterBuilder via setTargetPrefix(String).
abstract String getTargetSuffix()
Returns the target suffix supplied to this ParameterBuilder via setTargetSuffix(String).
abstract void init(Object parent)
Initialize this object (supplying the parent object as the only parameter).
abstract boolean isEmpty()
This method returns true if no target base was added nor any parameters.
abstract void setInitialSize(int chars)
Set the initial size for this ParameterBuilder object.
abstract void setNamespaceEncoder(NamespaceEncoder nse)
This method can be used to set the NamespaceEncoder object used with this ParameterBuilder instance.
abstract void setTargetBase(String targetBase)
Specify a target base URI (for URL generation).
abstract void setTargetPrefix(String targetPrefix)
Specifies a prefix string to appear before the Target Base.
abstract void setTargetSuffix(String targetSuffix)
Specifies a suffix string to appear after the Target Base.
abstract String toString()
Get the entire collection of parameters as a string.

Public Methods

public abstract void addEventInfo (WebEvent event, int eventElements, int howMuchChildState)

Add the event information, which is represented in key/value pairs.

Parameters
event the event to add.
eventElements A bit mask value composed of constants from EnumEventElement. These determine what elements of the event is added.
howMuchChildState If children state is to be added, this parameter (whose values come from * EnumWebPersistableState) determines how much state.

public abstract void addFragment (String fragment)

Add a fragment of key/value pairs. This method is discouraged as it requires parsing of the incoming string fragment. It is preferable to use addParameter(String, String). It is the responsibility of each ParameterBuilder implementation to determine how to parse this fragment.

Parameters
fragment A string fragment which must be parsed for a sequence of key/value pairs.

public abstract void addParameter (String name, String value)

Add a name/value pair.

Parameters
name The name of a WebEvent element.
value The value of a WebEvent element.

public abstract NamespaceEncoder getNamespaceEncoder ()

Each ParameterBuilder instance is associated with a NamespaceEncoder instance that is may choose to use for encoding a namespace into the output form. This method returns that object instance.

Returns

public abstract String getTargetBase ()

Returns the target base supplied to this ParameterBuilder via setTargetBase(String). If none was supplied, then this method returns null.

Returns
  • The value supplied by the caller in the last call to setTargetBase(String). If never called, it returns null.

public abstract String getTargetPrefix ()

Returns the target prefix supplied to this ParameterBuilder via setTargetPrefix(String). If none was supplied, then this method returns null. A prefix is often to use to prepend an absolute path to a relative one. If supplied, it will be added directly before the target base.

Returns

public abstract String getTargetSuffix ()

Returns the target suffix supplied to this ParameterBuilder via setTargetSuffix(String). If none was supplied, then this method returns null.

Returns

public abstract void init (Object parent)

Initialize this object (supplying the parent object as the only parameter).

Parameters
parent The parent (enclosing) object that this Parameter Builder is attached to.

public abstract boolean isEmpty ()

This method returns true if no target base was added nor any parameters. It is not related to whether a target prefix/suffix was added. It is identical to asking whether the returned string (if requested now) would return empty or not.

Returns
  • Whether the ParameterBuilder object is essentially empty or not.

public abstract void setInitialSize (int chars)

Set the initial size for this ParameterBuilder object. Each implementation may choose to use this method to efficiently size the ParameterBuilder to support a set of key/value pairs whose total number of characters is supplied as the input parameter.

Parameters
chars A rough estimate of the total number of key/value characters to be submitted by the caller.

public abstract void setNamespaceEncoder (NamespaceEncoder nse)

This method can be used to set the NamespaceEncoder object used with this ParameterBuilder instance.

Parameters
nse The NamespaceEncoder object to be used with this ParameterBuilder.

public abstract void setTargetBase (String targetBase)

Specify a target base URI (for URL generation). In the event that this ParameterBuilder is used to build a URI, then the supplied string should be used as the base URI (with all key/value pairs added after an initial '?'). This method works in conjunction with setTargetPrefix(String) and setTargetSuffix(String). When a string form of the ParameterBuilder object is requested (via #toString), then targetURI (if present) is added to the string along with a prefix or suffix. If a target was not supplied, then neither prefix or suffix will be added to the string (even if they are non-empty).

Parameters
targetBase The base URI to be used for this set of key/value pairs.

public abstract void setTargetPrefix (String targetPrefix)

Specifies a prefix string to appear before the Target Base. A prefix is often to use to prepend an absolute path to a relative one. If supplied, it will be added directly before the target base (without any other characters). This string is not added if the TargetBase has not been explicitly set.

Parameters
targetPrefix A string to be prepended to the Target Base.

public abstract void setTargetSuffix (String targetSuffix)

Specifies a suffix string to appear after the Target Base. A suffix is often to use to append extra path information or extra parameters (e.g., ";key=value"). If supplied, it will be added directly after the target base (without any other characters). This string is not added if the TargetBase has not been explicitly set.

Parameters
targetSuffix A string to be appended to the Target Base.

public abstract String toString ()

Get the entire collection of parameters as a string.

Returns