Package java.beans

Examples of java.beans.BeanInfo


                || !(object.get(2) instanceof Point)) {
            throw new IllegalArgumentException("bad drop object " + object);
        }

        Object bean = object.get(0);
        BeanInfo beanInfo = (BeanInfo) object.get(1);
        Point point = (Point) object.get(2);

        beanInfoMap.put(bean.getClass().getName(), beanInfo);

        prepareForAddition(bean, beanInfo, point);
View Full Code Here


     * returns the image contained in the BeanInfo for the bean, or
     * the default BeanPanel image if no image is found in the
     * BeanInfo.
     */
    protected Image getDragImage(Object bean) {
        BeanInfo beanInfo = this.getBeanInfoForBean(bean.getClass().getName());

        if (beanInfo == null) {
            if (Debug.debugging("beanbox"))
                Debug.output("No beanInfo found for bean: " + bean);
            return BeanPanel.defaultBeanIcon.getImage();
        }

        Image img = beanInfo.getIcon(BeanInfo.ICON_COLOR_32x32);

        if (img == null) {
            if (Debug.debugging("beanbox"))
                Debug.output("No image found in beanInfo for bean: " + bean);
            return BeanPanel.defaultBeanIcon.getImage();
View Full Code Here

    throws StoreException
  {
    ClassLoader cl = HTTPRepositoryMetaData.class.getClassLoader();
    Class<?>[] interfaces = new Class<?>[] { RepositoryMetaData.class };
    try {
      BeanInfo info = Introspector.getBeanInfo(RepositoryMetaData.class);
      PropertyDescriptor[] properties = info.getPropertyDescriptors();
      HTTPRepositoryMetaData h = new HTTPRepositoryMetaData(repository, model, properties);
      return (RepositoryMetaData)Proxy.newProxyInstance(cl, interfaces, h);
    }
    catch (IntrospectionException e) {
      throw new StoreException(e);
View Full Code Here

         installFor(e.getClass());
   }

   public static void installFor(Class<? extends Enum> enumClass) {
     try {
       BeanInfo info = Introspector.getBeanInfo( enumClass );
       info.getBeanDescriptor().setValue( "persistenceDelegate", INSTANCE );
     } catch( IntrospectionException exception ) {
       throw new RuntimeException("Unable to persist enumerated type "+enumClass, exception);
     }
   }
View Full Code Here

    return (JavaProperty[])result.toArray(new JavaProperty[0]);
  }
 
  public JavaProperty[] getProperties() throws Exception {
    List<JavaProperty> result = new ArrayList<JavaProperty>();
    BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
    PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
    for(PropertyDescriptor pd : pds) {
        if(!"class".equalsIgnoreCase(pd.getName())) {
            result.add(new JavaProperty(pd,this));
        }
    }
View Full Code Here

    final Vector<Object> columnData = new Vector<Object>();
    if (_bean != null)
    {
      try
      {
        BeanInfo info = Introspector.getBeanInfo(_bean.getClass(), Introspector.USE_ALL_BEANINFO);
        processBeanInfo(info, columnData);
      }
      catch (Exception ex)
      {
        throw new BaseException(ex);
View Full Code Here

      else
      {
        beanClass = Class.forName(beanClassName, true, _cl);
      }
      Object bean = beanClass.newInstance();
      BeanInfo info =
        Introspector.getBeanInfo(
          bean.getClass(),
          Introspector.USE_ALL_BEANINFO);
      PropertyDescriptor[] propDesc = info.getPropertyDescriptors();
      Map<String, PropertyDescriptor> props =
                new HashMap<String, PropertyDescriptor>();
      for (int i = 0; i < propDesc.length; ++i)
      {
        props.put(propDesc[i].getName(), propDesc[i]);
View Full Code Here

  private IXMLElement createElement(Object bean, String name)
    throws XMLException
  {
    IXMLElement elem = null;
    BeanInfo info = null;
    try
    {
      if (bean != null)
      {
        info = Introspector.getBeanInfo(bean.getClass(), Object.class);
      }
    }
    catch (IntrospectionException ex)
    {
      throw new XMLException(ex);
    }
    elem = new XMLElement(name != null ? name : XMLConstants.BEAN_ELEMENT_NAME);
    if (info != null)
    {
      if (bean instanceof IXMLAboutToBeWritten)
      {
        ((IXMLAboutToBeWritten) bean).aboutToBeWritten();
      }
      PropertyDescriptor[] propDesc = info.getPropertyDescriptors();
      elem = new XMLElement(name != null ? name : XMLConstants.BEAN_ELEMENT_NAME);
      elem.setAttribute(XMLConstants.CLASS_ATTRIBUTE_NAME,
                      bean.getClass().getName());
      for (int i = 0; i < propDesc.length; ++i)
      {
View Full Code Here

    commonCtor();
    if (bean != null)
    {
      try
      {
        BeanInfo info = Introspector.getBeanInfo(bean.getClass(),
                        Introspector.USE_ALL_BEANINFO);
        processBeanInfo(bean, info);
      }
      catch (Exception ex)
      {
View Full Code Here

      beans = new Object[0];
    }

    if (beans.length > 0)
    {
      BeanInfo info = null;
      try
      {
        info = Introspector.getBeanInfo(beans[0].getClass(), Introspector.USE_ALL_BEANINFO);
        validateBeans(beans);
        initialize(info);
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.