Articles, dummyCategory

Java XML to String – Write XML Object to File Example – HowToDoInJava

Java examples to read XML file and print XML string to console or write XML to file. 1) Convert XML to String To convert XML object i.e org.w3c.dom.Document into string, you need following classes: javax.xml.transform.Transformer : An instance of this class can transform a source tree into a result tree, using it’s transform() method. javax.xml.transform.TransformerFactory …

Articles, dummyCategory

JDK9’s ForkJoinPool Upgrades

While everyone’s busy with modularity, local-variable-type-inference, and other Next Big Things of recent JDK releases, there’s a fairly small and important update for the ForkJoinPool that deserves some attention. ForkJoinPool was an experiment brought to life by JDK 7 and attracted a lot of attention at that time – it’s main selling point was the…

Articles, dummyCategory

Java Unescape HTML to String Example – HowToDoInJava

Java examples to unescape the characters in a String. It unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. StringEscapeUtils.unescapeHtml4() [Apache Commons Text] This method takes escaped string as parameter. It can be null. It supports all known HTML 4.0 entities. To use StringEscapeUtils, import commons-text …