0

I've written a generic database that indexes all the fields of an instance of a class that have a specific annotation. I need to be able to write an instance of this database to a file, but the Field object doesn't implement serializable and is final.

Is there anyway around this?

Thanks!

4

1 回答 1

0

您可以只存储字段的名称(当然,作为字符串),因为名称在其声明类中必须是唯一的。如果您还需要处理静态成员——并且不清楚你是否这样做——isStatic为每个字符串存储一个额外的布尔值。

于 2013-05-05T14:05:33.970 回答