Package overit.geocall.xml
Class XMLTable
java.lang.Object
overit.geocall.xml.XMLTable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an XMLTable starting from theDBViewand the format passed as parametersCreates an XMLTable starting from theDBViewand the format passed as parametersCreates an XMLTable starting from theXMLTreepassed as parameterXMLTable(XMLTree xmlt, SimpleDateFormat sdf) Creates an XMLTable starting from theXMLTreeand theSimpleDateFormatpassed as parametersXMLTable(XMLTree xmlt, SimpleDateFormat sdf, String timeZone) Creates an XMLTable starting from theXMLTreeand theSimpleDateFormatpassed as parameters -
Method Summary
Modifier and TypeMethodDescriptionprotected static Stringstatic ObjectcodeObject(String code, String value) Transforms the string value passed as parameter in the Object of the correct type depending on the codestatic ObjectcodeObject(String code, String value, SimpleDateFormat sdf) Transforms the string value passed as parameter in the Object of the correct type depending on the code (and theSimpleDateFormatfor the date values)static ObjectcodeObject(String code, String value, SimpleDateFormat sdf, Getter attributes, String timeZone) Transforms the string value passed as parameter in the Object of the correct type depending on the code (and theSimpleDateFormatfor the date values)protected voidprotected XMLTreeprotected XMLTreeprotected static Stringstatic StringTransforms the Object passed as parameter in a Stringprotected static Stringencode(Object o, String type, SimpleDateFormat sdf, boolean typeEncode, Getter attributes, String timeZone) Returns theDBViewof the XMLTableReturns the metadata of the XMLTableReturns theXMLTreethat corresponds to the XMLTableReturns theXMLTreethat corresponds to the XMLTableprotected XMLTreemetadataFromFields(HashSet fields) protected XMLTreemetadataFromValues(HashMap types) voidSets theSimpleDateFormatthat will be used to format the date valuesvoidsetMetadata(HashMap types) Sets the metadata of the XMLTable using theHashMappassed as parametervoidsetMetadata(XMLTree metadata) Sets the metadata of the XMLTable using theXMLTreepassed as parameter
-
Field Details
-
_rowSeparator
- See Also:
-
DATA_FORMAT_COMPACT
- See Also:
-
DATA_FORMAT_SHORT
- See Also:
-
DATA_FORMAT_EXTENDED
- See Also:
-
_dataformat
-
_dbv
-
_metadata
-
_data
-
_sdf
-
_types
-
-
Constructor Details
-
XMLTable
Creates an XMLTable starting from theXMLTreepassed as parameter- Parameters:
xmlt- The XMLTree used to create the XMLTable
-
XMLTable
Creates an XMLTable starting from theXMLTreeand theSimpleDateFormatpassed as parameters- Parameters:
xmlt- The XMLTree used to create the XMLTablesdf- The SimpleDateFormat used to format the date values
-
XMLTable
Creates an XMLTable starting from theXMLTreeand theSimpleDateFormatpassed as parameters- Parameters:
xmlt- The XMLTree used to create the XMLTablesdf- The SimpleDateFormat used to format the date valuestimeZone- The time zone of the date
-
XMLTable
Creates an XMLTable starting from theDBViewand the format passed as parameters- Parameters:
dbv- The DBView used to create the XMLTreedataformat- One ofDATA_FORMAT_COMPACT,DATA_FORMAT_EXTENDEDorDATA_FORMAT_SHORT
-
XMLTable
Creates an XMLTable starting from theDBViewand the format passed as parameters- Parameters:
dbv- The DBView used to create the XMLTreedataformat- One ofDATA_FORMAT_COMPACT,DATA_FORMAT_EXTENDEDorDATA_FORMAT_SHORTtimeZone- The time zone of the date
-
-
Method Details
-
classCode
-
codeObject
Transforms the string value passed as parameter in the Object of the correct type depending on the code- Parameters:
code- String that defines the code, used to create the Object of the correct type. It can be S (String), D (Double), L (Long), T (Date), B (Boolean), E (Euro). If it isnull, X or F it will be returned the String object that corresponds to the valuevalue- The string that represents the value- Returns:
- The Object with the desired format and value
-
codeObject
Transforms the string value passed as parameter in the Object of the correct type depending on the code (and theSimpleDateFormatfor the date values)- Parameters:
code- String that defines the code, used to create the Object of the correct type. It can be S (String), D (Double), L (Long), T (Date), B (Boolean), E (Euro). If it isnull, X or F or W it will be returned the String object that corresponds to the valuevalue- The string that represents the valuesdf- The SimpleDateFormat used to format the date values- Returns:
- The Object with the desired format and value
-
codeObject
public static Object codeObject(String code, String value, SimpleDateFormat sdf, Getter attributes, String timeZone) Transforms the string value passed as parameter in the Object of the correct type depending on the code (and theSimpleDateFormatfor the date values)- Parameters:
code- String that defines the code, used to create the Object of the correct type. It can be S (String), D (Double), L (Long), T (Date), B (Boolean), E (Euro). If it isnull, X or F or W it will be returned the String object that corresponds to the valuevalue- The string that represents the valuesdf- The SimpleDateFormat used to format the date valuesattributes- The attribute of the date (i.e "central")timeZone- String defining the time zone- Returns:
- The Object with the desired format and value
-
setDateFormat
Sets theSimpleDateFormatthat will be used to format the date values- Parameters:
sdf- The SimpleDateFormat
-
setMetadata
Sets the metadata of the XMLTable using theHashMappassed as parameter- Parameters:
types- The map that contains the metadata of the table
-
setMetadata
Sets the metadata of the XMLTable using theXMLTreepassed as parameter- Parameters:
metadata- The XMLTree that contains the metadata of the table
-
convertOldVersion
protected void convertOldVersion() -
getXml
Returns theXMLTreethat corresponds to the XMLTable- Parameters:
name- The name of the XMLTree- Returns:
- The tree that corresponds to the XMLTable
-
getXml
Returns theXMLTreethat corresponds to the XMLTable- Parameters:
name- The name of the XMLTreetyped-trueto encode the values,falseotherwise- Returns:
- The tree that corresponds to the XMLTable
-
dataXml
-
dataXml
-
metadataFromValues
-
metadataFromFields
-
getMetadata
Returns the metadata of the XMLTable- Returns:
- The
XMLTreeof the metadata
-
getDBView
Returns theDBViewof the XMLTable- Returns:
- The DBView
-
encode
Transforms the Object passed as parameter in a String- Parameters:
o- The Object to encode- Returns:
- The String version of the Object
-
encode
-
decode
-