JavaLite Common is a collection of convenience classes and packages that are shared across other JavaLite modules.

org.javalite.common.Collections

A simple class that adds some syntactical sugar when creating lists and maps. For instance if you want to create a list of strings, normally you would:

with Collections, you would:

.. or use a method li for the same purpose.

For maps:

For more features, see: Collections JavaDoc

org.javalite.common.Convert

This is an important class because it is used throughout the framework to convert one type to another.

Example:

There are many converter methods. You cn explore at: Convert.

org.javalite.common.HumanDate

Allows to generate distance in time in a human readable format:

org.javalite.common.Inflector

Translates English in singluar form to plural and back, as well as other translation functions:

org.javalite.common.JsonHelper

This class is a convenience for a popular library FasterXML/jackson. Jackson is on the classpath and you can use it directly. However, you migth find these shortcuts convenient:

If course in the first three cases, the string objects need to contain proper JSON content;

org.javalite.common.Util

This is a Swiss army knife for working with files and streams, as well as other functions:

Reading resources:

Validations

For Validations framework, refer here


How to comment

The comment section below is to discuss documentation on this page.

If you have an issue, or discover bug, please follow instructions on the Support page