org.gcube.contentmanagement.gcubemodellibrary.elements
Class Conversions

java.lang.Object
  extended by org.gcube.contentmanagement.gcubemodellibrary.elements.Conversions

public class Conversions
extends java.lang.Object

Author:
Federico De Faveri defaveri@isti.cnr.it

Constructor Summary
Conversions()
           
 
Method Summary
static java.lang.String calendarToString(java.util.Calendar calendar)
          Formats a Calendar into a String.
static GCubeDocument toDocument(GDoc doc)
          Converts the specified GDoc into a GCubeDocument.
static GCubeDocument toDocument(java.io.Reader r)
          Returns a GCubeDocument from its textual representation.
static GDoc toTree(GCubeDocument element)
          Converts the a GCubeDocument to a GDoc.
static java.lang.String toXML(GCubeDocument d)
          Converts a GCubeDocument into its textual representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conversions

public Conversions()
Method Detail

toDocument

public static GCubeDocument toDocument(java.io.Reader r)
                                throws java.lang.Exception
Returns a GCubeDocument from its textual representation.

Parameters:
xml - the textual representation.
Returns:
the document.
Throws:
java.lang.Exception - if the textual representation is not well-formed.

toXML

public static java.lang.String toXML(GCubeDocument d)
                              throws java.lang.Exception
Converts a GCubeDocument into its textual representation.

Parameters:
d - the document
Returns:
the textual representation of the document.
Throws:
java.lang.Exception - if the conversion could not be performed.

toDocument

public static GCubeDocument toDocument(GDoc doc)
                                throws java.lang.Exception
Converts the specified GDoc into a GCubeDocument.

Parameters:
doc - the gDoc to convert.
Returns:
the resulting GCubeDocument.
Throws:
java.lang.Exception

toTree

public static GDoc toTree(GCubeDocument element)
                   throws java.lang.Exception
Converts the a GCubeDocument to a GDoc.

Parameters:
document - the document to convert.
Returns:
the resulting gdoc.
Throws:
java.lang.Exception - if an error occurs during the conversion.

calendarToString

public static java.lang.String calendarToString(java.util.Calendar calendar)
Formats a Calendar into a String.

Parameters:
calendar - the calendar.
Returns:
the formatted string.