Search in sources :

Example 1 with MapInfoDocument

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument in project poi by apache.

the class MapInfo method writeTo.

protected void writeTo(OutputStream out) throws IOException {
    MapInfoDocument doc = MapInfoDocument.Factory.newInstance();
    doc.setMapInfo(mapInfo);
    doc.save(out, DEFAULT_XML_OPTIONS);
}
Also used : MapInfoDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument)

Example 2 with MapInfoDocument

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument in project poi by apache.

the class MapInfo method readFrom.

public void readFrom(InputStream is) throws IOException {
    try {
        MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
        mapInfo = doc.getMapInfo();
        maps = new HashMap<Integer, XSSFMap>();
        for (CTMap map : mapInfo.getMapArray()) {
            maps.put((int) map.getID(), new XSSFMap(map, this));
        }
    } catch (XmlException e) {
        throw new IOException(e.getLocalizedMessage());
    }
}
Also used : XmlException(org.apache.xmlbeans.XmlException) XSSFMap(org.apache.poi.xssf.usermodel.XSSFMap) MapInfoDocument(org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument) IOException(java.io.IOException) CTMap(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMap)

Aggregations

MapInfoDocument (org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument)2 IOException (java.io.IOException)1 XSSFMap (org.apache.poi.xssf.usermodel.XSSFMap)1 XmlException (org.apache.xmlbeans.XmlException)1 CTMap (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMap)1