Castor和interface

wait4friend發表於2002-09-27
使用Castor的mapping機制,map檔案中為什麼不能對介面進行定義。如

public interface Person
{
 public void setName(String n);
 public String getName();
}
public class Man implements Person{...}
public class People
{
 private Person person = null;
 public void setPerson(Person p){...}
 public Person getPerson(){...}
}
map檔案
<class name="People">
 ...
</class> 
<class name="Person">
 <field name="name" type="string"/> 
</class>
<p class="indent">

執行marshall時報錯:method getName() in class Person can not accessable

相關文章