if( !PBMessage.class.isAssignableFrom(type) ) {
throw new IllegalArgumentException("Invalid "+name()+" serialization method: method argument not a "+PBMessage.class.getName());
}
// Get the factory instance...
PBMessageFactory factory = (PBMessageFactory) type.getEnclosingClass().getField("FACTORY").get(null);
PBMessage msg = factory.parseUnframed(source);
String name = type.getName();
Object rc;
if( name.endsWith("$Getter") || name.endsWith("$Buffer") ) {
// Interface is ok we us giving them a read only impl.
rc = msg;