Package br.net.woodstock.rockframework.reflection.impl

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


    parsed.add(value);

    if (QueryContextHelper.hasNotNullAttribute(value)) {
      Class<?> clazz = value.getClass();
      QueryContext child = new QueryContext(realName, name, alias, context);
      BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(clazz).getBeanDescriptor();
      child.setJoinNeeded(true);
      for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
        if (!propertyDescriptor.isReadable()) {
          continue;
        }
View Full Code Here


            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

  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

  public Collection<ValidationResult> validate(final Object entity) {
    if (entity == null) {
      throw new ValidationException(this.getMessage(AbstractEntityValidator.MESSAGE_INVALID_OBJECT));
    }

    BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(entity.getClass()).getBeanDescriptor();
    Collection<ValidationResult> collection = new ArrayList<ValidationResult>();
    for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
      ValidationResult result = null;
      boolean checkIdOnly = false;
      boolean checkColumn = false;
View Full Code Here

    String name = propertyDescriptor.getName();
    return new ValidationResult(false, name, DomainMessage.getInstance().getMessage(AbstractEntityValidator.MESSAGE_VALIDATION_OK));
  }

  private Object getId(final Object o) {
    BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(o.getClass()).getBeanDescriptor();
    for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
      if (propertyDescriptor.isAnnotationPresent(Id.class)) {
        return propertyDescriptor.getValue(o);
      }
    }
View Full Code Here

  public Collection<String> getErrors() {
    Collection<String> collection = new ArrayList<String>();
    ClassFinder classFinder = new ClassFinderImpl(this.baseName, new AssignableClassFilter(Entity.class));
    for (Class<?> clazz : classFinder.getClasses()) {
      BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(clazz).getBeanDescriptor();
      for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
        if (propertyDescriptor.isAnnotationPresent(ManyToMany.class)) {
          ManyToMany manyToMany = propertyDescriptor.getAnnotation(ManyToMany.class);
          CascadeType[] cascades = manyToMany.cascade();
          FetchType fetchType = manyToMany.fetch();
View Full Code Here

      XmlElement entity = entityMappings.addElement("entity");
      entity.setAttribute("class", clazz.getCanonicalName());
      entity.setAttribute("access", "PROPERTY");
      entity.setAttribute("metadata-complete", "true");

      BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(clazz).getBeanDescriptor();
      Entity e = beanDescriptor.getAnnotation(Entity.class);
      if (ConditionUtils.isNotEmpty(e.name())) {
        entity.setAttribute("name", e.name());
      }
View Full Code Here

  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

      }
    }
  }

  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

    }
    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

TOP

Related Classes of br.net.woodstock.rockframework.reflection.impl.BeanDescriptorBuilder

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.