private static JavaTransformType toJavaTransformType(QName fromType, QName toType) {
   if (QNameUtil.isJavaMessageType(fromType)) {
     if (QNameUtil.isJavaMessageType(toType)) {
       throw TransformMessages.MESSAGES.bothJavaTypes();
     }
     return JavaTransformType.JAVA2XML;
   } else if (QNameUtil.isJavaMessageType(toType)) {
     if (QNameUtil.isJavaMessageType(fromType)) {
       throw TransformMessages.MESSAGES.bothJavaTypes();
     }
     return JavaTransformType.XML2JAVA;
   } else {
     throw TransformMessages.MESSAGES.neitherJavaType();
   }
 }
 private static String getJavaPackage(QName type) {
   return QNameUtil.toJavaMessageType(type).getPackage().getName();
 }