Package java.beans

Examples of java.beans.XMLDecoder.readObject()


  }
 
  protected void doLoad( InputStream in )
  {
    XMLDecoder decoder = new XMLDecoder( in );
    UserManagerConfig managerConfig = (UserManagerConfig)decoder.readObject();
    for (Iterator iter = managerConfig.getUsers().iterator(); iter.hasNext();) {
      UserProfile user = (UserProfile) iter.next();
      usersMap.put(user.getUsername().toLowerCase(), user);
    }
    System.out.println("UserManager: registered " + usersMap.size() + " users");
View Full Code Here


  @SuppressWarnings("unchecked")
  public EventData(String xml) {
    ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
    try {
      XMLDecoder decoder = new XMLDecoder(bais);
      this.eventData = (Map<String, Object>) decoder.readObject();
    } catch (Exception e) {
      throw new EventException("Error decoding " + xml, e);
    }
  }
View Full Code Here

   public ChannelXmlBean readChannelBean(InputStream is) throws IOException {
      XMLDecoder bis = null;
      Object result = null;
      try {
         bis = new XMLDecoder(new BufferedInputStream(is));
         result = bis.readObject();
      } finally {
         if (is != null) {
            is.close();
         }
      }
View Full Code Here

      FileInputStream fis = null;
      Object result = null;
      try {
         fis = new FileInputStream(new File(file.getAbsolutePath()));
         bis = new XMLDecoder(new BufferedInputStream(fis));
         result = bis.readObject();
      } finally {
         _iou.closeInputStream(fis);
         if (bis != null) {
            bis.close();
         }
View Full Code Here

        Object result = null;
        try
        {
            // System.out.println("Read started!!! [" +
            // Thread.currentThread().getName() + "]");
            result = decoder.readObject();
            // System.out.println("Read finished!!! [" +
            // Thread.currentThread().getName() + "]");
        }
        finally
        {
View Full Code Here

            File file = new File(getPersistedFileName());
            if(file.exists()){
                XMLDecoder decoder = new XMLDecoder(
                                    new BufferedInputStream(
                                        new FileInputStream(getPersistedFileName())));
                Map persistedAlerts = (Map)decoder.readObject();
                alerts.putAll(persistedAlerts);
                decoder.close();
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
View Full Code Here

    public XMLTables(final File file) throws IOException {
        this.propFile = file;
        this.timestamp = System.currentTimeMillis();
        if (propFile.exists()) {
            final XMLDecoder xmldec = new XMLDecoder(new FileInputStream(propFile));
            tables = (HashMap<String, Map<String, String>>) xmldec.readObject();
            xmldec.close();
        } else {
            tables = new HashMap<String, Map<String, String>>();
        }
    }
View Full Code Here

                    String name = reader.getLocalName();
                    if (ELEMENT_SETTINGS_PROPERTY.equalsIgnoreCase(name)) {
                        String key = reader.getAttributeValue(null, "key");
                        String valueXML = reader.getAttributeValue(null, "value");
                        XMLDecoder xmlDecoder = new XMLDecoder(new ByteArrayInputStream(valueXML.getBytes()));
                        Object value = xmlDecoder.readObject();
                        settingsManager.putClientProperty(key, value);
                    }
                    break;
                case XMLStreamReader.END_ELEMENT:
                    if (ELEMENT_SETTINGS.equalsIgnoreCase(reader.getLocalName())) {
View Full Code Here

            trackingSettings = null;

            trackingWorker = null;
        } else {
            XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(file)));
            cameraSettings = (CameraDevice.Settings)decoder.readObject();
            projectorSettings = (ProjectorDevice.Settings)decoder.readObject();
            objectFinderSettings = (ObjectFinder.Settings)decoder.readObject();
            markerDetectorSettings = (MarkerDetector.Settings)decoder.readObject();
            alignerSettings = (GNImageAligner.Settings)decoder.readObject();
            handMouseSettings = (HandMouse.Settings)decoder.readObject();
View Full Code Here

            trackingWorker = null;
        } else {
            XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(file)));
            cameraSettings = (CameraDevice.Settings)decoder.readObject();
            projectorSettings = (ProjectorDevice.Settings)decoder.readObject();
            objectFinderSettings = (ObjectFinder.Settings)decoder.readObject();
            markerDetectorSettings = (MarkerDetector.Settings)decoder.readObject();
            alignerSettings = (GNImageAligner.Settings)decoder.readObject();
            handMouseSettings = (HandMouse.Settings)decoder.readObject();
            virtualBallSettings = (VirtualBall.Settings)decoder.readObject();
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.