Package java.beans

Examples of java.beans.XMLDecoder$Elem


    doLoad( bis );
  }
 
  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");
    decoder.close();
  }
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

  private XMLDecoder openBeanDecoder( InputStream objIS) {
    // filter stream for XMLDecoder
    try {
      InputMunger im = new InputMunger( objIS);
      XMLDecoder beanDecoder = new XMLDecoder( im, null, new ExceptionListener() {
        public void exceptionThrown(Exception e) {
          if (showDecoderExceptions)
            System.out.println("***XMLStore.read() got Exception= "+e.getClass().getName()+" "+e.getMessage());
          // e.printStackTrace();
        }
View Full Code Here

  
   /**
    * @see net.sourceforge.squirrel_sql.client.update.xmlbeans.UpdateXmlSerializer#readChannelBean(java.io.InputStream)
    */
   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

   /**
    * @see net.sourceforge.squirrel_sql.client.update.xmlbeans.UpdateXmlSerializer#readChangeListBean(net.sourceforge.squirrel_sql.fw.util.FileWrapper)
    */
   public ChangeListXmlBean readChangeListBean(FileWrapper file)
         throws FileNotFoundException {
      XMLDecoder bis = null;
      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();
         }
      }
      return (ChangeListXmlBean) result;     
   }
View Full Code Here

     *
     * @see de.netseeker.ejoe.adapter.SerializeAdapter#read(java.io.InputStream)
     */
    public Object read( InputStream in ) throws Exception
    {
        XMLDecoder decoder = new XMLDecoder( in );
        decoder.setExceptionListener( this );
        Object result = null;
        try
        {
            // System.out.println("Read started!!! [" +
            // Thread.currentThread().getName() + "]");
            result = decoder.readObject();
            // System.out.println("Read finished!!! [" +
            // Thread.currentThread().getName() + "]");
        }
        finally
        {
            if ( decoder != null ) decoder.close();
        }

        return result;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
  private void read(){
        try {
            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

    @SuppressWarnings("unchecked")
    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

                case XMLStreamReader.START_ELEMENT:
                    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

            realityAugmentorSettings = null;
            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();
            virtualBallSettings = (VirtualBall.Settings)decoder.readObject();
            realityAugmentorSettings = (RealityAugmentor.Settings)decoder.readObject();
            trackingSettings = (TrackingWorker.Settings)decoder.readObject();
            decoder.close();
        }

        settingsFile = file;
        if (settingsFile == null) {
            setTitle("ProCamTracker");
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.