> ...then reflection would not be able to tell you that the instance you
created was intended to hold Strings.

If I create an abstract parent-class:

public abstract class ParentPage<K, V> {
   public abstract void setKey(K key);
   public abstract K getKey();
   public abstract void setValue(V value);
   public abstract V getValue();
}

And then I create an abstract subclass with a main-method:

public abstract class ChildPage extends ParentPage<Integer, List> {
   Integer key;
   List value;

   public Integer getKey() { return key; }
   public void setKey(Integer key) { this.key = key; }
   public List getValue() { return value; }
   public void setValue(List value) { this.value = value; }

   public static void main(String[] args) {
      for(Method method : ChildPage.class.getMethods()) {
         if(!"void".equals(method.getReturnType().getName())) {
            System.out.printf("Method: '%s', returnType '%s'\n",
method.getName(), method.getGenericReturnType());
         }
      }
   }
}

And I run the main-method of the subclass, the output is:
Method: 'getValue', returnType 'interface java.util.List'
Method: 'getValue', returnType 'class java.lang.Object'
Method: 'getKey', returnType 'class java.lang.Integer'
Method: 'getKey', returnType 'class java.lang.Object'
[...]

Same goes for parameter-types.
Tapestry already has the className of the page it wants to
subclass/implement. To me it seems everything Tapestry needs to know is
available. As a matter of fact.... it may even be possible to implement
it without creating a dependancy on Java5 (in a Java5 VM you get more
methods with the same signatures back but with different return-types,
which is not possible in an older VM)?


Regards,

Onno Scheffers



DISCLAIMER:

Dit bericht (met bijlagen) is met grote zorgvuldigheid samengesteld. Voor 
mogelijke onjuistheid en/of onvolledigheid van de hierin verstrekte informatie 
kan Kennisnet geen aansprakelijkheid aanvaarden, evenmin kunnen aan de inhoud 
van dit bericht (met bijlagen) rechten worden ontleend. De inhoud van dit 
bericht (met bijlagen) kan vertrouwelijke informatie bevatten en is uitsluitend 
bestemd voor de geadresseerde van dit bericht. Indien u niet de beoogde 
ontvanger van dit bericht bent, verzoekt Kennisnet u dit bericht te 
verwijderen, eventuele bijlagen niet te openen en wijst Kennisnet u op de 
onrechtmatigheid van het gebruiken, kopiƫren of verspreiden van de inhoud van 
dit bericht (met bijlagen).

This message (with attachments) is given in good faith. Kennisnet cannot assume 
any responsibility for the accuracy or reliability of the information contained 
in this message (with attachments), nor shall the information be construed as 
constituting any obligation on the part of Kennisnet. The information contained 
in this message (with attachments) may be confidential or privileged and is 
only intended for the use of the named addressee. If you are not the intended 
recipient, you are requested by Kennisnet to delete this message (with 
attachments) without opening it and you are notified by Kennisnet that any 
disclosure, copying or distribution of the information contained in this 
message (with attachments) is strictly prohibited and unlawful.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to