Package org.apache.poi.xssf.model

Examples of org.apache.poi.xssf.model.MapInfo


    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (!(p instanceof MapInfo)) {
        continue;
      }
      MapInfo mapInfo = (MapInfo) p;

      XSSFMap map = mapInfo.getXSSFMapById(1);
      XSSFExportToXml exporter = new XSSFExportToXml(map);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      exporter.exportToXML(os, true);
      String xml = os.toString("UTF-8");
View Full Code Here


  public void testExportToXMLInverseOrder() throws Exception {

    XSSFWorkbook wb = XSSFTestDataSamples
        .openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx");

    MapInfo mapInfo = null;

    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (!(p instanceof MapInfo)) {
        continue;
      }
      mapInfo = (MapInfo) p;

      XSSFMap map = mapInfo.getXSSFMapById(1);
      XSSFExportToXml exporter = new XSSFExportToXml(map);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      exporter.exportToXML(os, true);
      String xml = os.toString("UTF-8");
View Full Code Here

  public void testXPathOrdering() {

    XSSFWorkbook wb = XSSFTestDataSamples
        .openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx");

    MapInfo mapInfo = null;

    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (p instanceof MapInfo) {
        mapInfo = (MapInfo) p;

        XSSFMap map = mapInfo.getXSSFMapById(1);
        XSSFExportToXml exporter = new XSSFExportToXml(map);

        assertEquals(1, exporter.compare("/CORSO/DOCENTE", "/CORSO/NOME"));
        assertEquals(-1, exporter.compare("/CORSO/NOME", "/CORSO/DOCENTE"));
      }
View Full Code Here

        .openSampleWorkbook("CustomXMLMappings-complex-type.xlsx");

    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (p instanceof MapInfo) {
        MapInfo mapInfo = (MapInfo) p;

        XSSFMap map = mapInfo.getXSSFMapById(2);

        assertNotNull(map);

        XSSFExportToXml exporter = new XSSFExportToXml(map);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
View Full Code Here

        for (POIXMLDocumentPart p : wb.getRelations()) {

            if (!(p instanceof MapInfo)) {
                continue;
            }
            MapInfo mapInfo = (MapInfo) p;

            XSSFMap map = mapInfo.getXSSFMapById(2);

            assertNotNull("XSSFMap is null", map);

            XSSFExportToXml exporter = new XSSFExportToXml(map);
            ByteArrayOutputStream os = new ByteArrayOutputStream();
View Full Code Here

    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (!(p instanceof MapInfo)) {
        continue;
      }
      MapInfo mapInfo = (MapInfo) p;

      XSSFMap map = mapInfo.getXSSFMapById(1);
      XSSFExportToXml exporter = new XSSFExportToXml(map);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      exporter.exportToXML(os, true);
      String xml = os.toString("UTF-8");
View Full Code Here

  public void testExportToXMLInverseOrder() throws Exception {

    XSSFWorkbook wb = XSSFTestDataSamples
        .openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx");

    MapInfo mapInfo = null;

        boolean found = false;
    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (!(p instanceof MapInfo)) {
        continue;
      }
      mapInfo = (MapInfo) p;

      XSSFMap map = mapInfo.getXSSFMapById(1);
      XSSFExportToXml exporter = new XSSFExportToXml(map);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      exporter.exportToXML(os, true);
      String xml = os.toString("UTF-8");
View Full Code Here

  public void testXPathOrdering() {

    XSSFWorkbook wb = XSSFTestDataSamples
        .openSampleWorkbook("CustomXmlMappings-inverse-order.xlsx");

    MapInfo mapInfo = null;

        boolean found = false;
    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (p instanceof MapInfo) {
        mapInfo = (MapInfo) p;

        XSSFMap map = mapInfo.getXSSFMapById(1);
        XSSFExportToXml exporter = new XSSFExportToXml(map);

        assertEquals(1, exporter.compare("/CORSO/DOCENTE", "/CORSO/NOME"));
        assertEquals(-1, exporter.compare("/CORSO/NOME", "/CORSO/DOCENTE"));
      }
View Full Code Here

    boolean found = false;
    for (POIXMLDocumentPart p : wb.getRelations()) {

      if (p instanceof MapInfo) {
        MapInfo mapInfo = (MapInfo) p;

        XSSFMap map = mapInfo.getXSSFMapById(2);

        assertNotNull(map);

        XSSFExportToXml exporter = new XSSFExportToXml(map);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
View Full Code Here

        for (POIXMLDocumentPart p : wb.getRelations()) {

            if (!(p instanceof MapInfo)) {
                continue;
            }
            MapInfo mapInfo = (MapInfo) p;

            XSSFMap map = mapInfo.getXSSFMapById(2);

            assertNotNull("XSSFMap is null", map);

            XSSFExportToXml exporter = new XSSFExportToXml(map);
            ByteArrayOutputStream os = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of org.apache.poi.xssf.model.MapInfo

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.