Examples of BeanDescriptorBuilder


Examples of br.net.woodstock.rockframework.core.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.core.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

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

  public void cleanEntity(final AbstractPreDatabaseOperationEvent event) {
    Object src = event.getEntity();
    EventSource eventSource = event.getSession();
    if (src instanceof Entity) {
      try {
        BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(src.getClass()).getBeanDescriptor();
        for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
          Class propertyType = propertyDescriptor.getType();
          Object propertyValue = propertyDescriptor.getValue(src);
          if (Entity.class.isAssignableFrom(propertyType)) {
            Entity entity = (Entity) propertyValue;
View Full Code Here

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

  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

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

  public void cleanEntity(final AbstractPreDatabaseOperationEvent event) {
    Object src = event.getEntity();
    EventSource eventSource = event.getSession();
    if (src instanceof Entity) {
      try {
        BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(src.getClass()).getBeanDescriptor();
        for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
          Class propertyType = propertyDescriptor.getType();
          Object propertyValue = propertyDescriptor.getValue(src);
          if (Entity.class.isAssignableFrom(propertyType)) {
            Entity entity = (Entity) propertyValue;
View Full Code Here

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

  @SuppressWarnings("rawtypes")
  public void refreshEntity(final Object src, final EventSource eventSource) {
    if (src instanceof Entity) {
      try {
        BeanDescriptor beanDescriptor = new BeanDescriptorBuilder(src.getClass()).getBeanDescriptor();
        for (PropertyDescriptor propertyDescriptor : beanDescriptor.getProperties()) {
          Class propertyType = propertyDescriptor.getType();
          Object propertyValue = propertyDescriptor.getValue(src);
          if (Entity.class.isAssignableFrom(propertyType)) {
            Entity entity = (Entity) propertyValue;
View Full Code Here

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

  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

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

    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

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

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
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.