Package org.springframework.beans

Examples of org.springframework.beans.TypeMismatchException


            }
            try {
                hkp = (HasKeyedProperties) bean;
            } catch (ClassCastException cce) {
                // targetted bean has no overridable properties
                throw new TypeMismatchException(bean,HasKeyedProperties.class,cce);
            }
            // install knowledge of this path
            hkp.getKeyedProperties().addExternalPath(beanPath);
            // verify type-compatibility
            BeanWrapperImpl wrapper = new BeanWrapperImpl(hkp);
            Class<?> requiredType = wrapper.getPropertyType(terminalProp);
            try {
                // convert for destination type
                map.put(fullpath, wrapper.convertForProperty(value,terminalProp));
            } catch(TypeMismatchException tme) {
                TypeMismatchException tme2 =
                    new TypeMismatchException(
                            new PropertyChangeEvent(
                                    hkp,
                                    fullpath,
                                    wrapper.getPropertyValue(terminalProp),
                                    value), requiredType, tme);
View Full Code Here


  protected Object readFromSource(Class<?> clazz, HttpHeaders headers, Source source) throws IOException {
    Assert.notNull(this.unmarshaller, "Property 'unmarshaller' is required");
    try {
      Object result = this.unmarshaller.unmarshal(source);
      if (!clazz.isInstance(result)) {
        throw new TypeMismatchException(result, clazz);
      }
      return result;
    }
    catch (UnmarshallingFailureException ex) {
      throw new HttpMessageNotReadableException("Could not read [" + clazz + "]", ex);
View Full Code Here

TOP

Related Classes of org.springframework.beans.TypeMismatchException

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.