Package com.skaringa.javaxml

Examples of com.skaringa.javaxml.SerializerException


      objReader.setContentHandler(transHand);
      // parse and transform
      objReader.parse(new ObjectInputSource(obj));
    } catch (IOException e) {
      Log.error(e);
      throw new SerializerException(e.getMessage());
    } catch (org.xml.sax.SAXException e) {
      Log.error(e);
      Exception emb = e.getException();
      if (emb instanceof SerializerException) {
        throw (SerializerException) emb;
      }
      throw new SerializerException(e.getMessage());
    }
  }
View Full Code Here


      Object member;
      try {
        // get the value of the field
        member = fields[i].get(obj);
      } catch (IllegalAccessException e) {
        throw new SerializerException("can't access element " + fieldName
            + " of class " + c.getName());
      }

      Class fieldType = (member == null) ? fields[i].getType() : member
          .getClass();
View Full Code Here

      try {
        // get the value of the field
        member = fields[i].get(obj);
      }
      catch (IllegalAccessException e) {
        throw new SerializerException(
          "can't access element " + fieldName + " of class " + c.getName());
      }

      Class fieldType =
        (member == null) ? fields[i].getType() : member.getClass();
View Full Code Here

      return activate.invoke(obj, new Object[0]);
    } catch (NoSuchMethodException e) {
      return obj;
    } catch (IllegalAccessException e) {
      throw new SerializerException("can't access method " + methodName
          + " of class: " + _xmlTypeName);
    } catch (InvocationTargetException e) {
      throw new SerializerException("exception in " + methodName + ": "
          + e.getMessage());
    }
  }
View Full Code Here

    final String fieldName = "skaFieldOrder";
    try {
      Field field = type.getDeclaredField(fieldName);
      field.setAccessible(true);
      if (!String[].class.equals(field.getType())) {
        throw new SerializerException(fieldName + " of class: "
            + type.getName() + " must be of type String[]");
      }
      return new SkaFieldOrderComparator((String[]) field.get(null));
    } catch (NoSuchFieldException e) {
      return null;
    } catch (IllegalAccessException e) {
      throw new SerializerException("can't access field " + fieldName
          + " of class: " + type.getName());
    } catch (NullPointerException e) {
      throw new SerializerException(fieldName + " of class: " + type.getName()
          + " must be static");
    }
  }
View Full Code Here

    java.util.Map.Entry comp;
    try {
      comp = (java.util.Map.Entry) obj;
    }
    catch (ClassCastException e) {
      throw new SerializerException(
        "wrong context: obj needs to be of type java.util.Map.Entry, but is: "
          + obj.getClass().getName());
    }

    startElement(obj, getXMLTypeName(), name, propertyMap, output);
View Full Code Here

    java.util.Map.Entry comp;
    try {
      comp = (java.util.Map.Entry) obj;
    }
    catch (ClassCastException e) {
      throw new SerializerException(
        "wrong context: obj needs to be of type java.util.Map.Entry, but is: "
          + obj.getClass().getName());
    }

    if (null != comp) {
View Full Code Here

TOP

Related Classes of com.skaringa.javaxml.SerializerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.