Package com.thoughtworks.xstream.converters.reflection

Examples of com.thoughtworks.xstream.converters.reflection.ObjectAccessException


        if (nameMap == null) {
            BeanInfo beanInfo;
            try {
                beanInfo = Introspector.getBeanInfo(type, Object.class);
            } catch (IntrospectionException e) {
                throw new ObjectAccessException("Cannot get BeanInfo of type " + type.getName(), e);
            }
            nameMap = new OrderRetainingMap();
            propertyNameCache.put(type, nameMap);
            PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
            for (int i = 0; i < propertyDescriptors.length; i++) {
View Full Code Here


        if (visitor.shouldVisit(name, definedIn)) {
          Object value = readMethod.invoke(object);
          visitor.visit(name, property.getPropertyType(), definedIn, value);
        }
      } catch (IllegalArgumentException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + '.' + property.getName(), e);
      } catch (IllegalAccessException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + '.' + property.getName(), e);
      } catch (InvocationTargetException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + '.' + property.getName(), e);
      }
    }
  }
View Full Code Here

  public void writeProperty(Object object, String propertyName, Object value) {
    PropertyDescriptor property = getProperty(propertyName, object.getClass());
    try {
      property.getWriteMethod().invoke(object, value);
    } catch (IllegalArgumentException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + '.' + property.getName(), e);
    } catch (IllegalAccessException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + '.' + property.getName(), e);
    } catch (InvocationTargetException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + '.' + property.getName(), e);
    }
  }
View Full Code Here

   */
  public BeanProperty property(Class<?> cls, String name) {
    Map<String, BeanProperty> properties = buildMap(cls);
    BeanProperty property = (BeanProperty) properties.get(name);
    if (property == null) {
      throw new ObjectAccessException("No such property " + cls.getName() + "."
          + name);
    } else {
      return property;
    }
  }
View Full Code Here

        if (visitor.shouldVisit(name, definedIn)) {
          Object value = readMethod.invoke(object, new Object[0]);
          visitor.visit(name, property.getPropertyType(), definedIn, value);
        }
      } catch (IllegalArgumentException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + "." + property.getName(), e);
      } catch (IllegalAccessException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + "." + property.getName(), e);
      } catch (InvocationTargetException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + "." + property.getName(), e);
      }
    }
  }
View Full Code Here

  public void writeProperty(Object object, String propertyName, Object value) {
    PropertyDescriptor property = getProperty(propertyName, object.getClass());
    try {
      property.getWriteMethod().invoke(object, new Object[] { value });
    } catch (IllegalArgumentException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + "." + property.getName(), e);
    } catch (IllegalAccessException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + "." + property.getName(), e);
    } catch (InvocationTargetException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + "." + property.getName(), e);
    }
  }
View Full Code Here

    if (nameMap == null) {
      BeanInfo beanInfo;
      try {
        beanInfo = Introspector.getBeanInfo(type, Object.class);
      } catch (IntrospectionException e) {
        throw new ObjectAccessException("Cannot get BeanInfo of type "
            + type.getName(), e);
      }
      nameMap = new OrderRetainingMap();
      propertyNameCache.put(type, nameMap);
      PropertyDescriptor[] propertyDescriptors = beanInfo
View Full Code Here

        if (visitor.shouldVisit(name, definedIn)) {
          Object value = readMethod.invoke(object);
          visitor.visit(name, property.getPropertyType(), definedIn, value);
        }
      } catch (IllegalArgumentException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + '.' + property.getName(), e);
      } catch (IllegalAccessException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + '.' + property.getName(), e);
      } catch (InvocationTargetException e) {
        throw new ObjectAccessException("Could not get property "
            + object.getClass() + '.' + property.getName(), e);
      }
    }
  }
View Full Code Here

  public void writeProperty(Object object, String propertyName, Object value) {
    PropertyDescriptor property = getProperty(propertyName, object.getClass());
    try {
      property.getWriteMethod().invoke(object, value);
    } catch (IllegalArgumentException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + '.' + property.getName(), e);
    } catch (IllegalAccessException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + '.' + property.getName(), e);
    } catch (InvocationTargetException e) {
      throw new ObjectAccessException("Could not set property "
          + object.getClass() + '.' + property.getName(), e);
    }
  }
View Full Code Here

    BeanInfo beanInfo;
    try {
      beanInfo = Introspector.getBeanInfo(type, Object.class);
    } catch (IntrospectionException e) {
      throw new ObjectAccessException("Cannot get BeanInfo of type "
          + type.getName(), e);
    }

    for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) {
        nameMapBuilder.put(descriptor.getName(), descriptor);
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.converters.reflection.ObjectAccessException

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.