public abstract class

AbstractParameterBuilder

extends Object
implements ParameterBuilder
java.lang.Object
   ↳ com.microstrategy.web.platform.AbstractParameterBuilder
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

An abstract implementation for ParameterBuilder which stores all information supplied, but is unable to convert it to a string. Each subclass implements the toString and the isEmpty methods.

Summary

Fields
protected int _initialSize The initial size of the buffer to hold the ParameterBuilder contents...
protected NamespaceEncoder _namespaceEncoder A stored NamespaceEncoder instance which is managed by this class.aggregation clientCardinality 1 supplierCardinality 1
protected Parameters _parameters An array of key/value pairs that were added...
protected String _targetBase The Target Base
protected String _targetPrefix The Target Prefix
protected String _targetSuffix The Target Suffix
Public Constructors
AbstractParameterBuilder()
Public Methods
void addEventInfo(WebEvent event, int eventElements, int howMuchChildState)
Adds into the current object the event information in the format of key/value pairs.
void addParameter(String name, String value)
Add a name/value pair.
static boolean areAllBitsSet(int intVal, int bits)
Determines whether the specified integer value has set all its bits specified through the the parameter bits.
NamespaceEncoder getNamespaceEncoder()
The current NamespaceEncoder associated with this ParameterBuilder.
Iterator getParameters()
Return an iterator for the list of parameters.
String getTargetBase()
Returns the target base supplied to this ParameterBuilder via setTargetBase(String).
String getTargetPrefix()
Returns the target prefix supplied to this ParameterBuilder via setTargetPrefix(String).
String getTargetSuffix()
Returns the target suffix supplied to this ParameterBuilder via setTargetSuffix(String).
void init(Object parent)
Initializes this class by attaching up a namespace encoder (as provided by the parent).
static boolean isAnyBitSet(int intVal, int bits)
Determines whether the specified integer value has set any bit specified through the the parameter bits.
void setInitialSize(int chars)
The initial size of the ParameterBuilder in number of characters.
void setNamespaceEncoder(NamespaceEncoder nse)
Assign the supplied NamespaceEncoder to this ParameterBuilder instance.
void setTargetBase(String targetBase)
Specify a target base URI (for URL generation).
void setTargetPrefix(String targetPrefix)
Specifies a prefix string to appear before the Target Base.
void setTargetSuffix(String targetSuffix)
Specifies a suffix string to appear after the Target Base.
Protected Methods
void parseEntireURLStringFragment(String fragment)
This method parses a string fragment that is belived to contain an entire URL (base URI plus zero or more parameters).
void parseURLParameterFragment(String fragment)
This method parses a string fragment that is believed to contain only URL parameters ("...&key1=value1&...").
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.web.platform.ParameterBuilder

Fields

protected int _initialSize

The initial size of the buffer to hold the ParameterBuilder contents...

protected NamespaceEncoder _namespaceEncoder

A stored NamespaceEncoder instance which is managed by this class.aggregation clientCardinality 1 supplierCardinality 1

protected Parameters _parameters

An array of key/value pairs that were added...

protected String _targetBase

The Target Base

protected String _targetPrefix

The Target Prefix

protected String _targetSuffix

The Target Suffix

Public Constructors

public AbstractParameterBuilder ()

Public Methods

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

Adds into the current object the event information in the format of key/value pairs.

Parameters
event the event whose information to be added.
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 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 static boolean areAllBitsSet (int intVal, int bits)

Determines whether the specified integer value has set all its bits specified through the the parameter bits.

Parameters
intVal an integer value whose bits to be checked
bits the bits to check
Returns
  • true if all bits specified through the parameter bits are set in the specified integer value intVal.

public NamespaceEncoder getNamespaceEncoder ()

The current NamespaceEncoder associated with this ParameterBuilder.

Returns

public Iterator getParameters ()

Return an iterator for the list of parameters.

Returns
  • An iterator on the supplied parameters.

public 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 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 String getTargetSuffix ()

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

Returns

public void init (Object parent)

Initializes this class by attaching up a namespace encoder (as provided by the parent).

Parameters
parent The enclosing parent for this ParameterBuilder instance.

public static boolean isAnyBitSet (int intVal, int bits)

Determines whether the specified integer value has set any bit specified through the the parameter bits.

Parameters
intVal an integer value whose bits to be checked
bits the bits to check
Returns
  • true if any bit specified through the parameter bits is set in the specified integer value intVal.

public void setInitialSize (int chars)

The initial size of the ParameterBuilder in number of characters.

Parameters
chars A rough estimate of the total number of characters added in all key/value pairs.

public void setNamespaceEncoder (NamespaceEncoder nse)

Assign the supplied NamespaceEncoder to this ParameterBuilder instance.

Parameters
nse The NamespaceEncoder instance to use with this ParameterBuilder.

public 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 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 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.

Protected Methods

protected void parseEntireURLStringFragment (String fragment)

This method parses a string fragment that is belived to contain an entire URL (base URI plus zero or more parameters). If the base URI is found (which is any non-empty string before the first '?' character), then it is added via setTargetBase(String). The remaining string is parsed via parseURLParameterFragment(String).

Parameters
fragment A string representing a complete URL.

protected void parseURLParameterFragment (String fragment)

This method parses a string fragment that is believed to contain only URL parameters ("...&key1=value1&..."). The fragment is first tokenized by the ampersand character (to yield a key/value pair separated by '='). Next, each pair is tokenized by the equals sign and broken into a key and value. Each pair is then saved using addParameter(String, String).

Parameters
fragment A string representing a set of URL parameters.