API / geotoolkit / report / parsers / PropertyParser / PropertyParser
parsers.PropertyParser.PropertyParser
↳
PropertyParser
Constructors
- [new PropertyParser()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.report.parsers.propertyparser.propertyparser.md#new propertyparser())
Methods
Methods
▸ addElements(childElements, context): ParserContext
add child elements
| Name | Type |
|---|---|
childElements | ParserContext[] |
context | ParserContext |
▸ createElement(node, context): ParserContext
Create element associated with node
| Name | Type | Description |
|---|---|---|
node | Element | Node | |
context | ParserContext | The parsing context to be used to parse the node |
▸ getAttribute(node, attrName, defaultValue?): string
Extracts requested attribute from provided node
| Name | Type | Description |
|---|---|---|
node | Element | Node | XML node |
attrName | string | The name of attribute to obtain |
Optional defaultValue | string | default value |
string
Value of the attribute
▸ getClassName(): string
string
▸ getName(): string
Return parser name
string
▸ getType(): number
Return node type
number
▸ Protected parseAttributes(node, context): ParserContext
| Name | Type | Description |
|---|---|---|
node | Element | Node | node to parse |
context | ParserContext | parser context |
▸ parseElement(node, context): ParserContext
| Name | Type | Description |
|---|---|---|
node | Element | Node | node |
context | ParserContext | context |
▸ Protected 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]" <polygon path="x:[1,2,3,4,5];y:[5,4,3,2,1]"/>
| Name | Type | Description |
|---|---|---|
value | string | value |
any
▸ Protected tryParseJSON(value): object
Parse string in to object, assuming that string value looks like "name:value;name:value" for example <group bounds="x:10;y:10;width:100;height:200" limits="auto"/> or <group layoutstyle="left:50%;top:50%;right:0;bottom:0" limits="auto"/>
| Name | Type | Description |
|---|---|---|
value | string | value |
object
▸ Protected tryParseValue(value): string | number | boolean
Try parse value to avoid converting it later in run-time
| Name | Type | Description |
|---|---|---|
value | string | value |
string | number | boolean
▸ Static getAttribute(node, attrName, defaultValue?): string
Extracts requested attribute from provided node
| Name | Type | Description |
|---|---|---|
node | Element | Node | XML node |
attrName | string | The name of attribute to obtain |
Optional defaultValue | string | default value |
string
Value of the attribute
▸ Static getJSON(childContexts): object
Convert contexts to JSON
| Name | Type | Description |
|---|---|---|
childContexts | ParserContext[] | array of parsed contexts |
object
▸ 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]" <polygon path="x:[1,2,3,4,5];y:[5,4,3,2,1]"/>
| Name | Type | Description |
|---|---|---|
value | string | value |
any
▸ Static tryParseJSON(value): object
Parse string in to object, assuming that string value looks like "name:value;name:value" for example <group bounds="x:10;y:10;width:100;height:200" limits="auto"/> or <group layoutstyle="left:50%;top:50%;right:0;bottom:0" limits="auto"/>
| Name | Type | Description |
|---|---|---|
value | string | value |
object
▸ Static tryParseValue(value): string | number | boolean
Try parse value to avoid converting it later in run-time
| Name | Type | Description |
|---|---|---|
value | string | value |
string | number | boolean