Examples of DateUtils


Examples of com.amazonaws.util.DateUtils

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    List<String> timestamps = new LinkedList<String>();
                                    for ( Object o : (Set<?>) obj ) {
                                        timestamps.add(new DateUtils().formatIso8601Date((Date) o));
                                    }
                                    return new AttributeValue().withSS(timestamps);
                                }
                            };
                        } else if ( Calendar.class.isAssignableFrom(returnType) ) {
                            marshaller = new ArgumentMarshaller() {

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    List<String> timestamps = new LinkedList<String>();
                                    for ( Object o : (Set<?>) obj ) {
                                        timestamps.add(new DateUtils().formatIso8601Date(((Calendar) o).getTime()));
                                    }
                                    return new AttributeValue().withSS(timestamps);
                                }
                            };
                        } else if ( boolean.class.isAssignableFrom(returnType)
                                || Boolean.class.isAssignableFrom(returnType) ) {
                            marshaller = new ArgumentMarshaller() {

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    List<String> booleanAttributes = new ArrayList<String>();
                                    for ( Object b : (Set<?>) obj ) {
                                        if ( b == null || !(Boolean) b ) {
                                            booleanAttributes.add("0");
                                        } else {
                                            booleanAttributes.add("1");
                                        }
                                    }
                                    return new AttributeValue().withNS(booleanAttributes);
                                }
                            };
                        } else if ( returnType.isPrimitive() || Number.class.isAssignableFrom(returnType) ) {
                            marshaller = new ArgumentMarshaller() {

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    List<String> attributes = new ArrayList<String>();
                                    for ( Object o : (Set<?>) obj ) {
                                        attributes.add(String.valueOf(o));
                                    }
                                    return new AttributeValue().withNS(attributes);
                                }
                            };
                        } else if (ByteBuffer.class.isAssignableFrom(returnType)) {
                           marshaller = new ArgumentMarshaller() {

                                 @Override
                                 public AttributeValue marshall(Object obj) {
                                     List<ByteBuffer> attributes = new ArrayList<ByteBuffer>();
                                     for ( Object o : (Set<?>) obj ) {
                                         attributes.add((ByteBuffer) o);
                                     }
                                     return new AttributeValue().withBS(attributes);
                                 }
                             };
                        } else if (byte[].class.isAssignableFrom(returnType)) {
                           marshaller = new ArgumentMarshaller() {

                                 @Override
                                 public AttributeValue marshall(Object obj) {
                                     List<ByteBuffer> attributes = new ArrayList<ByteBuffer>();
                                     for ( Object o : (Set<?>) obj ) {
                                         attributes.add(ByteBuffer.wrap((byte[])o));
                                     }
                                     return new AttributeValue().withBS(attributes);
                                 }
                             };
                        } else {
                            marshaller = new ArgumentMarshaller() {

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    List<String> attributes = new ArrayList<String>();
                                    for ( Object o : (Set<?>) obj ) {
                                        attributes.add(String.valueOf(o));
                                    }
                                    return new AttributeValue().withSS(attributes);
                                }
                            };
                        }
                    } else if ( Collection.class.isAssignableFrom(returnType) ) {
                        throw new DynamoDBMappingException("Non-set collections aren't supported: "
                                + (getter.getDeclaringClass() + "." + getter.getName()));
                    } else {
                        if ( Date.class.isAssignableFrom(returnType) ) {
                            marshaller = new ArgumentMarshaller() {

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    return new AttributeValue().withS(new DateUtils().formatIso8601Date((Date) obj));
                                }
                            };
                        } else if ( Calendar.class.isAssignableFrom(returnType) ) {
                            marshaller = new ArgumentMarshaller() {

                                @Override
                                public AttributeValue marshall(Object obj) {
                                    return new AttributeValue().withS(new DateUtils()
                                            .formatIso8601Date(((Calendar) obj).getTime()));
                                }
                            };
                        } else if ( boolean.class.isAssignableFrom(returnType)
                                || Boolean.class.isAssignableFrom(returnType) ) {
View Full Code Here

Examples of com.amazonaws.util.DateUtils

            }
        }

        Date httpExpiresDate = metadata.getHttpExpiresDate();
        if (httpExpiresDate != null) {
            request.addHeader(Headers.EXPIRES, new DateUtils().formatRfc822Date(httpExpiresDate));
        }

        Map<String, String> userMetadata = metadata.getUserMetadata();
        if (userMetadata != null) {
            for (Entry<String, String> entry : userMetadata.entrySet()) {
View Full Code Here

Examples of com.jeecms.common.util.DateUtils

    String backpath = realPathResolver.get(Constants.BACKUP_PATH);
    File backDirectory = new File(backpath);
    if (!backDirectory.exists()) {
      backDirectory.mkdir();
    }
    DateUtils dateUtils = DateUtils.getDateInstance();
    String backFilePath = backpath + SLASH+ dateUtils.getNowString() + "."
        + SUFFIX;
    File file=new File(backFilePath);
    Thread thread =new DateBackupTableThread(file,tableNames);
    thread.start();
    return "data/backupProgress";
View Full Code Here

Examples of com.linkedin.camus.sweeper.utils.DateUtils

  }

  public CamusDailyCleaner(Properties props)
  {
    this.props = props;
    dUtils = new DateUtils(props);
    outputDailyFormat = dUtils.getDateTimeFormatter(OUTPUT_DAILY_FORMAT_STR);
    outputMonthFormat = dUtils.getDateTimeFormatter("YYYY/MM");
    outputYearFormat = dUtils.getDateTimeFormatter("YYYY");
  }
View Full Code Here

Examples of com.sun.star.wizards.common.Helper.DateUtils

            int day = cal.get(Calendar.DAY_OF_MONTH);
            DateTime currentDate = new DateTime();
            currentDate.Day = (short)day;
            currentDate.Month = (short)month;
            currentDate.Year = (short)year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat( NumberFormatIndex.DATE_SYS_DDMMYY );
            String myDate = du.format(ff, currentDate);

            XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument);
            XDocumentInfo xDocInfo = xDocInfoSuppl.getDocumentInfo();
            Helper.setUnoPropertyValue(xDocInfo, "Author", fullname);
            Helper.setUnoPropertyValue(xDocInfo, "ModifiedBy", fullname);
