axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davanum Srinivas" <dava...@gmail.com>
Subject Re: svn commit: r675511 - /webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
Date Thu, 10 Jul 2008 14:10:48 GMT
Please remove the System.out.

thanks,
dims

On Thu, Jul 10, 2008 at 7:09 AM,  <amilas@apache.org> wrote:
> Author: amilas
> Date: Thu Jul 10 04:09:49 2008
> New Revision: 675511
>
> URL: http://svn.apache.org/viewvc?rev=675511&view=rev
> Log:
> Added an option to set the time zone when formatting the date
>
> Modified:
>    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
>
> Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
> URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?rev=675511&r1=675510&r2=675511&view=diff
> ==============================================================================
> --- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
(original)
> +++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
Thu Jul 10 04:09:49 2008
> @@ -24,6 +24,8 @@
>  import org.apache.axiom.om.OMNode;
>  import org.apache.axiom.om.OMText;
>  import org.apache.axis2.databinding.utils.ConverterUtil;
> +import org.apache.axis2.context.MessageContext;
> +import org.apache.axis2.description.AxisService;
>
>  import javax.activation.DataHandler;
>  import javax.xml.namespace.QName;
> @@ -289,7 +291,15 @@
>             return zulu.format(((Calendar)obj).getTime());
>         } else if (obj instanceof Date) {
>             SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd");
> -//            zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
> +
> +            MessageContext messageContext = MessageContext.getCurrentMessageContext();
> +            AxisService axisServce = messageContext.getAxisService();
> +            // if the user has given a pirticualr timezone we use it.
> +            System.out.println("TimZone ==> " + axisServce.getParameterValue("TimeZone"));
> +            if (axisServce.getParameter("TimeZone") != null){
> +               zulu.setTimeZone(TimeZone.getTimeZone((String)axisServce.getParameter("TimeZone").getValue()));
> +            }
> +
>             return zulu.format(obj);
>         }
>         return obj.toString();
>
>
>



-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message