com.sony.csl.j2me.utils.io
Class XMLUtils

java.lang.Object
  extended by com.sony.csl.j2me.utils.io.XMLUtils

public class XMLUtils
extends java.lang.Object

A class with helpful methods for dealing with XML

Author:
mstevens

Constructor Summary
XMLUtils()
           
 
Method Summary
static java.lang.String comment(java.lang.String text, int tabs)
          Returns an XML comment string with the given text and the given number of tabs in front
static java.lang.String escapeCharacters(java.lang.String input)
          Replaces reserved XML characters with escapes
static java.lang.String timeDateValue(long timeStamp)
          Converts a long timestamp to a string in XML dateTime format:
- YYYY-MM-DDThh:mm:ssZ format for UTC times
- YYYY-MM-DDThh:mm:sszzzzzz format for non-UTC times, where zzzzzz represents ±hh:mm in relation to UTC
Info:
- http://code.google.com/apis/kml/documentation/kmlreference.html#timestamp
- http://code.google.com/apis/kml/documentation/time.html
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtils

public XMLUtils()
Method Detail

comment

public static java.lang.String comment(java.lang.String text,
                                       int tabs)
Returns an XML comment string with the given text and the given number of tabs in front

Parameters:
text -
tabs -
Returns:
xml comment String

escapeCharacters

public static java.lang.String escapeCharacters(java.lang.String input)
Replaces reserved XML characters with escapes

Parameters:
input - a String to process
Returns:
the same String but with reserved XML characters escaped

timeDateValue

public static java.lang.String timeDateValue(long timeStamp)
Converts a long timestamp to a string in XML dateTime format:
- YYYY-MM-DDThh:mm:ssZ format for UTC times
- YYYY-MM-DDThh:mm:sszzzzzz format for non-UTC times, where zzzzzz represents ±hh:mm in relation to UTC
Info:
- http://code.google.com/apis/kml/documentation/kmlreference.html#timestamp
- http://code.google.com/apis/kml/documentation/time.html

Parameters:
timeStamp -
Returns:
A String containing the formatted timestamp