Examples of DataFormat


Examples of org.apache.camel.spi.DataFormat

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {

                //context.setTracing(true);
                DataFormat syslogDataFormat = new Rfc3164SyslogDataFormat();

                // we setup a Syslog  listener on a random port.
                from("mina:udp://127.0.0.1:" + serverPort).unmarshal(syslogDataFormat).process(new Processor() {
                    public void process(Exchange ex) {
                        assertTrue(ex.getIn().getBody() instanceof SyslogMessage);
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {

                //context.setTracing(true);
                DataFormat syslogDataFormat = new Rfc3164SyslogDataFormat();

                // we setup a Syslog  listener on a random port.
                from("netty:udp://127.0.0.1:" + serverPort + "?sync=false&allowDefaultCodec=false").unmarshal(syslogDataFormat)
                    .process(new Processor() {
                        public void process(Exchange ex) {
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

    // we style the second cell as a date (and time). It is important to
    // create a new cell style from the workbook
    // otherwise you can end up modifying the built in style and effecting
    // not only this cell but other cells.
    HSSFCellStyle cellStyle = wb.createCellStyle();
    DataFormat df = wb.createDataFormat();
    // cellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));
    cellStyle.setDataFormat(df.getFormat("YYYY-MM-DD HH:MM:SS"));
    cell = row.createCell(1);
    cell.setCellValue(new Date());
    cell.setCellStyle(cellStyle);
    // Write the output to a file
    FileOutputStream fileOut = new FileOutputStream("src/test/resources/workbook.xls");
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

        optionsStyle.cloneStyleFrom(commonStyle);
        optionsStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
        optionsStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());

        CreationHelper helper = workbook.getCreationHelper();
        DataFormat df = helper.createDataFormat();

        dataStyle = workbook.createCellStyle();
        dataStyle.cloneStyleFrom(commonStyle);

        dateDataStyle = workbook.createCellStyle();
        dateDataStyle.cloneStyleFrom(commonStyle);
        dateDataStyle.setDataFormat(df.getFormat("yyyy-mm-dd"));

        timeDataStyle = workbook.createCellStyle();
        timeDataStyle.cloneStyleFrom(commonStyle);
        timeDataStyle.setDataFormat(df.getFormat("hh:mm:ss"));

        datetimeDataStyle = workbook.createCellStyle();
        datetimeDataStyle.cloneStyleFrom(commonStyle);
        datetimeDataStyle.setDataFormat(df.getFormat("yyyy-mm-dd hh:mm:ss"));
    }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

        titleStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
        titleStyle.setFillForegroundColor(IndexedColors.LIGHT_GREEN.getIndex());
        titleStyle.setAlignment(CellStyle.ALIGN_CENTER);

        CreationHelper helper = workbook.getCreationHelper();
        DataFormat df = helper.createDataFormat();

        dataStyle = workbook.createCellStyle();
        dataStyle.cloneStyleFrom(commonStyle);

        dateDataStyle = workbook.createCellStyle();
        dateDataStyle.cloneStyleFrom(commonStyle);
        dateDataStyle.setDataFormat(df.getFormat("yyyy-mm-dd"));

        timeDataStyle = workbook.createCellStyle();
        timeDataStyle.cloneStyleFrom(commonStyle);
        timeDataStyle.setDataFormat(df.getFormat("hh:mm:ss"));

        datetimeDataStyle = workbook.createCellStyle();
        datetimeDataStyle.cloneStyleFrom(commonStyle);
        datetimeDataStyle.setDataFormat(df.getFormat("yyyy-mm-dd hh:mm:ss"));
    }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

        centerAlignFixedValueStyle = workbook.createCellStyle();
        centerAlignFixedValueStyle.cloneStyleFrom(fixedValueStyle);
        centerAlignFixedValueStyle.setAlignment(CellStyle.ALIGN_CENTER);

        CreationHelper helper = workbook.getCreationHelper();
        DataFormat df = helper.createDataFormat();

        dateTimeStyle = workbook.createCellStyle();
        dateTimeStyle.cloneStyleFrom(commonStyle);
        dateTimeStyle.setDataFormat(df.getFormat("yyyy-mm-dd hh:mm:ss"));

        dateStyle = workbook.createCellStyle();
        dateStyle.cloneStyleFrom(commonStyle);
        dateStyle.setDataFormat(df.getFormat("yyyy-mm-dd"));
    }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

            return integerStyle;
        }

        private short getFormat(String datetimeFormatPattern) {
            CreationHelper creationHelper = workbook.getCreationHelper();
            DataFormat dataFormat = creationHelper.createDataFormat();
            return dataFormat.getFormat(datetimeFormatPattern);
        }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

    if (borderBottom != null) {
      cellStyle.setBorderBottom(borderBottom);
    }
   
    if(dataFormat!=null){
      DataFormat format = wb.createDataFormat();
      cellStyle.setDataFormat(format.getFormat(dataFormat));
    }
    return cellStyle;

  }
View Full Code Here

Examples of org.apache.poi.ss.usermodel.DataFormat

                CellStyle cellStyle = row.getSheet().getWorkbook().createCellStyle();
   
                String javaDateFormatPattern = ((SimpleDateFormat)dateFormat).toPattern();
                String excelFormatPattern = DateFormatConverter.convert(locale, javaDateFormatPattern);
   
                DataFormat poiFormat = row.getSheet().getWorkbook().createDataFormat();
                cellStyle.setDataFormat(poiFormat.getFormat(excelFormatPattern));
                row.createCell(3).setCellValue(dateFormat.format(date));
   
                cell.setCellStyle(cellStyle);
   
                // the formula returns TRUE is the formatted date in column C equals to the string in column D
View Full Code Here

Examples of org.geoserver.importer.DataFormat

                return false;
            }
        }));

        if (!files.isEmpty()) {
            DataFormat format = format();
            if (format == null) {
                throw new IllegalArgumentException("Unable to determine format for mosaic files");
            }
   
            if (!(format instanceof RasterFormat)) {
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.