Home | History | Annotate | Download | only in serialization
      1 /* Copyright (c) 2003,2004, Stefan Haustein, Oberhausen, Rhld., Germany
      2  *
      3  * Permission is hereby granted, free of charge, to any person obtaining a copy
      4  * of this software and associated documentation files (the "Software"), to deal
      5  * in the Software without restriction, including without limitation the rights
      6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or
      7  * sell copies of the Software, and to permit persons to whom the Software is
      8  * furnished to do so, subject to the following conditions:
      9  *
     10  * The  above copyright notice and this permission notice shall be included in
     11  * all copies or substantial portions of the Software.
     12  *
     13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     19  * IN THE SOFTWARE.
     20  *
     21  * Contributor(s): John D. Beatty, F. Hunter, Renaud Tognelli
     22  *
     23  * */
     24 
     25 package org.ksoap2.serialization;
     26 
     27 import java.util.Hashtable;
     28 
     29 /**
     30  * Provides get and set methods for properties. Can be used to replace
     31  * reflection (to some extend) for "serialization-aware" classes. Currently used
     32  * in kSOAP and the RMS based kobjects object repository
     33  */
     34 
     35 public interface KvmSerializable {
     36 
     37     /**
     38      * Get the property at the given index
     39      */
     40     Object getProperty(int index);
     41 
     42     /**
     43      * @return the number of serializable properties
     44      */
     45     int getPropertyCount();
     46 
     47     /**
     48      * Sets the property with the given index to the given value.
     49      *
     50      * @param index
     51      *            the index to be set
     52      * @param value
     53      *            the value of the property
     54      */
     55     void setProperty(int index, Object value);
     56 
     57     /**
     58      * Fills the given property info record.
     59      *
     60      * @param index
     61      *            the index to be queried
     62      * @param properties
     63      *            information about the (de)serializer.  Not frequently used.
     64      * @param info
     65      *            The return parameter, to be filled with information about the
     66      *            property with the given index.
     67      */
     68     void getPropertyInfo(int index, Hashtable properties, PropertyInfo info);
     69 
     70 }
     71