Package java.beans

Examples of java.beans.BeanInfo


    private void locateManagedPropertyDescriptors(Class<?> clazz, IntrospectionData introspectionData,
        Map<String, ResourceParameter> injectableFields) {

        try {
            BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
            if (beanInfo != null) {
                PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
                if (descriptors != null) {
                    for (PropertyDescriptor descriptor : descriptors) {
                        String propertyName = descriptor.getName();

                        ResourceParameter dependency = injectableFields.get(propertyName);
View Full Code Here


            for (Class<?> cls : beanClass.getInterfaces()) {
                propertyDescriptors.addAll(getBeanPropertyDescriptor(cls));
            }

            BeanInfo info = Introspector.getBeanInfo(beanClass);
            propertyDescriptors.addAll(getPropertyDescriptors(info));

            return propertyDescriptors;
        } else {
            BeanInfo info = Introspector.getBeanInfo(beanClass);
            return getPropertyDescriptors(info);
        }
    }
View Full Code Here

   * @return the global info (synopsis) for the classifier
   * @throws Exception if there is a problem reflecting on the forecaster
   */
  protected static String getGlobalInfo(TSForecaster forecaster)
      throws Exception {
    BeanInfo bi = Introspector.getBeanInfo(forecaster.getClass());
    MethodDescriptor[] methods;
    methods = bi.getMethodDescriptors();
    Object[] args = {};
    String result = "\nSynopsis for " + forecaster.getClass().getName()
        + ":\n\n";

    for (int i = 0; i < methods.length; i++) {
View Full Code Here

            this.setFormat(format);
        }
       
        public PropertyColumn(String name, String header, int width, int alignment, Format format) {
            super(name, header, width, alignment, format);
            BeanInfo beanInfo = null;
           
            Class aClass = clazz;
           
            outer:
                while (getter == null && aClass != null) {
View Full Code Here

                    throw new IllegalStateException("getter for " + name + " not found in class " + clazz.getName());
                }
        }
       
        private Method getGetter(String name, Class aClass) {
            BeanInfo beanInfo = null;
            try {
                beanInfo = Introspector.getBeanInfo(aClass);
            catch (IntrospectionException ex) {
                IllegalStateException ex1 = new IllegalStateException("Can not introspec class " + clazz.getName());
                ex1.initCause(ex);
                throw ex1;
            }
            PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
            for (int i = 0; i < props.length; i++) {
                if (props[i].getName().equalsIgnoreCase(name)) {
                    getter = props[i].getReadMethod();
                    if (getter == null) {
                        throw new IllegalStateException("property " + name + " has not read method");
View Full Code Here

      }
     
      params.put("shortname", javaClassName);
     
      try {
         BeanInfo beanInfo = java.beans.Introspector.getBeanInfo(clazz);

         params.put("beanInfo", beanInfo);

         File f = super.getFileForClass(javaClassName);
View Full Code Here

                int index = javaClassName.lastIndexOf(".");
                if (index >= 0) {
                    javaClassName = javaClassName.substring(index + 1);
                }
                params.put("shortname", javaClassName);
                BeanInfo beanInfo = java.beans.Introspector.getBeanInfo(clazz);
                params.put("beanInfo", beanInfo);
                logger.fine("writer class " + clazz.getName());
                template.print(printer, params);
                printer.flush();
            }
View Full Code Here

   */
  public static String getGlobalInfo(Object tempBean) {
    // set tool tip text from global info if supplied
    String gi = null;
    try {
      BeanInfo bi = Introspector.getBeanInfo(tempBean.getClass());
      MethodDescriptor [] methods = bi.getMethodDescriptors();
      for (int i = 0; i < methods.length; i++) {
        String name = methods[i].getDisplayName();
        Method meth = methods[i].getMethod();
        if (name.equals("globalInfo")) {
          if (meth.getReturnType().equals(String.class)) {
View Full Code Here

    this.propertyNames = newArrayList(propertyNames);
    populate();
  }

  private void populate() {
    BeanInfo beanInfo = null;
    try {
      beanInfo = Introspector.getBeanInfo(targetType, Object.class);
    } catch (Exception e) {
      throw actionFailure(concat("Unable to get BeanInfo for type ", targetType.getName()), e);
    }
    for (PropertyDescriptor d : beanInfo.getPropertyDescriptors()) {
      register(checkNotNull(d));
    }
  }
View Full Code Here

     * @throws SQLException if introspection failed.
     */
    private PropertyDescriptor[] propertyDescriptors(Class<?> c)
        throws SQLException {
        // Introspector caches BeanInfo classes for better performance
        BeanInfo beanInfo = null;
        try {
            beanInfo = Introspector.getBeanInfo(c);

        } catch (IntrospectionException e) {
            throw new SQLException(
                "Bean introspection failed: " + e.getMessage());
        }

        return beanInfo.getPropertyDescriptors();
    }
View Full Code Here

TOP

Related Classes of java.beans.BeanInfo

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.