Framework/Another Lore2009. 4. 26. 06:54

When the value of a property is read or written using a type different from that declared for the property, the repository attempts a type conversion according to the following rules. Note that even in cases where the type conversion is
defined in terms of standard JDK type conversion method, failure of conversion must only ever cause a ValueFormatException to be thrown and never any exception defined in the JDK API.



From STRING To

INPUTSTREAM: The string is encoded using UTF-8.
DATE: If the string is in the format(yyyyMMdd hh24miss) From DATE To, it is converted directly,
     otherwise a ValueFormatException is thrown.
DOUBLE: The string is converted using java.lang.Double.valueOf(String).
DECIMAL: The string is converted using the constructor java.math.BigDecimal(String).
LONG: The string is converted using java.lang.Long.valueOf(String).
BOOLEAN: The string is converted using java.lang.Boolean.valueOf(String).
OBJECT : The string(String)


From BINARY To

STRING: return binary.toXML().toString()
OBJECT : return binary (BinaryPropertyValue)
All Others: A ValueFormatException is thrown.



From DATE To

STRING: The date is converted to the following format:
   yyyyMMdd hh24miss(gregorian
INPUTSTREAM: The date is converted to a string, and this string is encoded in UTF-8.
DOUBLE: The date is converted to the number of milliseconds
     since 00:00 (UTC) 1 January 1970 (1970-01-01T00:00:00.000Z).
     If this number is out-of-range for a double, a ValueFormatException is thrown.
DECIMAL: The date is converted to the number of milliseconds
      since 00:00 (UTC) 1 January 1970(1970-01-01T00:00:00.000Z).
LONG: The date is converted to the number of milliseconds
      since 00:00 (UTC) 1 January 1970 (1970-01-01T00:00:00.000Z). 
      If this number is out-of-range for a long, a ValueFormatException is thrown.
OBJECT : The date(Calendar of Gregorian)
All Others: A ValueFormatException is thrown.


From DOUBLE To

STRING: The double is converted using java.lang.Double.toString().
INPUTSTREAM: The double is converted to a string, and this string is encoded in UTF-8.
DECIMAL: The double is converted using the constructor java.math.BigDecimal(double).
DATE: The double is coerced to a long using standard Java type coercion
      and interpreted as the number of milliseconds since 00:00 (UTC) 1 January 1970(1970-01-01T00:00:00.000Z).
      If the resulting value is out of range for a date, a ValueFormatException is thrown.
LONG: Standard Java type coercion is used.
OBJECT : The double (Double)
All Others: A ValueFormatException is thrown.


From DECIMAL To

STRING: The decimal is converted using java.math.BigDecimal.toString().
INPUTSTREAM: The decimal is converted to a string, and this string is encoded in UTF-8.
DOUBLE: The decimal is converted using java.math.BigDecimal.doubleValue().
DATE: The decimal is converted to a long and interpreted as the number of milliseconds
      since 00:00 (UTC) 1 January 1970 (1970-01-01T00:00:00.000Z).
      If the resulting value is out of range for a date, a ValueFormatException is thrown.
LONG: The decimal is converted using java.math.BigDecimal.longValue().
OBJECT : The decimal(BigDecimal)
All Others: A ValueFormatException is thrown.


From LONG To

STRING: The long is converted using java.lang.Long.toString().
INPUTSTREAM: The long is converted to a string, and this string is encoded in UTF-8.
DECIMAL: The double is converted using the method java.math.BigDecimal.valueOf(long).
DATE: The long is interpreted as the number of milliseconds
     since 00:00 (UTC) 1 January 1970 (1970-01-01T00:00:00.000Z).
     If the resulting value is out of range for a date, a ValueFormatException is thrown.
DOUBLE: Standard Java type coercion is used.
OBJECT : The long(Long)
All Others: A ValueFormatException is thrown.


From BOOLEAN To

STRING: The boolean is converted using java.lang.Boolean.toString().
INPUTSTREAM: The boolean is converted to a string, and this string is encoded in UTF-8.
OBJECT : The boolean(Boolean)
All Others: A ValueFormatException is thrown.



From NAME

STRING: The name is converted to qualified name(IDString)
INPUTSTREAM: The name is converted to a string, and then encoded using UTF-8.
OBJECT : The name(IDString)
All Others: A ValueFormatException is thrown.


From PATH

STRING: The name is converted to qualified name(IDString)
INPUTSTREAM: The name is converted to a string, and then encoded using UTF-8.
OBJECT : The node of path(Node)
All Others: A ValueFormatException is thrown.


From REFERENCE

STRING: The reference is converted to string
INPUTSTREAM: The name is converted to a string, and then encoded using UTF-8.
OBJECT : The node of identifier(Node)
All Others: A ValueFormatException is thrown.



From TEXT

STRING: The text is converted to string
INPUTSTREAM: The text is converted to a string, and then encoded using UTF-8.
OBJECT : The text is converted to stringBuffer
All Others: A ValueFormatException is thrown.



From VERTUAL_TEXT

STRING: The text is converted to string
INPUTSTREAM: The text is converted to a string, and then encoded using UTF-8.
OBJECT : The text is converted to translated string(translate template)
All Others: A ValueFormatException is thrown.





'Framework > Another Lore' 카테고리의 다른 글

AL : 현재의 난제들  (0) 2009.04.30
AL : Workspace  (0) 2009.04.28
AL : Property Type Conversion  (0) 2009.04.26
AL : Reading  (0) 2009.04.25
AL : Link  (0) 2009.04.24
AL : Observation  (0) 2009.04.24
Posted by bleujin

댓글을 달아 주세요