Examples of ConversionException


Examples of com.thoughtworks.xstream.converters.ConversionException

    }

    public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext unmarshallingContext) {
        Class qnameClass = unmarshallingContext.getRequiredType();
        if (!canConvert(qnameClass)) {
            throw new ConversionException("Unexpected type in unmarshal: " + qnameClass.getName());
        }

        String qnameString = reader.getValue();
        try {
            Method method = qnameClass.getMethod("valueOf", new Class[]{String.class});
            Object qname = method.invoke(null, new Object[] { qnameString });
            return qname;
        } catch (Exception e) {
            throw new ConversionException("Unable to convert value to a qname: " + qnameString);
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.converters.ConversionException

        XStreamGBeanState gbeanState = (XStreamGBeanState) object;
        Element element = null;
        try {
            element = gbeanState.getGBeanState();
        } catch (IOException e) {
            throw new ConversionException("Cannot get xml version of gbeans", e);
        }
        marshallingContext.convertAnother(element);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.converters.ConversionException

            if (node instanceof Element) {
                element = (Element) node;
                return new XStreamGBeanState(element);
            }
        }
        throw new ConversionException("No nested nodes found");
    }
View Full Code Here

Examples of com.vaadin.data.util.converter.Converter.ConversionException

        Class<?> modelType = getModelType();
        try {
            return ConverterUtil.convertToModel(fieldValue,
                    (Class<Object>) modelType, getConverter(), locale);
        } catch (ConversionException e) {
            throw new ConversionException(getConversionError(modelType, e), e);
        }
    }
View Full Code Here

Examples of com.vaadin.data.util.converter.Converter.ConversionException

        if (text == null) {
            return null;
        }
        String[] parts = text.split(" ");
        if (parts.length != 2) {
            throw new ConversionException("Can not convert text to a name: "
                    + text);
        }
        return new Name(parts[0], parts[1]);
    }
View Full Code Here

Examples of de.heil_privat.commons.converter.ConversionException

     */
    public static <TC extends Collection<? super T>, S, T> TC convertedCollection(Collection<? extends S> source, Converter<? super S, ? extends T> converter, Class<TC> destinationType) {
        try {
            return addAll(source, destinationType.newInstance(), converter);
        } catch (InstantiationException | IllegalAccessException e) {
            throw new ConversionException(e);
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.exception.ConversionException

     */
    private List<?> castToObjectsList(Transferable transferable) throws ConversionException {
        try {
            return (List<?>) transferable.getTransferData(TREE_NODE_FLAVOR);
        } catch (Exception e) {
            throw new ConversionException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of gri.data.converters.ConversionException

    try {
        File file = FileUtil.copyToTempFile(tFile, this.dir);
        return file;
    }
    catch(Exception e) {
        throw new ConversionException(e);
    }
      }
  }
View Full Code Here

Examples of javax.measure.converter.ConversionException

                    // between source[i] and target[j].
                    continue;
                }
                final UnitConverter converter = sourceUnit.getConverterToAny(targetUnit);
                if (!(converter instanceof LinearConverter)) {
                    throw new ConversionException(Errors.format(
                              Errors.Keys.NonLinearUnitConversion_2, sourceUnit, targetUnit));
                }
                final double offset = converter.convert(0);
                final double scale  = Units.derivative(converter, 0);
                matrix.setElement(j, i, element*scale);
 
View Full Code Here

Examples of net.sf.joafip.store.service.conversion.ConversionException

      final FieldInfo fieldInfo = new FieldInfo(declaringClass,
          fieldName, fieldType, Boolean.valueOf(staticField),
          Boolean.valueOf(transientField));
      addNewFieldAndItsValue(fieldIndex, fieldInfo, fieldValue);
    } catch (ClassInfoException exception) {
      throw new ConversionException(exception);
    }
  }
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.