Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.beans.beancontext.* (18)

java.beans: Javadoc index of package java.beans.


Package Samples:

java.beans.beancontext: Listeners and descriptors for managing beans.  

Classes:

Introspector: Introspector is the class that does the bulk of the design-time work in Java Beans. Every class must have a BeanInfo in order for an RAD tool to use it; but, as promised, you don't have to write the BeanInfo class yourself if you don't want to. All you have to do is call getBeanInfo() in the Introspector and it will use standard JavaBeans-defined method signatures to determine the information about your class. Don't worry about it too much, though: you can provide JavaBeans with as much customized information as you want, or as little as you want, using the BeanInfo interface (see BeanInfo for ...
BeanContext: Acts as a container for sub-beans and as a sub-bean, so that an entire hierarchy of beans can be made up of BeanContext s. Since I can't sprinkle the Collections interface documentation with special information for BeanContext implementors, I'll have to document special requirements for implementors of those functions here. add() or addAll() : May add any Object into the hierarchy as well as a BeanContextChild , BeanContext or BeanContextProxy object. This way, any Bean can be in the hierarchy. Must synchronize on BeanContext.globalHierarchyLock . Don't add the Object if it's already there (only ...
PropertyEditor: PropertyEditors are custom GUI editors for specific types of values. A PropertyEditor can be used, for example, if you are editing a type of value that can be more easily represented graphically, such as a Point, or one that can be more easily represented by a list, such as a boolean (true/false). A PropertyEditor must be able to display its contents when asked to and be able to allow the user to change its underlying field value. However, it is not the PropertyEditor's responsibility to make the change to the underlying Object; in fact, the PropertyEditor does not even know about the Object it ...
XMLDecoder: The XMLDecoder reads XML data that is structured according to this DTD and creates objects according to the content. Usually such data is generated using the XMLEncoder class. An example XML document might look like this: <java> <string>Hello World</string> <int>200</int> </java> To read the String and the Integer instance the following can be used (assume the XML data can be obtained from the InputStream): XMLDecoder decoder = new XMLDecoder(inputStreamContainingXMLData); String message = (String) decoder.readObject(); Integer number = (Integer) decoder.readObject(); ...
EventSetDescriptor: EventSetDescriptor describes the hookup between an event source class and an event listener class. EventSets have several attributes: the listener class, the events that can be fired to the listener (methods in the listener class), and an add and remove listener method from the event firer's class. The methods have these constraints on them: event firing methods: must have void return value. Any parameters and exceptions are allowed. May be public, protected or package-protected. (Don't ask me why that is, I'm just following the spec. The only place it is even mentioned is in the Java Beans white ...
BeanInfo: BeanInfo can be implemented in order to provide explicit information to the Introspector. When you write a BeanInfo class, you implement this interface and provide explicit information by returning a non-null value from the appropriate method. If you wish the Introspector to determine certain information in the normal way, just return null (or in the case of int methods, return -1). There is a class called SimpleBeanInfo which returns null from all methods, which you may extend and only override the methods you wish to override. When you have written the class, give it the name <Bean Class Name>BeanInfo ...
IndexedPropertyDescriptor: IndexedPropertyDescriptor describes information about a JavaBean indexed property, by which we mean an array-like property that has been exposed via a pair of get and set methods and another pair that allows you to get to the property by an index. An example property would have four methods like this: FooBar[] getFoo() void setFoo(FooBar[]) FooBar getFoo(int) void setFoo(int,FooBar) The constraints put on get and set methods are: There must be at least a get(int) or a set(int,...) method. Nothing else is required. Spec note: One nice restriction would be that if there is a get() there must be a ...
BeanContextChild: Beans implement this to get information about the execution environment and its services and to be placed in the hierarchy. The difference between a BeanContext and a BeanContextChild , mainly, is that a BeanContext may be a parent. BeanContextChild instances will be serialized at some point in their life, but you need to make sure your bean context does not contain a serializable reference (directly or indirectly) to the parent BeanContext , to any of the other BeanContext s in the tree, or to any resources obtained via the BeanContextServices interface. One way to do this is to mark any fields ...
VetoableChangeListener: VetoableChangeListener allows a class to monitor proposed changes to properties of a Bean and, if desired, prevent them from occurring. A vetoableChange() event will be fired after the property change has been requested, but before it is permanent. If any listener rejects the change by throwing the PropertyChangeException, a new vetoableChange() event will be fired to all listeners who received a vetoableChange() event in the first place, informing them to revert back to the old value. Thus, the listener that threw the exception the first time should be prepared to rethrow it the second time. The ...
Customizer: You may explicitly provide a Customizer for your Bean class, which allows you complete control of the editing of the Bean. A Customizer is meant to be embedded in an RAD tool, and thus must be a descendant of java.awt.Component . It must also have a constructor with no arguments. This is the constructor that will be called by the RAD tool to instantiate the Customizer. Over its lifetime, an instance of a Customizer will only customize one single Bean. A new instance of the Customizer will be instantiated to edit any other Beans. The Customizer is responsible for notifying its PropertyChangeListeners ...
PropertyEditorManager: PropertyEditorManager is used to find property editors for various types (not necessarily Beans). It first checks to see if the property editor is already registered; if it is, that property editor is used. Next it takes the type's classname and appends "Editor" to it, and searches first in the class's package and then in the property editor search path. Default property editors are provided for: boolean, byte, short, int, long, float, and double java.lang.String java.awt.Color java.awt.Font Spec Suggestion: Perhaps an editor for Filename or something like it should be provided. As well as char ...
PropertyChangeEvent: PropertyChangeEvents are fired in the PropertyChange and VetoableChange event classes. They represent the old and new values as well as the source Bean. If the old or new value is a primitive type, it must be wrapped in the appropriate wrapper type (java.lang.Integer for int, etc., etc.). If the old or new values are unknown (although why that would be I do not know), they may be null. Also, if the set of properties itself has changed, the name should be null, and the old and new values may also be null. Right now Sun put in a propagationId, reserved for future use. Read the comments on the constructor ...
PropertyDescriptor: PropertyDescriptor describes information about a JavaBean property, by which we mean a property that has been exposed via a pair of get and set methods. (There may be no get method, which means the property is write-only, or no set method, which means the the property is read-only.) The constraints put on get and set methods are: A get method must have signature <propertyType> <getMethodName>() A set method must have signature void <setMethodName>(<propertyType>) Either method type may throw any exception. Both methods must be public.
FeatureDescriptor: FeatureDescriptor is the common superclass for all JavaBeans Descriptor classes. JavaBeans descriptors are abstract descriptors of properties, events, methods, beans, etc. Documentation Convention: for proper Internalization of Beans inside an RAD tool, sometimes there are two names for a property or method: a programmatic, or locale-independent name, which can be used anywhere, and a localized, display name, for ease of use. In the documentation I will specify different String values as either programmatic or localized to make this distinction clear.
SimpleBeanInfo: SimpleBeanInfo is a class you may extend to more easily provide select information to the Introspector. It implements all of the methods in BeanInfo by returning null and forces the Introspector to behave exactly as if there were no BeanInfo class at all (Introspecting everything). Overriding one or two of these functions to give explicit information on only those things you wish to give explicit information is perfectly safe, and even desirable. See the BeanInfo class for information on what the various methods actually do.
BeanContextProxy: Beans that wish to have a BeanContextChild or BeanContext associated with them but do not wish to implement those interfaces directly, can implement this interface. Don't shoot yourself in the foot: if you already implement BeanContextChild , directly or indirectly, the whole workings of this package will be unpredictable because it is indeterminate as to whether the BeanContextChild is used in preference to its proxy or vice versa.
BeanContextServiceProvider: An actual factory for services. It is the BeanContextServiceProvider 's responsibility to register itself with whatever BeanContextServices object it wishes to provide services through using the addService() method. If for some reason it can no longer provide services for a particular class, this class must invoke BeanContextServices.revokeService(serviceClass,this,true) for all the places it has registered the service.
PersistenceDelegate: A PersistenceDelegate describes how a another object has to constructed and transformed in order to create a complete replicate. For custom classes you will need to implement PersistenceDelegate in a way that is suitable for them. To make use of the implementation you have to register it with an Encoder using the {Encoder#setPersistenceDelegate} method.
EventHandler: EventHandler forms a bridge between dynamically created listeners and arbitrary properties and methods. You can use this class to easily create listener implementations for some basic interactions between an event source and its target. Using the three static methods named create you can create these listener implementations. See the documentation of each method for usage examples.
PropertyEditorSupport: PropertyEditorSupport helps with PropertyEditors, implementing base functionality that they usually must have but which is a pain to implement. You may extend from this class or use it as a standalone. This class does not do any painting or actual editing. For that, you must use or extend it. See the PropertyEditor class for better descriptions of what the various methods do.
Visibility: Visibility is an interface a Bean may implement so that the environment can tell the Bean whether there is a GUI or not, and so that the Bean can tell the environment whether it needs one or can run without one. Sun decided not to use standard Introspection patterns so that these methods did not get included when the Introspector made its sweep on the class.
DesignMode: BeanContextChild implementors implement this to get information about whether they are in a design time or runtime environment. The reason this is restricted to BeanContextChild ren is that only things in the BeanContext hierarchy are given this information in the first place.
PropertyChangeSupport: PropertyChangeSupport makes it easy to fire property change events and handle listeners. It allows chaining of listeners, as well as filtering by property name. In addition, it will serialize only those listeners which are serializable, ignoring the others without problem. This class is thread-safe.
VetoableChangeSupport: VetoableChangeSupport makes it easy to fire vetoable change events and handle listeners. It allows chaining of listeners, as well as filtering by property name. In addition, it will serialize only those listeners which are serializable, ignoring the others without problem. This class is thread-safe.
XMLEncoder: This class uses the PersistenceDelegate and Encoder infrastructure to generate an XML representation of the objects it serializes.

Home | Contact Us | Privacy Policy | Terms of Service