Examples of ConversionException


Examples of br.com.caelum.iogi.exceptions.ConversionException

      return instantiateFromName(enumClass, stringValue, to);
  }

  private void ensureTargetIsAnEnum(final Target<?> to) {
    if (!Enum.class.isAssignableFrom(to.getClassType()))
      throw new ConversionException("Target %s does not represent a Java enum.", to);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.converter.ConversionException

    }
   
    try {
      return getFormatter().parseLocalDate(value);
    } catch (UnsupportedOperationException | IllegalArgumentException  e) {
      throw new ConversionException(new ConversionMessage("is_not_a_valid_date", value));
    }
  }
View Full Code Here

Examples of com.basho.riak.client.api.convert.ConversionException

            {
                return mapper.readValue(flat.toString(), mapper.getTypeFactory().constructCollectionType(Collection.class, resultType));
            }
            catch (IOException ex)
            {
                throw new ConversionException("Could not convert Mapreduce response",ex);
            }
        }
View Full Code Here

Examples of com.basho.riak.client.convert.ConversionException

            public <T> Collection<T> getResult(Class<T> resultType) throws ConversionException {
                try {
                    return OBJECT_MAPPER.readValue(getResultRaw(), TypeFactory.collectionType(Collection.class, resultType));
                } catch (IOException e) {
                    throw new ConversionException(e);
                }
            }
        };
        return result;
    }
View Full Code Here

Examples of com.cloudhopper.commons.xbean.ConversionException

        }
    }
   
    static public String normalizeLeadingHexZeroes(String v, int length) throws ConversionException {
        if (v == null || v.length() == 0) {
            throw new ConversionException("Empty or null value detected; unable to convert");
        } else if (v.length() == length) {
            return v;
        } else if (v.length() < length) {
            // add leading zeroes
            int prepend = (length - v.length());
View Full Code Here

Examples of com.github.diamond.client.ConversionException

        else if (InetAddress.class.isAssignableFrom(cls))
        {
            return toInetAddress(value);
        }

        throw new ConversionException("The value '" + value + "' (" + value.getClass() + ")"
                + " can't be converted to a " + cls.getName() + " object");
    }
View Full Code Here

Examples of com.googlecode.mjorm.convert.ConversionException

    } else if (String.class.isInstance(source)) {
      return Boolean.valueOf(String.class.cast(source));
    }

    throw new ConversionException("Unable to convert source to boolean");
  }
View Full Code Here

Examples of com.persistit.exception.ConversionException

    private final ObjectStreamClass _classDescriptor;

    public SerialValueCoder(final Class<?> clazz) {
        _classDescriptor = ObjectStreamClass.lookup(clazz);
        if (_classDescriptor == null) {
            throw new ConversionException("Not Serializable: " + clazz.getName());
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.converters.ConversionException

        }
        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

Examples of com.thoughtworks.xstream.converters.ConversionException

        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = null;
        try {
            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new ConversionException("Cannot instantiate " + Document.class.getName(), e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        copy(reader, writer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.