List of usage examples for javax.json JsonValue toString
@Override String toString();
From source file:Main.java
public static void main(String[] args) { String personJSONData = " {" + " \"name\": \"Jack\", " + " \"age\" : 13, " + " \"isMarried\" : false, " + " \"address\": { " + " \"street\": \"#1234, Main Street\", " + " \"zipCode\": \"123456\" " + " }, " + " \"phoneNumbers\": [\"011-111-1111\", \"11-111-1111\"] " + " }"; JsonReader reader = Json.createReader(new StringReader(personJSONData)); JsonObject personObject = reader.readObject(); reader.close();//from ww w . java 2 s . c om System.out.println("Name : " + personObject.getString("name")); System.out.println("Age : " + personObject.getInt("age")); System.out.println("Married: " + personObject.getBoolean("isMarried")); JsonObject addressObject = personObject.getJsonObject("address"); System.out.println("Address: "); System.out.println(addressObject.getString("street")); System.out.println(addressObject.getString("zipCode")); System.out.println("Phone : "); JsonArray phoneNumbersArray = personObject.getJsonArray("phoneNumbers"); for (JsonValue jsonValue : phoneNumbersArray) { System.out.println(jsonValue.toString()); } }
From source file:org.json.StackExchangeAPI.java
private static void parseStackExchange(String jsonStr) { JsonReader reader = null;/*from ww w. j a va 2 s. com*/ try { reader = Json.createReader(new StringReader(jsonStr)); JsonObject jsonObject = reader.readObject(); reader.close(); JsonArray array = jsonObject.getJsonArray("items"); for (JsonObject result : array.getValuesAs(JsonObject.class)) { JsonObject ownerObject = result.getJsonObject("owner"); // int ownerReputation = ownerObject.getInt("reputation"); // System.out.println("Reputation:"+ownerReputation); int viewCount = result.getInt("view_count"); System.out.println("View Count :" + viewCount); int answerCount = result.getInt("answer_count"); System.out.println("Answer Count :" + answerCount); String link = result.getString("link"); System.out.println("URL: " + link); String title = result.getString("title"); System.out.println("Title: " + title); String body = result.getString("body"); System.out.println("Body: " + body); JsonArray tagsArray = result.getJsonArray("tags"); StringBuilder tagBuilder = new StringBuilder(); int i = 1; for (JsonValue tag : tagsArray) { tagBuilder.append(tag.toString()); if (i < tagsArray.size()) tagBuilder.append(","); i++; } System.out.println("Tags: " + tagBuilder.toString()); System.out.println("------------------------------------------"); } } catch (Exception ex) { ex.printStackTrace(); } }
From source file:org.ocelotds.marshalling.ArgumentServices.java
public List getJavaResultFromSpecificUnmarshallerIterable(String json, IJsonMarshaller marshaller) throws JsonUnmarshallingException { try {/* ww w .j ava 2 s. co m*/ List result = new ArrayList<>(); JsonReader createReader = Json.createReader(new StringReader(json)); JsonArray readArray = createReader.readArray(); for (JsonValue jsonValue : readArray) { result.add(marshaller.toJava(jsonValue.toString())); } return result; } catch (Throwable t) { throw new JsonUnmarshallingException(t.getMessage()); } }
From source file:org.ocelotds.marshalling.ArgumentServices.java
public Map getJavaResultFromSpecificUnmarshallerMap(String json, IJsonMarshaller marshaller) throws JsonUnmarshallingException { try {//from w w w .j av a 2 s . c o m Map<String, Object> result = new HashMap(); JsonReader createReader = Json.createReader(new StringReader(json)); JsonObject readObject = createReader.readObject(); for (Map.Entry<String, JsonValue> entry : readObject.entrySet()) { String key = entry.getKey(); JsonValue jsonValue = entry.getValue(); result.put(key, marshaller.toJava(jsonValue.toString())); } return result; } catch (Throwable t) { throw new JsonUnmarshallingException(t.getMessage()); } }
From source file:io.bibleget.BibleGetAbout.java
private void prepareDynamicInformation() throws ClassNotFoundException { bibleGetDB = BibleGetDB.getInstance(); jList1 = new VersionsSelect(); versionLangs = jList1.getVersionLangs(); versionCount = jList1.getVersionCount(); String langsSupported;//from www .j a v a 2 s . c om List<String> langsLocalized = new ArrayList<>(); booksLangs = 0; booksStr = ""; if (bibleGetDB != null) { //System.out.println("oh good, biblegetDB is not null!"); langsSupported = bibleGetDB.getMetaData("LANGUAGES"); //System.out.println(langsSupported); JsonReader jsonReader = Json.createReader(new StringReader(langsSupported)); JsonArray bibleVersionsObj = jsonReader.readArray(); booksLangs = bibleVersionsObj.size(); for (JsonValue jsonValue : bibleVersionsObj) { //System.out.println(jsonValue.toString()); langsLocalized.add(BibleGetI18N.localizeLanguage(jsonValue.toString())); } booksStr = StringUtils.join(langsLocalized, ", "); } else { //System.out.println("Looks like biblegetDB is null :/"); } }
From source file:io.bibleget.BibleGetHelp.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.// ww w . j a v a 2 s . com */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jSplitPane1 = new javax.swing.JSplitPane(); jScrollPane2 = new javax.swing.JScrollPane(); jTree1 = new javax.swing.JTree(); jScrollPane3 = new javax.swing.JScrollPane(); jTextPane2 = new javax.swing.JTextPane(); jTextPane2.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, true); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(__("Instructions")); setBounds(frameLeft, frameTop, frameWidth, frameHeight); setIconImages(setIconImages()); renderer = new LocalCellRenderer(jTree1); javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode(__("Help")); javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode( __("Usage of the Plugin")); javax.swing.tree.DefaultMutableTreeNode treeNode3; treeNode1.add(treeNode2); treeNode2 = new javax.swing.tree.DefaultMutableTreeNode(__("Formulation of the Queries")); treeNode1.add(treeNode2); treeNode2 = new javax.swing.tree.DefaultMutableTreeNode(__("Biblical Books and Abbreviations")); treeNode1.add(treeNode2); for (JsonValue jsonValue : bibleVersionsObj) { treeNode3 = new javax.swing.tree.DefaultMutableTreeNode( BibleGetI18N.localizeLanguage(jsonValue.toString())); treeNode2.add(treeNode3); } jTree1.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1)); jTree1.setCellRenderer(renderer); jTree1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTree1MouseClicked(evt); } }); jScrollPane2.setViewportView(jTree1); jSplitPane1.setLeftComponent(jScrollPane2); jTextPane2.setContentType("text/html;charset=UTF-8"); // NOI18N jTextPane2.setDocument(doc); jTextPane2.setEditorKit(kit); jTextPane2.setText(HTMLStr0); jScrollPane3.setViewportView(jTextPane2); jSplitPane1.setRightComponent(jScrollPane3); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1250, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE)); pack(); }
From source file:io.bibleget.HTTPCaller.java
public int idxOf(String needle, JsonArray haystack) { int count = 0; for (JsonValue i : haystack) { JsonArray m = (JsonArray) i;/*from w ww . ja v a 2 s .c o m*/ if (m.get(0).getValueType() == ARRAY) { for (JsonValue x : m) { //System.out.println("looking for '"+needle+"' in "+x.toString()); if (x.toString().contains("\"" + needle + "\"")) { return count; } } } else { if (m.toString().contains("\"" + needle + "\"")) { return count; } } count++; } return -1; }
From source file:io.bibleget.BibleGetHelp.java
/** * Creates new form BibleGetHelp// www . j av a 2 s . co m */ private BibleGetHelp() throws ClassNotFoundException, UnsupportedEncodingException { //jTextPane does not initialize correctly, it causes a Null Exception Pointer //Following line keeps this from crashing the program Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); String packagePath = BibleGetIO.getPackagePath(); //String locale = BibleGetIO.getLocale(); String langsSupported; List<String> langsLocalized = new ArrayList<>(); String bbBooks; bibleGetDB = BibleGetDB.getInstance(); if (bibleGetDB != null) { //System.out.println("oh good, biblegetDB is not null!"); JsonReader jsonReader; langsSupported = bibleGetDB.getMetaData("LANGUAGES"); //System.out.println(langsSupported); jsonReader = Json.createReader(new StringReader(langsSupported)); bibleVersionsObj = jsonReader.readArray(); booksLangs = bibleVersionsObj.size(); for (JsonValue jsonValue : bibleVersionsObj) { //System.out.println(jsonValue.toString()); langsLocalized.add(BibleGetI18N.localizeLanguage(jsonValue.toString())); } booksStr = StringUtils.join(langsLocalized, ", "); List<JsonArray> bibleBooksTemp = new ArrayList<>(); for (int i = 0; i < 73; i++) { bbBooks = bibleGetDB.getMetaData("BIBLEBOOKS" + Integer.toString(i)); jsonReader = Json.createReader(new StringReader(bbBooks)); JsonArray bibleBooksObj = jsonReader.readArray(); bibleBooksTemp.add(bibleBooksObj); } String curLang; List<String[]> booksForCurLang; //bibleBooks = new HashMap<>(); booksAndAbbreviations = new HashMap<>(); String buildStr; for (int q = 0; q < bibleVersionsObj.size(); q++) { curLang = (bibleVersionsObj.getString(q) != null) ? BibleGetI18N.localizeLanguage(bibleVersionsObj.getString(q)).toUpperCase() : ""; buildStr = ""; for (int i = 0; i < 73; i++) { String styleStr = ""; if (bibleVersionsObj.getString(q).equals("TAMIL") || bibleVersionsObj.getString(q).equals("KOREAN")) { styleStr = " style=\"font-family:'Arial Unicode MS';\""; } JsonArray curBook = bibleBooksTemp.get(i); JsonArray curBookCurLang = curBook.getJsonArray(q); String str1 = (curBookCurLang.getString(0) != null) ? curBookCurLang.getString(0) : ""; String str2 = (curBookCurLang.getString(1) != null) ? curBookCurLang.getString(1) : ""; buildStr += "<tr><td" + styleStr + ">" + str1 + "</td><td" + styleStr + ">" + str2 + "</td></tr>"; //buildStr += "<tr><td style=\"font-family:'Arial Unicode MS';\">"+str1+"</td><td style=\"font-family:'Arial Unicode MS';\">"+str2+"</td></tr>"; } booksAndAbbreviations.put(curLang, buildStr); } } else { booksLangs = 0; booksStr = ""; } kit = new HTMLEditorKit(); doc = kit.createDefaultDocument(); styles = kit.getStyleSheet(); styles.addRule("body { background-color: #FFFFDD; border: 2px inset #CC9900; }"); styles.addRule("h1 { color: #0000AA; }"); styles.addRule("h2 { color: #0000AA; }"); styles.addRule("h3 { color: #0000AA; }"); styles.addRule("p { text-align: justify; }"); styles.addRule("table { border-collapse: collapse; width: 600px; margin-left: auto; }"); styles.addRule( "th { text-align: center; border: 4px ridge #DEB887; background-color: #F5F5DC; padding: 3px; }"); styles.addRule( "td { text-align: justify; border: 3px ridge #DEB887; background-color: #F5F5DC; padding: 3px; }"); //System.out.println("We have package path in BibleGetHelp! It is: "+packagePath); HTMLStr0 = "<html><head><meta charset=\"utf-8\"></head><body>" + "<h1>" + __("Help for BibleGet (Open Office Writer)") + "</h1>" + "<p>" + __("This Help dialog window introduces the user to the usage of the BibleGet I/O plugin for Open Office Writer.") + "</p>" + "<p>" + __("The Help is divided into three sections:") + "</p>" + "<ul>" + "<li>" + __("Usage of the Plugin") + "</li>" + "<li>" + __("Formulation of the Queries") + "</li>" + "<li>" + __("Biblical Books and Abbreviations") + "</li>" + "</ul>" + "<p><b>" + __("AUTHOR") + ":</b> " + __("John R. D'Orazio (chaplain at Roma Tre University)") + "</p>" + "<p><b>" + __("COLLABORATORS") + ":</b> " + __("Giovanni Gregori (computing) and Simone Urbinati (MUG Roma Tre)") + "</p>" + "<p><b>" + __("Version").toUpperCase() + ":</b> " + String.valueOf(BibleGetIO.VERSION) + "</p>" + "<p> <b>Copyright 2014 BibleGet I/O by John R. D'Orazio</b> <span style=\"color:blue;\">john.dorazio@cappellaniauniroma3.org</span></p>" + "<p><b>" + __("PROJECT WEBSITE") + ": </b><span style=\"color:blue;\">http://www.bibleget.io</span> | <b>" + __("EMAIL ADDRESS FOR INFORMATION OR FEEDBACK ON THE PROJECT") + ":</b> <span style=\"color:blue;\">bibleget.io@gmail.com</span></p>" + "<p>Cappellania Universit degli Studi Roma Tre - Piazzale San Paolo 1/d - 00120 Citt del Vaticano - +39 06.69.88.08.09 - <span style=\"color:blue;\">cappellania.uniroma3@gmail.com</span></p></body></html>"; String strfmt1 = __("Insert quote from input window"); String strfmt2 = __("About this plugin"); String strfmt3 = __("RENEW SERVER DATA"); String strfmt4 = strfmt1; String strfmt5 = __("Insert quote from text selection"); String strfmt6 = strfmt1; HTMLStr1 = "<html><head><meta charset=\"utf-8\"></head><body>" + "<h2>" + __("How to use the plugin") + "</h2>" + "<h3>" + __("Description of the menu icons and their functionality.") + "</h3>" + "<p>" + __("Once the extension is installed, a new menu 'BibleGet I/O' will appear on the menu bar. Also a new floating toolbar will appear. The buttons on the floating toolbar correspond to the menu items in the new menu, as can be seen in this image:") + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot.jpg\" /><br /><br />" + "<p>" + __("The floating toolbar can be dragged and placed anywhere on the screen. It can also be docked to certain areas of the workspace, for example on the toolbar below the menu bar, like in this image:") + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot2.jpg\" /><br /><br />" + "<p>" + __("There are two ways of inserting a bible quote into a document.") + " " + __("The first way is by using the input window.") + " " + MessageFormat.format(__( "If you click on the menu item ''{0}'', an input window will open where you can input your query and choose the version or versions you would like to take the quote from."), strfmt1) + " " + __("This list of versions is updated from the available versions on the BibleGet server, but since the information is stored locally it may be necessary to renew the server information when new versions are added to the BibleGet server database.") + " " + MessageFormat.format(__( "In order to renew the information from the BibleGet server, click on the ''{0}'' menu item, and then click on the button ''{1}''."), strfmt2, strfmt3) + " " + MessageFormat.format(__( "When you choose a version or multiple versions to quote from, this choice is automatically saved as a preference, and will be pre-selected the next time you open the ''{0}'' menu item."), strfmt4) + "<br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot4.jpg\" /><br /><br />" + MessageFormat.format(__( "The second way is by writing your desired quote directly in the document, and then selecting it and choosing the menu item ''{0}''. The selected text will be substituted by the Bible Quote retrieved from the BibleGet server."), strfmt5) + " " + MessageFormat.format(__( "The versions previously selected in the ''{0}'' window will be used, so you must have selected your preferred versions at least once from the ''{0}'' window."), strfmt6) + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot3.jpg\" /><br /><br />" + "<p>" + __("Formatting preferences can be set using the 'Preferences' window. You can choose the desired font for the Bible quotes as well as the desired line-spacing, and you can choose separate formatting (font size, font color, font style) for the book / chapter, for the verse numbers, and for the verse text. Preferences are saved automatically.") + "</p><br /><br />" + "<img src=\"" + packagePath + "/images/Screenshot5.jpg\" /><br /><br />" + "<p>" + __("After the 'Help' menu item that opens up this same help window, the last three menu items are:") + "</p>" + "<ul>" + "<li><img src=\"" + packagePath + "/images/email.png\" />" + " '" + __("Send feedback") + "': <span>" + __("This will open up your system's default email application with the bibleget.io@gmail.com feedback address already filled in.") + "</span></li>" + "<li><img src=\"" + packagePath + "/images/paypal.png\" />" + " '" + __("Contribute") + "': <span>" + __("This will open a Paypal page in the system's default browser where you can make a donation to contribute to the project. Even just 1 can help to cover the expenses of this project. Just the server costs 120 a year.") + "</span></li>" + "<li><img src=\"" + packagePath + "/images/info.png\" />" + " '" + __("Information on the BibleGet I/O Project") + "': <span>" + __("This opens a dialog window with some information on the project and it's plugins, on the author and contributors, and on the current locally stored information about the versions and languages that the BibleGet server supports.") + "</span></li>" + "</ul>" + "</body></html>"; String strfmt7 = __("Biblical Books and Abbreviations"); HTMLStr2 = "<html>" + "<head><meta charset=\"utf-8\"></head>" + "<body>" + "<h2>" + __("How to formulate a bible query") + "</h2>" + "<p>" + __("The queries for bible quotes must be formulated using standard notation for bible citation.") + " " + __("This can be either the english notation (as explained here: https://en.wikipedia.org/wiki/Bible_citation), or the european notation as explained here below. ") + "</p>" + "<p>" + __("A basic query consists of at least two elements: the bible book and the chapter.") + " " + __("The bible book can be written out in full, or in an abbreviated form.") + " " + MessageFormat.format(__( "The BibleGet engine recognizes the names of the books of the bible in {0} different languages: {1}"), Integer.toString(booksLangs), booksStr) + " " + MessageFormat.format(__("See the list of valid books and abbreviations in the section {0}."), "<span class=\"internal-link\" id=\"to-bookabbrevs\">" + strfmt7 + "</span>") + " " + __("For example, the query \"Matthew 1\" means the book of Matthew (or better the gospel according to Matthew) at chapter 1.") + " " + __("This can also be written as \"Mt 1\".") + "</p>" + "<p>" + __("Different combinations of books, chapters, and verses can be formed using the comma delimiter and the dot delimiter (in european notation, in english notation instead a colon is used instead of a comma and a comma is used instead of a dot):") + "</p>" + "<ul>" + "<li>" + __("\",\": the comma is the chapter-verse delimiter. \"Matthew 1,5\" means the book (gospel) of Matthew, chapter 1, verse 5. (In English notation: \"Matthew 1:5\".)") + "</li>" + "<li>" + __("\".\": the dot is a delimiter between verses. \"Matthew 1,5.7\" means the book (gospel) of Matthew, chapter 1, verses 5 and 7. (In English notation: \"Matthew 1:5,7\".)") + "</li>" + "<li>" + __("\"-\": the dash is a range delimiter, which can be used in a variety of ways:") + "<ol>" + "<li>" + __("For a range of chapters: \"Matthew 1-2\" means the gospel according to Matthew, from chapter 1 to chapter 2.") + "</li>" + "<li>" + __("For a range of verses within the same chapter: \"Matthew 1,1-5\" means the gospel according to Matthew, chapter 1, from verse 1 to verse 5. (In English notation: \"Matthew 1:1-5\".)") + "</li>" + "<li>" + __("For a range of verses that span over different chapters: \"Matthew 1,5-2,13\" means the gospel according to Matthew, from chapter 1, verse 5 to chapter 2, verse 13. (In English notation: \"Matthew 1:5-2:13\".)") + "</li>" + "</ol>" + "</ul>" + "<p>" + __("Different combinations of these delimiters can form fairly complex queries, for example \"Mt1,1-3.5.7-9\" means the gospel according to Matthew, chapter 1, verses 1 to 3, verse 5, and verses 7 to 9. (In English notation: \"Mt1:1-3,5,7-9\".)") + "</p>" + "<p>" + __("Multiple queries can be combined together using a semi-colon \";\".") + " " + __("If the query following the semi-colon refers to the same book as the preceding query, it is not necessary to indicate the book a second time.") + " " + __("For example, \"Matthew 1,1;2,13\" means the gospel according to Matthew, chapter 1 verse 1 and chapter 2 verse 13. (In English notation: \"Matthew 1:1;2:13\".)") + " " + __("Here is an example of multiple complex queries combined into a single querystring: \"Genesis 1,3-5.7.9-11.13;2,4-9.11-13;Apocalypse 3,10.12-14\". (In English notation: \"Genesis 1:3-5,7,9-11,13;2:4-9,11-13;Apocalypse 3:10,12-14\").") + "</p>" + "<p>" + __("It doesn't matter whether or not you use a space between the book and the chapter, the querystring will be interpreted just the same.") + __("It is also indifferent whether you use uppercase or lowercase letters, the querystring will be interpreted just the same.") + "</p>" + "</body>" + "</html>"; HTMLStr3 = "<html>" + "<head><meta charset=\"utf-8\"></head>" + "<body>" + "<h2>" + __("Biblical Books and Abbreviations") + "</h2>" + "<p>" + __("Here is a list of valid books and their corresponding abbreviations, either of which can be used in the querystrings.") + " " + __("The abbreviations do not always correspond with those proposed by the various editions of the Bible, because they would conflict with those proposed by other editions.") + " " + __("For example some english editions propose \"Gn\" as an abbreviation for \"Genesis\", while some italian editions propose \"Gn\" as an abbreviation for \"Giona\" (= \"Jonah\").") + " " + __("Therefore you will not always be able to use the abbreviations proposed by any single edition of the Bible, you must use the abbreviations that are recognized by the BibleGet engine as listed in the following table:") + "</p><br /><br />" + "<table cellspacing='0'>" + "<caption>{1}</caption>" + "<tr><th style=\"width:70%;\">" + __("BOOK") + "</th><th style=\"width:30%;\">" + __("ABBREVIATION") + "</th></tr>" + "{0}" + "</table>" + "</body>" + "</html>"; Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); screenWidth = (int) screenSize.getWidth(); screenHeight = (int) screenSize.getHeight(); frameWidth = 1250; frameHeight = 700; frameLeft = (screenWidth / 2) - (frameWidth / 2); frameTop = (screenHeight / 2) - (frameHeight / 2); initComponents(); }
From source file:nl.nn.adapterframework.align.Json2Xml.java
@Override public String getNodeText(XSElementDeclaration elementDeclaration, JsonValue node) { String result;//from w ww. j a va 2 s .c om if (node instanceof JsonString) { result = ((JsonString) node).getString(); } else if (node instanceof JsonStructure) { // this happens when override key is present without a value result = null; } else { result = node.toString(); } if ("{}".equals(result)) { result = ""; } if (DEBUG) log.debug("getText() node [" + ToStringBuilder.reflectionToString(node) + "] = [" + result + "]"); return result; }
From source file:org.hyperledger.fabric.sdk.ChaincodeCollectionConfiguration.java
private static long getJsonLong(JsonObject obj, String prop) throws ChaincodeCollectionConfigurationException { JsonValue ret = obj.get(prop); if (ret == null) { throw new ChaincodeCollectionConfigurationException(format("property %s missing", prop)); }//from w w w .jav a 2 s . c om if (ret.getValueType() != JsonValue.ValueType.NUMBER) { throw new ChaincodeCollectionConfigurationException( format("property %s wrong type expected number got %s", prop, ret.getValueType().name())); } return Long.parseLong(ret.toString()); }