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

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


  public static QueryContext createQueryContext(final Entity entity, final Map<String, Object> options) {
    Assert.notNull(entity, "entity");

    try {
      Class<?> clazz = entity.getClass();
      BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(clazz).getBeanDescriptor();
      String entityName = QueryContextHelper.getEntityName(beanDescriptor);
      QueryContext context = new QueryContext(entityName, entityName, QueryContextHelper.ROOT_ALIAS, null);
      Queue<Entity> parsed = new LinkedList<Entity>();

      parsed.add(entity);
View Full Code Here


    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

      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

  public Collection<String> getErrors(final String baseName) {
    Assert.notEmpty(baseName, "baseName");
    Collection<String> collection = new ArrayList<String>();
    ClassFinder classFinder = new ClassFinderImpl(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

    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

    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

  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

    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

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.