protected Expression instantiate(Object oldInstance, Encoder out)
{
Class type = oldInstance.getClass().getComponentType();
// oldInstance is expected to be an array, then
// getClass().getComponentType() should lead
// to its component type.
assert (type != null);
// Not handling primitive types in a special way here
// causes that Class.forName("int") is built as an Expression
// later which would cause an exception if executed. A special
// handling to avoid the execution for primitive types can be
// java.beans.Encoder.writeExpression() .
return new Expression(
oldInstance,
Array.class,
"newInstance",
new Object[] {
type,
new Integer(Array.getLength(oldInstance)) });
}
ArrayPersistenceDelegate.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:javify
作者:
评论列表
文章目录