Sunday, 21 August 2016

5 Libraries that makes your Java coding easy





1) Jsoup

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods.
jsoup implements the WHATWG HTML5 specification, and parses HTML to the same DOM as modern browsers do.

  • scrape and parse HTML from a URL, file, or string
  • find and extract data, using DOM traversal or CSS selectors
  • manipulate the HTML elements, attributes, and text
  • clean user-submitted content against a safe white-list, to prevent attacks
  • output tidy HTML
jsoup is designed to deal with all varieties of HTML found in the wild; from pristine and validating, to invalid tag-soup; jsoup will create a sensible parse tree.





2) Xembler


Xembly is an Assembly-like imperative programming language for data manipulation in XML documents. It is a much simplier alternative to XSLT and XQuery.


Since version 0.9 you can directly transform directives to XML:

String xml = new Xembler(
  new Directives()
    .add("root")
    .add("order")
    .attr("id", "553")
    .set("$140.00")
).xml();
 
This code will produce this XML document:

<root>
  <order id="553">$140</order>
</root>
 
URL: http://www.xembly.org/
 
3) Gson


Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.
There are a few open-source projects that can convert Java objects to JSON. However, most of them require that you place Java annotations in your classes; something that you can not do if you do not have access to the source-code. Most also do not fully support the use of Java Generics. Gson considers both of these as very important design goals. 

URL: https://github.com/google/gson



4) Gagawa

Gagawa is an HTML Generator library written in Java and PHP.
It allows developers to easily and dynamically build well-formed HTML in web or non-web applications. In Java, Gagawa is especially useful when traditional HTML generation engines such as Java Server Pages (JSP's) are unavailable. In PHP, Gagawa frees developers from hand-writing HTML in PHP web applications. Although you can build an entire site using Gagawa, most developers use Gagawa in conjunction with other libraries to build relatively small blocks or pieces of HTML. For example, Gagawa is perfect when a developer needs to return a small chunk of well-formed HTML in an AJAX response.

URL: https://code.google.com/archive/p/gagawa/



5) ICEpdf


ICEpdf is an open source PDF engine for viewing, printing, and annotating PDF documents. The ICEpdf API is 100% Java, lightweight, fast, efficient, and very easy to use.
ICEpdf can be used as standalone open source Java PDF viewer, or can be easily embedded in any Java application to seamlessly load or capture PDF documents. Beyond PDF document rendering, ICEpdf is extremely versatile, and can be used in a multitude of innovative ways, including:

  • PDF to image conversion
  • PDF annotation (see below)
  • PDF Interactive Forms
  • PDF text and/or image extraction
  • PDF search
  • PDF printing
URL: http://www.icesoft.org/java/projects/ICEpdf/overview.jsf

No comments:

Post a Comment