Package br.net.woodstock.rockframework.reflection

Examples of br.net.woodstock.rockframework.reflection.BeanDescriptor


  private ObjectUtils() {
    //
  }

  public static void copyAttributes(final Object from, final Object to, final Class<?>[] ignoredTypes) {
    BeanDescriptor beanDescriptorFrom = new BeanDescriptorBuilder(from.getClass()).getBeanDescriptor();
    BeanDescriptor beanDescriptorTo = new BeanDescriptorBuilder(to.getClass()).getBeanDescriptor();

    outer: for (PropertyDescriptor propertyDescriptor : beanDescriptorFrom.getProperties()) {
      if (beanDescriptorTo.hasProperty(propertyDescriptor.getName())) {
        PropertyDescriptor propertyDescriptorTo = beanDescriptorTo.getProperty(propertyDescriptor.getName());
        if (ignoredTypes != null) {
          for (Class<?> c : ignoredTypes) {
            if ((c.isAssignableFrom(propertyDescriptor.getType())) || (c.isAssignableFrom(propertyDescriptorTo.getType()))) {
              continue outer;
            }
View Full Code Here


      }
    }
  }

  public static void copyAttributes(final Object from, final Object to, final String[] ignoredAttributes) {
    BeanDescriptor beanDescriptorFrom = new BeanDescriptorBuilder(from.getClass()).getBeanDescriptor();
    BeanDescriptor beanDescriptorTo = new BeanDescriptorBuilder(to.getClass()).getBeanDescriptor();

    outer: for (PropertyDescriptor propertyDescriptor : beanDescriptorFrom.getProperties()) {
      if (beanDescriptorTo.hasProperty(propertyDescriptor.getName())) {
        PropertyDescriptor propertyDescriptorTo = beanDescriptorTo.getProperty(propertyDescriptor.getName());
        if (ignoredAttributes != null) {
          for (String s : ignoredAttributes) {
            if (s.equals(propertyDescriptor.getName())) {
              continue outer;
            }
View Full Code Here

    }
    if (!o1.getClass().isAssignableFrom(o2.getClass())) {
      return false;
    }

    BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(o1.getClass()).getBeanDescriptor();
    Collection<PropertyDescriptor> properties = beanDescriptor.getProperties();

    for (PropertyDescriptor property : properties) {
      Object v1 = property.getValue(o1);
      Object v2 = property.getValue(o2);
View Full Code Here

    return true;
  }

  public static int hashCode(final Object obj) {
    int result = 1;
    BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(obj.getClass()).getBeanDescriptor();
    Collection<PropertyDescriptor> properties = beanDescriptor.getProperties();

    for (PropertyDescriptor property : properties) {
      Object value = property.getValue(obj);

      if (value != null) {
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.reflection.BeanDescriptor

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.