View Full Code Here

Examples of com.sun.star.wizards.common.Helper.DateUtils

            int day = cal.get(Calendar.DAY_OF_MONTH);
            DateTime currentDate = new DateTime();
            currentDate.Day = (short)day;
            currentDate.Month = (short)month;
            currentDate.Year = (short)year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat( NumberFormatIndex.DATE_SYS_DDMMYY );
            String myDate = du.format(ff, currentDate);

            XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument);
            XDocumentInfo xDocInfo2 = xDocInfoSuppl.getDocumentInfo();
            Helper.setUnoPropertyValue(xDocInfo2, "Author", fullname);
            Helper.setUnoPropertyValue(xDocInfo2, "ModifiedBy", fullname);
View Full Code Here

Examples of com.sun.star.wizards.common.Helper.DateUtils

            int day = cal.get(Calendar.DAY_OF_MONTH);
            DateTime currentDate = new DateTime();
            currentDate.Day = (short) day;
            currentDate.Month = (short) month;
            currentDate.Year = (short) year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat(NumberFormatIndex.DATE_SYS_DDMMYY);
            String myDate = du.format(ff, currentDate);

            XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
            XDocumentProperties xDocProps2 = xDocPropsSuppl.getDocumentProperties();
            xDocProps2.setAuthor(fullname);
            xDocProps2.setModifiedBy(fullname);
View Full Code Here

Examples of com.sun.star.wizards.common.Helper.DateUtils

        private int dateFormat,  numberFormat;
        private DateUtils dateUtils;

        public Formatter(XMultiServiceFactory xmsf, Object document) throws Exception
        {
            dateUtils = new DateUtils(xmsf, document);
            dateFormat = dateUtils.getFormat(NumberFormatIndex.DATE_SYS_DMMMYYYY);
            numberFormat = dateUtils.getFormat(NumberFormatIndex.NUMBER_1000DEC2);
        }
View Full Code Here

Examples of com.sun.star.wizards.common.Helper.DateUtils

            int day = cal.get(Calendar.DAY_OF_MONTH);
            DateTime currentDate = new DateTime();
            currentDate.Day = (short)day;
            currentDate.Month = (short)month;
            currentDate.Year = (short)year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat( NumberFormatIndex.DATE_SYS_DDMMYY );
            String myDate = du.format(ff, currentDate);
                       
            XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocument);
            XDocumentInfo xDocInfo = xDocInfoSuppl.getDocumentInfo();
            Helper.setUnoPropertyValue(xDocInfo, "Author", fullname);
            Helper.setUnoPropertyValue(xDocInfo, "ModifiedBy", fullname);
View Full Code Here

Examples of com.sun.star.wizards.common.Helper.DateUtils

            int day = cal.get(Calendar.DAY_OF_MONTH);
            DateTime currentDate = new DateTime();
            currentDate.Day = (short) day;
            currentDate.Month = (short) month;
            currentDate.Year = (short) year;
            DateUtils du = new DateUtils(xMSF, this.xTextDocument);
            int ff = du.getFormat(NumberFormatIndex.DATE_SYS_DDMMYY);
            String myDate = du.format(ff, currentDate);

            XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
            XDocumentProperties xDocProps2 = xDocPropsSuppl.getDocumentProperties();
            xDocProps2.setAuthor(fullname);
            xDocProps2.setModifiedBy(fullname);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.