特別是我指的是這段代碼,我試圖根據Class對象理解它在做什麼。什麼是C#中的Java類的等價物?
在下面的代碼中,Class是什麼意思?它與C#中的'Type'相同嗎?
另外isSuperTypeOf()方法在'類類型'方面做了什麼?他們寫這個方法的方式我不知道哪個'type'屬性是哪個。本文檔 Dynamic Object Model
class PropertyType {
protected String name;
protected Class type;
protected boolean isMandatory;
...
public String getName() {
return name;
}
public boolean isSupertypeOf(Class type) {
return type.isAssignableFrom(type);
}
public boolean isValidValue(Object value) {
// check value, possibly delegate to a strategy
}
...
}
您正在查找文檔。 – SLaks 2015-01-21 03:41:22
在C#中,傳遞給isSupertypeOf方法的類型變量聲明會「隱藏」類中聲明的類型字段。 – 2015-01-21 03:42:42