Examples of BeanDescriptorBuilder


Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

            continue;
          }
          parsed.add((Entity) o);

          Class<?> clazz = o.getClass();
          BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(clazz).getBeanDescriptor();
          for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
            if (!propertyDescriptor.isReadable()) {
              continue;
            }
            String childName = propertyDescriptor.getName();
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

  private static boolean hasNotNullAttribute(final Entity e) {
    if (e == null) {
      return false;
    }

    BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(e.getClass()).getBeanDescriptor();
    for (PropertyDescriptor property : beanDescriptor.getProperties()) {
      if (!property.isReadable()) {
        continue;
      }
      Object tmp = property.getValue(e);
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

  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) {
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

      }
    }
  }

  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) {
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

    }
    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

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

    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);
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

      }
    } else if (id2 != null) {
      return false;
    }

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

    for (PropertyDescriptor property : properties) {
      if (!property.isReadable()) {
        continue;
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

      return id.hashCode();
    }

    int result = 1;

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

    for (PropertyDescriptor property : properties) {
      if (!property.isReadable()) {
        continue;
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

    try {
      Object obj = Ognl.getValue(entityName, action);
      if ((obj != null) && (obj instanceof Entity)) {
        Entity<?> entity = (Entity<?>) obj;

        BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(entity.getClass()).getBeanDescriptor();

        PropertyDescriptor propertyDescriptor = beanDescriptor.getProperty(EntityInterceptor.ENTITY_ID);
        Class<?> clazz = propertyDescriptor.getType();

        try {
View Full Code Here

Examples of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

    if (tag.dynamicAttributes()) {
      root.addElement("dynamic-attributes").setData(Boolean.valueOf(tag.dynamicAttributes()));
    }

    BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(clazz).getBeanDescriptor();

    for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
      if (!propertyDescriptor.isAnnotationPresent(Attribute.class)) {
        continue;
      }
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.