JPlate 0.1

"How To"

How To

This section describes how to use portions of JPlate.

Include Jars

To utilize the JPlate include all jar files found in the release lib directory as part of the classpath.  For example, assume JPlate 0.1 has been downloaded and installed to /shared/jplate-0.1 on a Linux platform:




Building (if desired)

If you wish to build JPlate from source, either checkout the source (from the Subversion) or download the source.  You will also need Ant 1.7.1.

Checkout the source

Latest Source

svn co
cd trunk

This release

svn co

Download the source

Simply download the source and unpack it (either bunzip/tar xvf, gunzip/tar xvf or unzip).  Once unpacked, change directories to the unpacked directory.

Build the source

Once you have a copy of the code (and have Ant 1.7.1 installed properly), execute the following command:



After building, you should find an assembly/release directory containing various things such as a jar file (for example the JPlate 0.1 release produces jplate-0.1.jar) and other files normally associated with a JPlate release.


This section illustrates how to quickly make use of JPlate.  However, remember that this is simply a "quick start" and does not explain how to use the complete library.  Please look to individual classes for more specific information on class utilization.


Foundation provides "core" Java functionality that is utilized elsewhere in JPlate:  KVP and Tabular (listed below).  This section is a "work in progress" - examples will be added at a later date.


KVP provides key/value pair functionality - much like java.util.Properties including a parser.  There is a utility class that makes use of default implentations to create list/maps from files, input streams, readers and strings.  By examining the source code for this class, one can extrapolate how to extend or use the rest of the project. import;

import java.util.List;

import org.jplate.kvp.KvpIfc;

import org.jplate.kvp.util.KvpUtil;


    final File kvpFile = new File ( "SomeFile.kvp" );

    final List <KvpIfc> KvpUtil.getAsList (
kvpFile );



import java.util.Map;

import org.jplate.kvp.KvpIfc;

import org.jplate.kvp.util.KvpUtil;


    final Socket kvpSocket = // Create socket in some fashion...

    final Map <String, String> KvpUtil.getAsMap (
kvpSocket.getInputStream () );



Tabular provides tabular related functionality.  Here "tabular" refers to data organized into tables of records and fields, where each has a fixed delimiter:  for example, records delimited by "new lines" and fields delimited by commas.


There are three included parsers:

As a side note, CSV includes two parsers - one strictly adheres to RFC 4180, while the other is a more lax version similar to both the CDV and TDV parsers.

import java.util.List;

import org.jplate.tabular.util.JPlateCsvUtil;


    final File csvFile = new File ( "SomeFile.csv" );

    final List <List <String>> JPlateCsvUtil.getAsList ( csvFile );



import org.jplate.tabular.TableIfc;

import org.jplate.tabular.util.TdvUtil;


    final Socket tdvSocket = // Create socket in some fashion...

    final TableIfc table = TdvUtil.getAsTable (
tdvSocket.getInputStream () );