List of usage examples for com.fasterxml.jackson.databind.node ArrayNode hashCode
public int hashCode()
From source file:net.sf.jasperreports.engine.export.JsonExporter.java
protected void exportWebFonts() throws IOException { HtmlResourceHandler fontHandler = getExporterOutput().getFontHandler(); ReportContext reportContext = getReportContext(); if (fontHandler != null && reportContext != null && reportContext.containsParameter(REPORT_CONTEXT_PARAMETER_WEB_FONTS)) { Map<String, HtmlFontFamily> fontsToProcess = (Map<String, HtmlFontFamily>) reportContext .getParameterValue(REPORT_CONTEXT_PARAMETER_WEB_FONTS); ObjectMapper mapper = new ObjectMapper(); ArrayNode webFonts = mapper.createArrayNode(); for (HtmlFontFamily htmlFontFamily : fontsToProcess.values()) { ObjectNode objNode = mapper.createObjectNode(); objNode.put("id", htmlFontFamily.getId()); objNode.put("path", fontHandler.getResourcePath(htmlFontFamily.getId())); webFonts.add(objNode);// ww w.j a va 2 s . c om } if (gotFirstJsonFragment) { writer.write(",\n"); } else { gotFirstJsonFragment = true; } writer.write("\"webfonts_" + (webFonts.hashCode() & 0x7FFFFFFF) + "\": {"); writer.write("\"id\": \"webfonts_" + (webFonts.hashCode() & 0x7FFFFFFF) + "\","); writer.write("\"type\": \"webfonts\","); writer.write("\"webfonts\": " + jacksonUtil.getJsonString(webFonts)); writer.write("}"); } }