高级自定义 > 服务和基础结构自定义 > Evolvable 类 > Evolvable 类生成的外部化代码示例 > readVersion 方法示例
  
readVersion 方法示例
除非开发人员已通过设置 preserve=yes 接管了该方法的维护,否则,生成器会生成 readVersion 方法,且在该方法中,映射表中的每个 version/uid 行包含一个条件块。最终的 "else" 块将调用旧 readOldVersion() 方法,以支持可能已在此方法中实现的外部化代码。对于负 uid,负号将在方法名称中转换为下划线,因为破折号在 Java 方法名称中为无效字符。
protected boolean readVersion( MyItem thisObject, ObjectInput input,
long readSerialVersionUID, boolean passThrough, boolean superDone )
throws IOException, ClassNotFoundException {
throws IOException, ClassNotFoundException {
//##begin readVersion%readVersion.body preserve=no
boolean success = true;
if ( readSerialVersionUID == 6676079877272797361L )
return readVersion6676079877272797361L( input, readSerialVersionUID,
superDone );
else
success = readOldVersion( input, readSerialVersionUID, passThrough,
superDone );
if (input instanceof wt.pds.PDSObjectInput)
wt.fc.EvolvableHelper.requestRewriteOfEvolvedBlobbedObject();
return success;
//##end readVersion%readVersion.body
}