Class DateFormatAdapter

  • All Implemented Interfaces:
    Serializable

    public class DateFormatAdapter
    extends SimpleAdapter.OldDateAdapter
    A property adapter for formatting formatting and parsing dates in a locale-sensitive manner. Following is an example of the adapter description.
     <adapter>com.tangosol.run.xml.DateFormatAdapter</adapter>
     <pattern>yyyy.MM.dd G 'at' hh:mm:ss z</pattern>
     <locale>
       <language>en</language>
       <country>US</country>
     </locale>
     
    Version:
    1.00 2002.10.11
    Author:
    gg
    See Also:
    SimpleDateFormat, Serialized Form
    • Constructor Detail

      • DateFormatAdapter

        public DateFormatAdapter​(XmlBean.BeanInfo infoBean,
                                 Class clzType,
                                 String sName,
                                 String sXml,
                                 XmlElement xml)
        Construct a DateFormatAdapter.
        Parameters:
        infoBean - BeanInfo for a bean containing this property
        clzType - the type of the property
        sName - the property name
        sXml - the XML tag name
        xml - additional XML information
    • Method Detail

      • fromXml

        public Object fromXml​(XmlElement xml)
        Deserialize an object from an XML element.
        Overrides:
        fromXml in class SimpleAdapter.OldDateAdapter
        Parameters:
        xml - the XML element to deserialize from
        Returns:
        the object deserialized from the XML element
      • toXml

        public XmlElement toXml​(Object o)
        Serialize an object into an XML element.
        Overrides:
        toXml in class SimpleAdapter.OldDateAdapter
        Parameters:
        o - the object to serialize
        Returns:
        the XML element representing the serialized form of the passed object