API java : java.beans


Package java.beans

Contains classes related to developing beans -- components based on the JavaBeansTM architecture.

See:
          Description

Interface Summary
AppletInitializer This interface is designed to work in collusion with java.beans.Beans.instantiate.
BeanInfo A bean implementor who wishes to provide explicit information about their bean may provide a BeanInfo class that implements this BeanInfo interface and provides explicit information about the methods, properties, events, etc, of their bean.
Customizer A customizer class provides a complete custom GUI for customizing a target Java Bean.
DesignMode This interface is intended to be implemented by, or delegated from, instances of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
ExceptionListener An ExceptionListener is notified of internal exceptions.
PropertyChangeListener A "PropertyChange" event gets fired whenever a bean changes a "bound" property.
PropertyEditor A PropertyEditor class provides support for GUIs that want to allow users to edit a property value of a given type.
VetoableChangeListener A VetoableChange event gets fired whenever a bean changes a "constrained" property.
Visibility Under some circumstances a bean may be run on servers where a GUI is not available.
 

Class Summary
BeanDescriptor A BeanDescriptor provides global information about a "bean", including its Java class, its displayName, etc.
Beans This class provides some general purpose beans control methods.
DefaultPersistenceDelegate The DefaultPersistenceDelegate is a concrete implementation of the abstract PersistenceDelegate class and is the delegate used by default for classes about which no information is available.
Encoder An Encoder is a class which can be used to create files or streams that encode the state of a collection of JavaBeans in terms of their public APIs.
EventHandler The EventHandler class provides support for dynamically generating event listeners whose methods execute a simple statement involving an incoming event object and a target object.
EventSetDescriptor An EventSetDescriptor describes a group of events that a given Java bean fires.
Expression An Expression object represents a primitive expression in which a single method is applied to a target and a set of arguments to return a result - as in "a.getFoo()".
FeatureDescriptor The FeatureDescriptor class is the common baseclass for PropertyDescriptor, EventSetDescriptor, and MethodDescriptor, etc.
IndexedPropertyChangeEvent An "IndexedPropertyChange" event gets delivered whenever a component that conforms to the JavaBeans specification (a "bean") changes a bound indexed property.
IndexedPropertyDescriptor An IndexedPropertyDescriptor describes a property that acts like an array and has an indexed read and/or indexed write method to access specific elements of the array.
Introspector The Introspector class provides a standard way for tools to learn about the properties, events, and methods supported by a target Java Bean.
MethodDescriptor A MethodDescriptor describes a particular method that a Java Bean supports for external access from other components.
ParameterDescriptor The ParameterDescriptor class allows bean implementors to provide additional information on each of their parameters, beyond the low level type information provided by the java.lang.reflect.Method class.
PersistenceDelegate The PersistenceDelegate class takes the responsibility for expressing the state of an instance of a given class in terms of the methods in the class's public API.
PropertyChangeEvent A "PropertyChange" event gets delivered whenever a bean changes a "bound" or "constrained" property.
PropertyChangeListenerProxy A class which extends the EventListenerProxy specifically for adding a named PropertyChangeListener.
PropertyChangeSupport This is a utility class that can be used by beans that support bound properties.
PropertyDescriptor A PropertyDescriptor describes one property that a Java Bean exports via a pair of accessor methods.
PropertyEditorManager The PropertyEditorManager can be used to locate a property editor for any given type name.
PropertyEditorSupport This is a support class to help build property editors.
SimpleBeanInfo This is a support class to make it easier for people to provide BeanInfo classes.
Statement A Statement object represents a primitive statement in which a single method is applied to a target and a set of arguments - as in "a.setFoo(b)".
VetoableChangeListenerProxy A class which extends the EventListenerProxy specifically for associating a VetoableChangeListener with a "constrained" property.
VetoableChangeSupport This is a utility class that can be used by beans that support constrained properties.
XMLDecoder The XMLDecoder class is used to read XML documents created using the XMLEncoder and is used just like the ObjectInputStream.
XMLEncoder The XMLEncoder class is a complementary alternative to the ObjectOutputStream and can used to generate a textual representation of a JavaBean in the same way that the ObjectOutputStream can be used to create binary representation of Serializable objects.
 

Exception Summary
IntrospectionException Thrown when an exception happens during Introspection.
PropertyVetoException A PropertyVetoException is thrown when a proposed change to a property represents an unacceptable value.
 

Package java.beans Description

Contains classes related to developing beans -- components based on the JavaBeansTM architecture. A few of the classes are used by beans while they run in an application. For example, the event classes are used by beans that fire property and vetoable change events (see PropertyChangeEvent). However, most of the classes in this package are meant to be used by a bean editor (that is, a development environment for customizing and putting together beans to create an application). In particular, these classes help the bean editor create a user interface that the user can use to customize the bean. For example, a bean may contain a property of a special type that a bean editor may not know how to handle. By using the PropertyEditor interface, a bean developer can provide an editor for this special type.

To minimize the resources used by a bean, the classes used by bean editors are loaded only when the bean is being edited. They are not needed while the bean is running in an application and therefore not loaded. This information is kept in what's called a bean-info (see BeanInfo).

Unless explicitly stated, null values or empty Strings are not valid parameters for the methods in this package. You may expect to see exceptions if these parameters are used.

Long-Term Persistence

As of v1.4, the java.beans package provides support for long-term persistence -- reading and writing a bean as a textual representation of its property values. The property values are treated as beans, and are recursively read or written to capture their publicly available state. This approach is suitable for long-term storage because it relies only on public API, rather than the likely-to-change private implementation.

Note: The persistence scheme cannot automatically instantiate custom inner classes, such as you might use for event handlers. By using the EventHandler class instead of inner classes for custom event handlers, you can avoid this problem.

You read and write beans in XML format using the XMLDecoder and XMLEncoder classes, respectively. One notable feature of the persistence scheme is that reading in a bean requires no special knowledge of the bean.

Writing out a bean, on the other hand, sometimes requires special knowledge of the bean's type. If the bean's state can be expressed using only the no-argument constructor and public getter and setter methods for properties, no special knowledge is required. Otherwise, the bean requires a custom persistence delegate -- an object that is in charge of writing out beans of a particular type. All classes provided in the JDK that descend from java.awt.Component, as well as all their properties, automatically have persistence delegates.

If you need (or choose) to provide a persistence delegate for a bean, you can do so either by using a DefaultPersistenceDelegate instance or by creating your own subclass of PersistenceDelegate. If the only reason a bean needs a persistence delegate is because you want to invoke the bean's constructor with property values as arguments, you can create the bean's persistence delegate with the one-argument DefaultPersistenceDelegate constructor. Otherwise, you need to implement your own persistence delegate, for which you're likely to need the following classes:

PersistenceDelegate
The abstract class from which all persistence delegates descend. Your subclass should use its knowledge of the bean's type to provide whatever Statements and Expressions are necessary to create the bean and restore its state.
Statement
Represents the invocation of a single method on an object. Includes a set of arguments to the method.
Expression
A subclass of Statement used for methods that return a value.

Once you create a persistence delegate, you register it using the setPersistenceDelegate method of XMLEncoder.

Related Documentation

For overview, architecture, and tutorial documentation, please see:


Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

6 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1342
Document créé le 30/08/06 02:01, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/beans/package-summary.html Document affiché 2 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,61 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Certaines personnes portent un pyjama Superman. Superman porte un pyjama Chuck Norris.

Anonyme [Chuck Norris fact]
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 15:08, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)