{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Class: Utils","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/readme"},"children":["API"]}," / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/modules/geotoolkit"},"children":["geotoolkit"]}," / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/modules/geotoolkit.report"},"children":["report"]}," / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/modules/geotoolkit.report.parsers"},"children":["parsers"]}," / ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/modules/geotoolkit.report.parsers.utils"},"children":["Utils"]}," / Utils"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"class-utils","__idx":0},"children":["Class: Utils"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/modules/geotoolkit.report.parsers"},"children":["parsers"]},".",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/modules/geotoolkit.report.parsers.utils"},"children":["Utils"]},".Utils"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Helper class for the Report parsers utils"," ","The class Utils contains common Parser utils"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"table-of-contents","__idx":1},"children":["Table of contents"]},{"$$mdtype":"Tag","name":"details","attributes":{"open":"true"},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"style":{"fontSize":"1.25em","fontWeight":"bold"}},"children":["Constructors"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#new-utils"},"children":["new Utils()"]}]}]}]},{"$$mdtype":"Tag","name":"details","attributes":{"open":"true"},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"style":{"fontSize":"1.25em","fontWeight":"bold"}},"children":["Methods"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#getclassname"},"children":["getClassName"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#getattribute"},"children":["getAttribute"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#getclassname-1"},"children":["getClassName"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#tryparsearray"},"children":["tryParseArray"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#tryparsejson"},"children":["tryParseJSON"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils#tryparsevalue"},"children":["tryParseValue"]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"contents","__idx":2},"children":["Contents"]},{"$$mdtype":"Tag","name":"details","attributes":{"open":"true"},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"style":{"fontSize":"1.25em","fontWeight":"bold"}},"children":["Constructors"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"new-utils","__idx":3},"children":["new Utils()"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["• ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["new Utils"]},"()"]}]},{"$$mdtype":"Tag","name":"details","attributes":{"open":"true"},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"style":{"fontSize":"1.25em","fontWeight":"bold"}},"children":["Methods"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"getclassname","__idx":4},"children":["getClassName"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["getClassName"]},"(): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"returns","__idx":5},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"getattribute","__idx":6},"children":["getAttribute"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Static"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["getAttribute"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["node"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attrName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["defaultValue?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Extracts requested attribute from provided node"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters","__idx":7},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Name"},"children":["Name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"Type"},"children":["Type "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["node"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/geotoolkit/apis/classes/geotoolkit.report.dom.node.node"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Node"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["XML node"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["attrName"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The name of attribute to obtain"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["defaultValue"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["default value"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"returns-1","__idx":8},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Value of the attribute"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"getclassname-1","__idx":9},"children":["getClassName"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Static"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["getClassName"]},"(): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"returns-2","__idx":10},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"tryparsearray","__idx":11},"children":["tryParseArray"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Static"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tryParseArray"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["any"]},"[]"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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]\""," ",{"$$mdtype":"Tag","name":"polygon","attributes":{"path":"x:[1,2,3,4,5];y:[5,4,3,2,1]"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-1","__idx":12},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Name"},"children":["Name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"Type"},"children":["Type "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["value"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"returns-3","__idx":13},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["any"]},"[]"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"tryparsejson","__idx":14},"children":["tryParseJSON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Static"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tryParseJSON"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trimValues?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["any"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Parse string in to object, assuming that string value looks like \"name:value;name:value\""," ","for example ",{"$$mdtype":"Tag","name":"group","attributes":{"bounds":"x:10;y:10;width:100;height:200","limits":"auto"},"children":[]}," ","or ",{"$$mdtype":"Tag","name":"group","attributes":{"layoutstyle":"left:50%;top:50%;right:0;bottom:0","limits":"auto"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-2","__idx":15},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Name"},"children":["Name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"Type"},"children":["Type "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["value"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Optional"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trimValues"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["automatically trim values"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"returns-4","__idx":16},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["any"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"tryparsevalue","__idx":17},"children":["tryParseValue"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Static"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tryParseValue"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," | ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}," | ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Try parse value to avoid converting it in our existing code"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-3","__idx":18},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Name"},"children":["Name "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"Type"},"children":["Type "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["value"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"returns-5","__idx":19},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," | ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}," | ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]}]}]},"headings":[{"value":"Class: Utils","id":"class-utils","depth":1},{"value":"Table of contents","id":"table-of-contents","depth":2},{"value":"Contents","id":"contents","depth":2},{"value":"new Utils()","id":"new-utils","depth":4},{"value":"getClassName","id":"getclassname","depth":4},{"value":"Returns","id":"returns","depth":4},{"value":"getAttribute","id":"getattribute","depth":4},{"value":"Parameters","id":"parameters","depth":4},{"value":"Returns","id":"returns-1","depth":4},{"value":"getClassName","id":"getclassname-1","depth":4},{"value":"Returns","id":"returns-2","depth":4},{"value":"tryParseArray","id":"tryparsearray","depth":4},{"value":"Parameters","id":"parameters-1","depth":4},{"value":"Returns","id":"returns-3","depth":4},{"value":"tryParseJSON","id":"tryparsejson","depth":4},{"value":"Parameters","id":"parameters-2","depth":4},{"value":"Returns","id":"returns-4","depth":4},{"value":"tryParseValue","id":"tryparsevalue","depth":4},{"value":"Parameters","id":"parameters-3","depth":4},{"value":"Returns","id":"returns-5","depth":4}],"frontmatter":{"seo":{"title":"Class: Utils"}},"lastModified":"2026-02-11T19:54:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/geotoolkit/apis/classes/geotoolkit.report.parsers.utils.utils","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}