Package com.thoughtworks.xstream.converters

Examples of com.thoughtworks.xstream.converters.ConversionException


        final String attributeName = getMapper().aliasForSystemAttribute("reference");
        final String reference = attributeName == null ? null : reader.getAttribute(attributeName);
        if (reference != null) {
            final Object cache = values.get(getReferenceKey(reference));
            if (cache == null) {
                final ConversionException ex = new ConversionException("Invalid reference");
                ex.add("reference", reference);
                throw ex;
            }
            result = cache == NULL ? null : cache;
        } else {
            final R currentReferenceKey = getCurrentReferenceKey();
View Full Code Here


public class CRSConverter implements SingleValueConverter {
    public Object fromString(String str){
        try{
            return CRS.decode(str);
        } catch (Exception e){
            throw new ConversionException(e);
        }
    }
View Full Code Here

    public String toString(Object obj){
        try{
            return CRS.lookupIdentifier((CoordinateReferenceSystem)obj, true);
        } catch (Exception e){
            throw new ConversionException(e);
        }
    }
View Full Code Here

   * {@inheritDoc}
   */
  public void marshal(Object value, HierarchicalStreamWriter writer,
    MarshallingContext context)
  {
    throw new ConversionException("XMapping marshalling is not implemented");
  }
View Full Code Here

   * {@inheritDoc}
   */
  public void marshal(Object value, HierarchicalStreamWriter writer,
    MarshallingContext context)
  {
    throw new ConversionException("XMapping marshalling is not implemented");
  }
View Full Code Here

   * {@inheritDoc}
   */
  public void marshal(Object value, HierarchicalStreamWriter writer,
    MarshallingContext context)
  {
    throw new ConversionException("XMappingSet marshalling is not implemented");
  }
View Full Code Here

    IXMappingResolver xMappingResolver = xMappingResolverFactory.getMappingResolver(implType);
    if (xMappingResolver == null)
    {
      // TODO display message to user
      // TODO check if implementation is supported
      throw new ConversionException("Unkown implementation type : " + implType
        + ". Use one of these : " + xMappingResolverFactory.getRegisterTypes());
    }
    return xMappingResolver;
  }
View Full Code Here

        }
    return wrap;
  }

    private ConversionException createConversionException(Throwable e) {
        final ConversionException conversionException = new ConversionException(e);
        StackTraceElement[] ste = e.getStackTrace();
        if (ste!=null){
            for(int i=0; i<ste.length; i++){
                StackTraceElement top=ste[i];
                String className=top.getClassName();
                if (className.startsWith("org.apache.jmeter.")){
                    conversionException.add("first-jmeter-class", top.toString());
                    break;
                }
            }
        }
        return conversionException;
View Full Code Here

      if (propertyExistsInClass) {
        Class<?> type = determineType(reader, result, propertyName);
        Object value = context.convertAnother(result, type);
        beanProvider.writeProperty(result, propertyName, value);
      } else if (mapper.shouldSerializeMember(result.getClass(), propertyName)) {
        throw new ConversionException("Property '" + propertyName
            + "' not defined in class " + result.getClass().getName());
      }

      reader.moveUp();
    }
View Full Code Here

    public Object fromString(String str) {
        try {
            return ctor.newInstance(new Object[] {str});
        } catch (InstantiationException e) {
            throw new ConversionException("Unable to instantiate single String param constructor", e);
        } catch (IllegalAccessException e) {
            throw new ConversionException("Unable to access single String param constructor", e);
        } catch (InvocationTargetException e) {
            throw new ConversionException("Unable to target single String param constructor", e.getTargetException());
        }
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.converters.ConversionException

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.