Package java.beans

Examples of java.beans.XMLEncoder.writeObject()


  public static void writeObjectAsXML(Object o, String file) {

    XMLEncoder e;
    try {
      e = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(file)));
      e.writeObject(o);
      e.close();
    } catch (FileNotFoundException e1) {
      throw new OLATRuntimeException(Util.class, "Error writing object to XML.", e1);
    }
View Full Code Here


            // write first to a temporary file
            final File tmpFile = new File(this.propFile.toString() + ".prt");

            // write file
            final XMLEncoder xmlenc = new XMLEncoder(new FileOutputStream(tmpFile));
            xmlenc.writeObject(tables);
            xmlenc.close();
           
            // delete old file and rename tmp-file to old file's name
            FileUtils.deletedelete(this.propFile);
            tmpFile.renameTo(this.propFile);
View Full Code Here

        for (Entry<String, Object> entry : settingsManager.getClientProperties().entrySet()) {
            writer.writeStartElement(ELEMENT_SETTINGS_PROPERTY);
            writer.writeAttribute("key", entry.getKey());
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            XMLEncoder xmlEncoder = new XMLEncoder(stream);
            xmlEncoder.writeObject(entry.getValue());
            xmlEncoder.close();
            writer.writeAttribute("value", stream.toString());
            writer.writeEndElement();
        }
        writer.writeEndElement();
View Full Code Here

        } else {
            setTitle(settingsFile.getName() + " - ProCamCalib");
        }

        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(settingsFile)));
        encoder.writeObject(cameraSettings);
        encoder.writeObject(projectorSettings);
        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
View Full Code Here

            setTitle(settingsFile.getName() + " - ProCamCalib");
        }

        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(settingsFile)));
        encoder.writeObject(cameraSettings);
        encoder.writeObject(projectorSettings);
        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
        if (calibrationFile != null) {
View Full Code Here

        }

        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(settingsFile)));
        encoder.writeObject(cameraSettings);
        encoder.writeObject(projectorSettings);
        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
        if (calibrationFile != null) {
            encoder.writeObject(calibrationFile.getAbsolutePath());
View Full Code Here

        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(settingsFile)));
        encoder.writeObject(cameraSettings);
        encoder.writeObject(projectorSettings);
        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
        if (calibrationFile != null) {
            encoder.writeObject(calibrationFile.getAbsolutePath());
        }
View Full Code Here

        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(settingsFile)));
        encoder.writeObject(cameraSettings);
        encoder.writeObject(projectorSettings);
        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
        if (calibrationFile != null) {
            encoder.writeObject(calibrationFile.getAbsolutePath());
        }
        encoder.close();
View Full Code Here

        encoder.writeObject(cameraSettings);
        encoder.writeObject(projectorSettings);
        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
        if (calibrationFile != null) {
            encoder.writeObject(calibrationFile.getAbsolutePath());
        }
        encoder.close();
    }
View Full Code Here

        encoder.writeObject(markerSettings);
        encoder.writeObject(markerDetectorSettings);
        encoder.writeObject(geometricCalibratorSettings);
        encoder.writeObject(colorCalibratorSettings);
        if (calibrationFile != null) {
            encoder.writeObject(calibrationFile.getAbsolutePath());
        }
        encoder.close();
    }

    /** This method is called from within the constructor to
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.