Class Beans


  • public class Beans
    extends java.lang.Object
    Deprecated.
    Utilities to manipulate and process JavaBeans.
    Author:
    Garret Wilson
    • Constructor Summary

      Constructors 
      Constructor Description
      Beans()
      Deprecated.
      Default constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.beans.XMLEncoder createUpgradedXMLEncoder​(java.io.OutputStream out)
      Deprecated.
      Constructs an XMLEncoder and upgrades it to support other non-JavaBean classes.
      static void upgradeEncoder​(java.beans.Encoder encoder)
      Deprecated.
      Upgrades an encoder to support encoding of other non-JavaBean classes.
      static java.lang.Object xmlDecode​(java.io.File file)
      Deprecated.
      Reads the given JavaBean to the file using long-term XML-encoded persistence.
      static void xmlEncode​(java.lang.Object object, java.io.File file)
      Deprecated.
      Writes the given JavaBean to the file using long-term XML-encoded persistence.
      static void xmlEncode​(java.lang.Object object, java.io.File file, boolean createBackup)
      Deprecated.
      Writes the given JavaBean to the file using long-term XML-encoded persistence.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Beans

        public Beans()
        Deprecated.
        Default constructor.
    • Method Detail

      • upgradeEncoder

        public static void upgradeEncoder​(java.beans.Encoder encoder)
        Deprecated.
        Upgrades an encoder to support encoding of other non-JavaBean classes. New classes supported are:
        • File - Constructed by File.getAbsolutePath
        Parameters:
        encoder - The encoder to be upgraded.
      • createUpgradedXMLEncoder

        public static java.beans.XMLEncoder createUpgradedXMLEncoder​(java.io.OutputStream out)
        Deprecated.
        Constructs an XMLEncoder and upgrades it to support other non-JavaBean classes.
        Parameters:
        out - The stream to which the XML representation of the objects will be sent.
        Returns:
        A new XMLEncoder which supports encoding of other other non-JavaBean classes.
        See Also:
        XMLEncoder, upgradeEncoder(Encoder)
      • xmlEncode

        public static void xmlEncode​(java.lang.Object object,
                                     java.io.File file)
                              throws java.io.FileNotFoundException
        Deprecated.
        Writes the given JavaBean to the file using long-term XML-encoded persistence.
        Parameters:
        object - The object to store.
        file - The file in which the object should be stored.
        Throws:
        java.io.FileNotFoundException - Thrown if the specified file is invalid.
      • xmlEncode

        public static void xmlEncode​(java.lang.Object object,
                                     java.io.File file,
                                     boolean createBackup)
                              throws java.io.FileNotFoundException
        Deprecated.
        Writes the given JavaBean to the file using long-term XML-encoded persistence. If a backup is created, its filename is formed by adding a ".backup" extension to the filename.
        Parameters:
        object - The object to store.
        file - The file in which the object should be stored.
        createBackup - Whether existing files should be saved in a backup file.
        Throws:
        java.io.FileNotFoundException - Thrown if the specified file is invalid.
      • xmlDecode

        public static java.lang.Object xmlDecode​(java.io.File file)
                                          throws java.io.FileNotFoundException
        Deprecated.
        Reads the given JavaBean to the file using long-term XML-encoded persistence.
        Parameters:
        file - The file in which the object is stored.
        Returns:
        The object retrieved by the given file.
        Throws:
        java.io.FileNotFoundException - Thrown if the specified file does not exist.