Package java.beans

Examples of java.beans.PropertyDescriptor


    pd.setDisplayName(name);
    return pd;
  }
 
  protected PropertyDescriptor describeAttribute(String xmlName, String javaName, Class bean) throws IntrospectionException {
    PropertyDescriptor pd;
    pd = new PropertyDescriptor(javaName, bean);
    pd.setDisplayName(xmlName);
    return pd;
  }
View Full Code Here


    return pd;
  }


  protected PropertyDescriptor describeElement(String name, Class bean) throws IntrospectionException {
    PropertyDescriptor pd;
    pd = new PropertyDescriptor(name, bean);
    pd.setDisplayName(XMLBean.concatName(schema.XSD_URI, name));
    return pd;
  }
View Full Code Here

    pd.setDisplayName(XMLBean.concatName(schema.XSD_URI, name));
    return pd;
  }

  protected PropertyDescriptor describeElementReserved(String name, Class bean) throws IntrospectionException {
    PropertyDescriptor pd;
    pd = new PropertyDescriptor("_"+name, bean);
    pd.setDisplayName(XMLBean.concatName(schema.XSD_URI, name));
    return pd;
  }
View Full Code Here

    super();
    this.bean = form;
  }

  public String _getInput(String name) {
    PropertyDescriptor descr =
      PropertyUtils.getPropertyDescriptor(bean.getClass(), name);
    if (descr != null) {
      return _getInput(descr);
    } else {
      return null;
View Full Code Here

      return null;
    }
  }

  public String[] _getInputs(String name) {
    PropertyDescriptor descr =
      PropertyUtils.getPropertyDescriptor(bean.getClass(), name);
    if (descr != null) {
      return _getInputs(descr);
    } else {
      return null;
View Full Code Here

      return null;
    }
  }

  public void _setInput(String name, String value) {
    PropertyDescriptor descr =
      PropertyUtils.getPropertyDescriptor(bean.getClass(), name);
    if (descr != null) {
      _setInput(descr, value);
    }
  }
View Full Code Here

      _setInput(descr, value);
    }
  }

  public void _setInputs(String name, String[] values) {
    PropertyDescriptor descr =
      PropertyUtils.getPropertyDescriptor(bean.getClass(), name);
    if (descr != null) {
      _setInputs(descr, values);
    }
  }
View Full Code Here

                                  Map<String, PropertyDescriptor> descriptors, List<String> params)
   {
      List<Object> values = new ArrayList<Object>();
      for (String param : params)
      {
         PropertyDescriptor propertyDescriptor = descriptors.get(param);
         if (propertyDescriptor == null)
         {
            throw new RuntimeException(
                    "URITemplateAnnotationResolver could not find a getter for param "
                            + param);
         }

         Method readMethod = propertyDescriptor.getReadMethod();
         if (!Modifier.isPublic(readMethod.getDeclaringClass().getModifiers()))
         {
            readMethod.setAccessible(true);
         }
View Full Code Here

  /**
   * Get specified property value
   */
  public static Object getProperty(Object bean, String property) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
    PropertyDescriptor descriptor = getPropertyDescriptor(bean.getClass(), property);
    if (descriptor == null)
      throw new NoSuchMethodException("Cannot find property " + bean.getClass().getName() + "." + property);
    Method method = descriptor.getReadMethod();
    if (method == null)
      throw new NoSuchMethodException("Cannot find getter for " + bean.getClass().getName() + "." + property);
    return method.invoke(bean, null);
  }
View Full Code Here

  /**
   * Set specified property value
   */
  public static void setProperty(Object bean, String property, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
    PropertyDescriptor descriptor = getPropertyDescriptor(bean.getClass(), property);
    if (descriptor == null)
      throw new NoSuchMethodException("Cannot find property " + bean.getClass().getName() + "." + property);
    Method method = descriptor.getWriteMethod();
    if (method == null)
      throw new NoSuchMethodException("Cannot find setter for " + bean.getClass().getName() + "." + property);
    method.invoke(bean, new Object[]{ value });
  }
View Full Code Here

TOP

Related Classes of java.beans.PropertyDescriptor

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.