Package org.apache.axis2.databinding.types

Examples of org.apache.axis2.databinding.types.YearMonth


                throw new AxisFault(getFaultString(value, "time"));
            }
        }
        if (Constants.XSD_YEARMONTH.equals(type)) {
            try {
                YearMonth yearMonth = ConverterUtil.convertToGYearMonth(value);
                Calendar calendar = Calendar.getInstance();
                calendar.clear();
                calendar.set(Calendar.YEAR, yearMonth.getYear());
                calendar.set(Calendar.MONTH, yearMonth.getMonth());
                String timezone = yearMonth.getTimezone();
                if (timezone != null) {
                    calendar.setTimeZone(TimeZone.getTimeZone(timezone));
                }
                return engine.getCx().newObject(engine, "Date", new Object[]{calendar.getTimeInMillis()});
            } catch (Exception e) {
View Full Code Here


    public static String convertToGYearMonth(Object jsObject) throws AxisFault {
        try {
            // If the user returned a valid GYearMonth a s a String we use the converterUtil to
            // validate it and return it back.
            if (jsObject instanceof String) {
                YearMonth yearMonth = ConverterUtil.convertToGYearMonth((String)jsObject);
                return ConverterUtil.convertToString(yearMonth);
            }
            Date date = (Date) Context.jsToJava(jsObject, Date.class);
            Calendar calendar = Calendar.getInstance();
            calendar.clear();
            calendar.setTime(date);
            YearMonth yearMonth =
                    new YearMonth(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH));
            return ConverterUtil.convertToString(yearMonth);
        } catch (EvaluatorException e) {
            throw new AxisFault("Unable to convert the return value to yearMonth");
        } catch (NumberFormatException e) {
            throw new AxisFault("Unable to convert the return value to yearMonth");
View Full Code Here

    public static YearMonth convertToGYearMonth(String s) {
        if ((s == null) || s.equals("")){
            return null;
        }
        return new YearMonth(s);
    }
View Full Code Here

    public static YearMonth convertToGYearMonth(String s) {
        if ((s == null) || s.equals("")){
            return null;
        }
        return new YearMonth(s);
    }
View Full Code Here

            return null;
        }
    }

    public static YearMonth convertTogYearMonth(String s) {
        return new YearMonth(s);
    }
View Full Code Here

    public static YearMonth convertToGYearMonth(String s) {
        if ((s == null) || s.equals("")){
            return null;
        }
        return new YearMonth(s);
    }
View Full Code Here

            return null;
        }
    }

    public static YearMonth convertTogYearMonth(String s) {
        return new YearMonth(s);
    }
View Full Code Here

    public static YearMonth convertToGYearMonth(String s) {
        if ((s == null) || s.equals("")){
            return null;
        }
        return new YearMonth(s);
    }
View Full Code Here

    public static YearMonth convertToGYearMonth(String s) {
        if ((s == null) || s.equals("")){
            return null;
        }
        return new YearMonth(s);
    }
View Full Code Here

    public static YearMonth convertToGYearMonth(String s) {
        if ((s == null) || s.equals("")){
            return null;
        }
        return new YearMonth(s);
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.databinding.types.YearMonth

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.