Last updated

API / geotoolkit / report / parsers / Utils / Utils

Class: Utils

parsers.Utils.Utils

Helper class for the Report parsers utils The class Utils contains common Parser utils

Table of contents

Constructors
Methods

Contents

Constructors

new Utils()

new Utils()

Methods

getClassName

getClassName(): string

Returns

string


getAttribute

Static getAttribute(node, attrName, defaultValue?): string

Extracts requested attribute from provided node

Parameters

Name Type Description
nodeNodeXML node
attrNamestringThe name of attribute to obtain
Optional defaultValuestringdefault value

Returns

string

Value of the attribute


getClassName

Static getClassName(): string

Returns

string


tryParseArray

Static tryParseArray(value): any[]

Parse string into array of objects, assuming that string value looks like "[value,value,value]" for example "[10,20,30,75.8999,36]" or "[x:10;y:20,x:15;y:45]"

Parameters

Name Type Description
valuestringvalue

Returns

any[]


tryParseJSON

Static tryParseJSON(value, trimValues?): any

Parse string in to object, assuming that string value looks like "name:value;name:value" for example or

Parameters

Name Type Description
valuestringvalue
Optional trimValuesbooleanautomatically trim values

Returns

any


tryParseValue

Static tryParseValue(value): string | number | boolean

Try parse value to avoid converting it in our existing code

Parameters

Name Type Description
valuestringvalue

Returns

string | number | boolean