Examples of BeanDescriptor


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

    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 {
          Constructor<?> contructor = clazz.getConstructor(new Class[] { String.class });
          Object fieldValue = contructor.newInstance(new Object[] { value });
View Full Code Here

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

  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;
            if (EntityUtils.isNotEmptyId(entity)) {
View Full Code Here

Examples of com.avaje.ebeaninternal.server.deploy.BeanDescriptor

    if (id == null) {
      throw new NullPointerException("The id is null");
    }

    BeanDescriptor desc = getBeanDescriptor(type);
    // convert the id type if necessary
    id = desc.convertId(id);

    Object ref = null;
    PersistenceContext ctx = null;

    SpiTransaction t = transactionScopeManager.get();
    if (t != null) {
      // first try the persistence context
      ctx = t.getPersistenceContext();
      ref = ctx.get(type, id);
    }

    if (ref == null) {
      InheritInfo inheritInfo = desc.getInheritInfo();
      if (inheritInfo != null) {
        // we actually need to do a query because
        // we don't know the type without the
        // discriminator value
        BeanProperty idProp = desc.getIdProperty();
        if (idProp == null) {
          throw new PersistenceException("No ID properties for this type? " + desc);         
        }
       
        // just select the id properties and
        // the discriminator column (auto added)
        Query<T> query = createQuery(type);
        query.select(idProp.getName()).setId(id);

        ref = query.findUnique();

      } else {
        // use the default reference options
        ref = desc.createReference(null, id);
      }

      if (ctx != null && (ref instanceof EntityBean)) {
        // Not putting a vanilla reference in the persistence context
        ctx.put(id, ref);
View Full Code Here

Examples of com.totsp.gwittir.client.beans.BeanDescriptor

            eq = false;
        } else {
            eq = true;

            try {
                BeanDescriptor bd = Introspector.INSTANCE.getDescriptor(bean);
                Property[] properties = bd.getProperties();
                if (properties != null) {
                    for (int i = 0; eq && (i < properties.length); i++) {

                        Method pReadMethod = properties[i].getAccessorMethod();
View Full Code Here

Examples of java.beans.BeanDescriptor

          if(descriptor != null){
            this.add("\"title\":\""+descriptor.getDisplayName()+"\"," +
                "\"description\":\""+descriptor.getShortDescription()+"\","+
                "\"readonly\":"+(descriptor.getWriteMethod() == null)+",");
          }else if(!isJSONPrimitive(clazz)){
        BeanDescriptor beanDescriptor = getBeanDescriptor(clazz);
        if(beanDescriptor != null)
              this.add("\"title\":\""+beanDescriptor.getDisplayName()+"\"," +
                  "\"description\":\""+beanDescriptor.getShortDescription()+"\",");
          }
         
          if(object instanceof String ||
                object instanceof Character ||
                object instanceof Locale ||
View Full Code Here

Examples of java.beans.BeanDescriptor

    * @param clazz
    * @return
    */
  protected static BeanDescriptor getBeanDescriptor(Class<?> clazz){
    try{
      BeanDescriptor beanDescriptor = ((clazz.isAnnotationPresent(JSONObject.class) &&
            clazz.getAnnotation(JSONObject.class).ignoreHierarchy())
            ? Introspector.getBeanInfo(clazz)
                : Introspector.getBeanInfo(clazz,clazz.isEnum() ? Enum.class : clazz.equals(Object.class)? null : Object.class)).getBeanDescriptor();
      populateFeatureDescriptor(clazz, beanDescriptor);
       return beanDescriptor;
View Full Code Here

Examples of java.beans.BeanDescriptor

  public DBBeanInfo() {
  }

  public BeanDescriptor getBeanDescriptor() {
    return new BeanDescriptor(beanClass);
  }
View Full Code Here

Examples of java.beans.BeanDescriptor

  public DBBindBeanInfo() {
  }

  public BeanDescriptor getBeanDescriptor() {
    return new BeanDescriptor(beanClass);
  }
View Full Code Here

Examples of java.beans.BeanDescriptor

  public CategoriesBeanInfo() {
  }

  public BeanDescriptor getBeanDescriptor() {
    return new BeanDescriptor(beanClass);
  }
View Full Code Here

Examples of java.beans.BeanDescriptor

  public DBLanguagesBeanInfo() {
  }

  public BeanDescriptor getBeanDescriptor() {
    return new BeanDescriptor(beanClass);
  }
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.