Package java.beans

Examples of java.beans.XMLDecoder$Elem


            geometricCalibratorSettings = null;
            colorCalibratorSettings = null;
            calibrationFile = null;
            calibrationWorker = null;
        } else {
            XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(file)));
            cameraSettings = (CameraSettings)decoder.readObject();
            projectorSettings = (ProjectorSettings)decoder.readObject();
            markerSettings = (Marker.ArraySettings)decoder.readObject();
            markerDetectorSettings = (MarkerDetector.Settings)decoder.readObject();
            geometricCalibratorSettings = (CalibrationWorker.GeometricSettings)decoder.readObject();
            colorCalibratorSettings = (CalibrationWorker.ColorSettings)decoder.readObject();
            try {
                String s = (String)decoder.readObject();
                calibrationFile = s == null ? null : new File(s);
            } catch (java.lang.ArrayIndexOutOfBoundsException ex) { }
            decoder.close();
        }

        settingsFile = file;
        if (settingsFile == null) {
            setTitle("ProCamCalib");
View Full Code Here


                        XMLEncoder encoder = new XMLEncoder(baos2);
//                                encoder.writeObject(BigDecimal.valueOf(last)); // not supported !!
                        encoder.writeObject(Calendar.getInstance());
                        encoder.close();

                        XMLDecoder decoder = new XMLDecoder(new ByteArrayInputStream(baos2.toByteArray()));
                        for (int j = 0; j < 1; j++)
                            decoder.readObject();

                        long now = System.nanoTime();
                        h.sample(now - last);

                        if (i >= 0)
View Full Code Here

  }

  public JComponent getSettingsView( RenderContext context )
  {
    try {
      final XMLDecoder      d  = new XMLDecoder( this.getClass().getClassLoader().getResourceAsStream(
                          "NeedleholeGUI.xml" ));
      final Object        o  = d.readObject();
      final JComponent      jc  = (JComponent) o;
      final JPanel        p  = new JPanel( new BorderLayout( 8, 0 ));
      d.close();
     
      ut = (DefaultUnitTranslator) jc.getClientProperty( "de.sciss.gui.UT" );
      if( ut != null ) ut.setLengthAndRate( context.getTimeSpan().getLength(), context.getSourceRate() );
      GUIUtil.setPreferences( jc, prefs );
     
View Full Code Here

        xmlOut.close();
    }
   
    /** {@inheritDoc} */
    public Object decode(InputStream source) throws IOException {
        XMLDecoder xmlIn = new XMLDecoder(source);
        return xmlIn.readObject();
    }
View Full Code Here

    }

    @Override
    public void restore() throws IOException {
        FileInputStream input = new FileInputStream(projectLocation + "\\config.xml");
        XMLDecoder decoder = new XMLDecoder(input);
        projectName = (String)decoder.readObject();
        projectLocation = (String)decoder.readObject();
        studentsFolder = (String)decoder.readObject();
        testsFolder = (String)decoder.readObject();
        assignmentType = "exe";
        decoder.close();
    }
View Full Code Here

public class SerializableLiteralTransformer extends AbstractLiteralTransformer<Serializable> implements LiteralTransformer<Serializable>{
  @Override
  public Serializable loadObject(Class valueClass, Vertex key) {
    Object value = key.getProperty(Properties.value.name());
    ByteArrayInputStream stream = new ByteArrayInputStream(value.toString().getBytes());
    XMLDecoder decoder = new XMLDecoder(stream);
    return (Serializable) decoder.readObject();
  }
View Full Code Here

  /**
     Loads a Shape3D serialized to XML using XML encoding for Java Beans
   */ 
  static public Shape3D xml2shape(String fname) {
    try {
      XMLDecoder d = new XMLDecoder(urlInput(fname));
      Object result = d.readObject();
      d.close();
      return (Shape3D)result;
    }
    catch(Exception e) {
      e.printStackTrace();
    }
View Full Code Here

    }

    @Override
    @SuppressWarnings("unchecked")
    public void readData() throws IOException {
        XMLDecoder d = new XMLDecoder(new BufferedInputStream(new FileInputStream(getFile())));
        dictionary = (Map<String,Object>)d.readObject();
        customReadData(d);
        d.close();
    }
View Full Code Here

        ClassLoader ccl = Thread.currentThread().getContextClassLoader();
        try
        {
            Thread.currentThread().setContextClassLoader( Utils.class.getClassLoader() );
            ByteArrayInputStream bais = new ByteArrayInputStream( LdifUtils.utf8encode( s ) );
            XMLDecoder decoder = new XMLDecoder( bais );
            Object o = decoder.readObject();
            decoder.close();
            return o;
        }
        finally
        {
            Thread.currentThread().setContextClassLoader( ccl );
View Full Code Here

    e.writeObject(w);
    e.close();
  }

  public static MapredLocalWork deserializeMapRedLocalWork(InputStream in, Configuration conf) {
    XMLDecoder d = new XMLDecoder(in, null, null, conf.getClassLoader());
    MapredLocalWork ret = (MapredLocalWork) d.readObject();
    d.close();
    return (ret);
  }
View Full Code Here

TOP

Related Classes of java.beans.XMLDecoder$Elem

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.