{
return new ValidationComponent ()
{
public void validate () throws ModelValidationException
{
Model model = getModel();
Object pcClass = null;
if (className == null)
return;
pcClass = model.getClass(className);
if (pcClass == null)
return;
if (model.implementsInterface(pcClass, "java.io.Serializable")) //NOI18N
{
// check readObject method
Object readMethod = model.getMethod(className,
"readObject", Model.getReadObjectArgs()); //NOI18N
if (!matchesMethod(readMethod, Modifier.PRIVATE,
Modifier.SYNCHRONIZED, "void")) // NOI18N
{
throw new ModelValidationException(pcClass,
I18NHelper.getMessage(getMessages(),
"util.validation.class_readobject", //NOI18N
className));
}
// check writeObject method
Object writeMethod = model.getMethod(className,
"writeObject", Model.getWriteObjectArgs()); //NOI18N
if (!matchesMethod(writeMethod, Modifier.PRIVATE,
Modifier.SYNCHRONIZED, "void")) // NOI18N
{