Changeset 3975


Ignore:
Timestamp:
Nov 16, 2007, 9:42:05 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #827. Updated javadoc related to last check-in

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/info/net/sf/basedb/info/Transferable.java

    r3974 r3975  
    3232  can be used in the web services. We recommend that classes that implements
    3333  this interface also implements the {@link Serializable} interface.
     34  <p>
     35  Objects implementing this interface should also have public constructor
     36  without any arguments.
    3437 
    3538  @author nicklas
  • trunk/src/webservices/server/net/sf/basedb/ws/server/ServicesUtil.java

    r3974 r3975  
    7979 
    8080  /**
    81     Convert a list of objects to an array of info objects
    82     objects. This method uses reflection to find the correct method. For this
    83     to work there are a few requirements:
     81    Convert a list of objects to an array of {@link Transferable} objects
     82    objects. The objects in must be of the same type and implement the
     83    {@link ToTransferable} interface. The specified transferable class
     84    must hava a public no-argument constructor.
    8485   
    85     <ul>
    86     <li>The list must contain objects of the same class only.
    87     <li>The class for the objects in the list must contain a method
    88       with the name "toInfo".
    89     <li>The "toInfo" method must take an object of the specified
    90       info class as the single parameter.
    91     <li>The "toInfo" method must return the same object that was
    92       passed to it.
    93     </ul>
     86    See for example: {@link net.sf.basedb.core.Experiment#toTransferable(net.sf.basedb.info.ExperimentInfo)}
    9487   
    95     See for example: {@link net.sf.basedb.core.Experiment#toInfo(net.sf.basedb.info.ExperimentInfo)}
    96    
    97     <p>
    98     Note that this method is not limited to BasicItem object. It will work with
    99     any kind of object as long as the above requirements are fulfilled.
    100    
    101     @param list A list of BasicItem objects or one of the subclasses
    102     @param clazz The class of the BasicItemInfo that is matching the BasicItem:s
    103       in the list
    104     @return An array info objects of the specified class
     88    @param list A list of {@link ToTransferable} objects
     89    @param clazz The {@link Transferable} class that the objects in the list
     90      are beeing converted to
     91    @return An array info objects of the specified transferable class
    10592  */
    10693  @SuppressWarnings("unchecked")
    107   public <T extends Transferable> T[] listToInfo(List<? extends ToTransferable<T>> list, Class<T> clazz)
     94  public <T extends Transferable> T[] listToInfo(List<? extends ToTransferable<T>> list,
     95    Class<T> clazz)
    10896  {
    10997    T[] result = (T[])java.lang.reflect.Array.newInstance(clazz, list.size());
Note: See TracChangeset for help on using the changeset viewer.