src/share/classes/sun/util/spi/XmlPropertiesProvider.java

Print this page




  38  * @see Properties#loadFromXML
  39  * @see Properties#storeToXML
  40  */
  41 
  42 public abstract class XmlPropertiesProvider {
  43 
  44     /**
  45      * Initializes a new instance of this class.
  46      */
  47     protected XmlPropertiesProvider() {
  48         // do nothing for now
  49     }
  50 
  51     /**
  52      * Loads all of the properties represented by the XML document on the
  53      * specified input stream into a properties table.
  54      *
  55      * @param props the properties table to populate
  56      * @param in the input stream from which to read the XML document
  57      * @throws IOException if reading from the specified input stream fails



  58      * @throws InvalidPropertiesFormatException Data on input stream does not
  59      *         constitute a valid XML document with the mandated document type.
  60      *
  61      * @see Properties#loadFromXML
  62      */
  63     public abstract void load(Properties props, InputStream in)
  64         throws IOException, InvalidPropertiesFormatException;
  65 
  66     /**
  67      * Emits an XML document representing all of the properties in a given
  68      * table.
  69      *
  70      * @param props the properies to store
  71      * @param out the output stream on which to emit the XML document.
  72      * @param comment  a description of the property list, can be @{code null}
  73      * @param encoding the name of a supported character encoding
  74      *
  75      * @throws IOException if writing to the specified output stream fails


  76      * @throws NullPointerException if {@code out} is null.
  77      * @throws ClassCastException  if this {@code Properties} object
  78      *         contains any keys or values that are not
  79      *         {@code Strings}.
  80      *
  81      * @see Properties#storeToXML
  82      */
  83     public abstract void store(Properties props, OutputStream out,
  84                                String comment, String encoding)
  85         throws IOException;
  86 }


  38  * @see Properties#loadFromXML
  39  * @see Properties#storeToXML
  40  */
  41 
  42 public abstract class XmlPropertiesProvider {
  43 
  44     /**
  45      * Initializes a new instance of this class.
  46      */
  47     protected XmlPropertiesProvider() {
  48         // do nothing for now
  49     }
  50 
  51     /**
  52      * Loads all of the properties represented by the XML document on the
  53      * specified input stream into a properties table.
  54      *
  55      * @param props the properties table to populate
  56      * @param in the input stream from which to read the XML document
  57      * @throws IOException if reading from the specified input stream fails
  58      * @throws java.io.UnsupportedEncodingException if the document's encoding
  59      *         declaration can be read and it specifies an encoding that is not
  60      *         supported
  61      * @throws InvalidPropertiesFormatException Data on input stream does not
  62      *         constitute a valid XML document with the mandated document type.
  63      *
  64      * @see Properties#loadFromXML
  65      */
  66     public abstract void load(Properties props, InputStream in)
  67         throws IOException, InvalidPropertiesFormatException;
  68 
  69     /**
  70      * Emits an XML document representing all of the properties in a given
  71      * table.
  72      *
  73      * @param props the properies to store
  74      * @param out the output stream on which to emit the XML document.
  75      * @param comment  a description of the property list, can be @{code null}
  76      * @param encoding the name of a supported character encoding
  77      *
  78      * @throws IOException if writing to the specified output stream fails
  79      * @throws java.io.UnsupportedEncodingException if the encoding is not
  80      *         supported by the implementation
  81      * @throws NullPointerException if {@code out} is null.
  82      * @throws ClassCastException  if this {@code Properties} object
  83      *         contains any keys or values that are not
  84      *         {@code Strings}.
  85      *
  86      * @see Properties#storeToXML
  87      */
  88     public abstract void store(Properties props, OutputStream out,
  89                                String comment, String encoding)
  90         throws IOException;
  91 }