Package com.bansheeproject.exceptions

Examples of com.bansheeproject.exceptions.ConverterException


  @Override
  protected String encodeImpl(Object source) {
    try {
      if (source == null)
        throw new ConverterException("Parameter cannot be null");
       
       
      ReadNode readNode = Mapper.getReadClassMapper(source.getClass()).mapObject(source);
      if (readNode == null)
        throw new ConverterException("Could not read anything from IgnoredEntity. Perhaps it contains an @AccessType(IGNORE) ?");
      Map<String, String> values = readNode.getSimpleValues();
      XMLBuilder xmlBuilder = new XMLBuilder();
      for (String key : values.keySet()) {
        xmlBuilder.put(key, values.get(key));
      }
      return xmlBuilder.getAsString();
    }
    catch (Exception ex) {
      if (ex instanceof ConverterException)
        throw (ConverterException)ex;
      throw new ConverterException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.bansheeproject.exceptions.ConverterException

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.