pureweb. util

The util namespace provides methods and classes of general utility.

Method Summary

configureLogging
Configures the logger with a logConfig object.
getNumericStyleProperty
Returns the property of the CSS element as a number.
getPureWebDateString
Converts Native date objects which only output to Non-UTC ISO, and returns A UTC ISO 8601 string conversion of the given date.
getTagContent
Returns the text content of the XML node for the specified tag name, given a string containing XML.
parseBoolean
Parses a string, returning a primitive Boolean value of true or false.
parseNumber
Parses the specified string, returning a primitive number value.
startLogging
Sets up a logging console to receive log messages.
tryParse
Returns the native JS format based on a value and a type.

Classes

CommandFilter
DefaultCommandFilter

Namespaces

guidUtil
jsonConverter
stringUtil

Members

<static> CommandFilterFlags

An enumeration of commands types that may be filtered by a CommandFilter instance.
Properties:
Name Type Default Description
NONE number 0 Do not filter any commands.
REDUNDANT_INPUT_EVENTS number 1 Filter redundant input commands.
REDUNDANT_RESIZE_EVENTS number 2 Filter redundant resize commands
REDUNDANT_PINGS number 4 Filter redundant ping command.

<static> loggingLevel → number

An enumeration of the valid logging levels supported by PureWeb.
Properties:
Name Type Default Description
ALL number goog.debug.Logger.Level.ALL ALL indicates that all messages should be logged
FINEST number goog.debug.Logger.Level.FINEST FINEST indicates a highly detailed tracing message.
FINER number goog.debug.Logger.Level.FINER FINER indicates a fairly detailed tracing message.
FINE number goog.debug.Logger.Level.FINE FINE is a message level providing tracing information.
CONFIG number goog.debug.Logger.Level.CONFIG CONFIG is a message level for static configuration messages.
INFO number goog.debug.Logger.Level.INFO INFO is a message level for informational messages.
WARNING number goog.debug.Logger.Level.WARNING WARNING is a message level indicating a potential problem.
SEVERE number goog.debug.Logger.Level.SEVERE SEVERE is a message level indicating a serious failure.
SHOUT number goog.debug.Logger.Level.SHOUT SHOUT is a message level for extra debugging loudness.
OFF number goog.debug.Logger.Level.OFF OFF is a special level that can be used to turn off logging.

Method Detail

<static> configureLogging(logConfig)

Configures the logger with a logConfig object.
Parameters:
Name Type Description
logConfig Object A collection of name/value pairs.

<static> getNumericStyleProperty(style, prop) → {number}

Returns the property of the CSS element as a number.
Parameters:
Name Type Description
style Object The style object of a DOM element.
prop string The property you want to get.
Throws:
pureweb.NullArgumentException

<static> getPureWebDateString(date) → {string}

Converts Native date objects which only output to Non-UTC ISO, and returns A UTC ISO 8601 string conversion of the given date. This is necessary because PureWeb accepts date strings in UTC ISO 8601 format.
Parameters:
Name Type Description
date Date The date we're trying to convert.
Throws:

<static> getTagContent(tagName, xmlString, opt_idx) → {string}

Returns the text content of the XML node for the specified tag name, given a string containing XML. Will return null if the tag name doesn't exist.
For example, getTagContent('name', 'Fred') will return 'Fred'.
Parameters:
Name Type Argument Description
tagName string The name of the tag, without angle brackets.
xmlString string The XML string containing the open and closing tags, as well as the content.
opt_idx number <optional>
The nth occurrence of the tag in the XML document; defaults to 0.

<static> parseBoolean(value) → {boolean}

Parses a string, returning a primitive Boolean value of true or false. Interprets null as false.
Parameters:
Name Type Argument Description
value string <nullable>
The string to be converted to a Boolean value.

<static> parseNumber(value) → {number}

Parses the specified string, returning a primitive number value.
Parameters:
Name Type Argument Description
value string <nullable>
The string to be converted to a Boolean value.

<static> startLogging()

Sets up a logging console to receive log messages.

<static> tryParse(value, type) → {*}

Returns the native JS format based on a value and a type. Will return null if no conversion was possible.
Parameters:
Name Type Argument Description
value string <nullable>
The value to parse.
type function The constructor function for the type to convert into. Note that Boolean (object) will return a boolean (primitive); Number (object) will return a number (primitive).
Throws:
pureweb.NullArgumentException