Java Beans are components that can be controlled dynamically and assembled to applications via visual components. However, they not only have visual uses but they could be used to implement non-visual components as well. They are mainly converted to
Principally, JLCA 3.0 conversion takes into account the following features of Java Beans - File Manifest.MF, Bean Classes (Visual and non-Visual), Descriptors Info (converted to the equivalent
Table 6 and Table 7 below contain the relevant details for Java Beans conversion. In a summarized manner, they enunciate the Java Beans features preserved in the converted applications. On the other hand, they suggest the issues that the user should take care while converting application containing Java Beans.
Class / Interface in Package java.beans
JLCA 3.0 Coverage
Provides a proper initialization to invoke java.beans.Beans.instantiate method.
This kind of initialization is not necessary in .NET Framework.
Used within BeanInfo to provide information for design-time.
In .NET Framework, this kind of information is represented using attributes of System.ComponentModel.
The required information of these classes is converted based onBeanInfo’s source code.
This class initializes a JavaBean.
In .NET Frameowrk, this should be done like a normal construction of a type.
This class provides a complete custom GUI for customizing a target Java Bean.
Controls in .NET Framework have the capacity to define a class using System.ComponentModel.DesignerAttribute for controlling the controls in Design-time, but the approach is different.
This class is the common baseclass for PropertyDescriptor, EventSetDescriptor, and MethodDescriptor, etc.
The important methods of this class that are inherited by other descriptors are also converted.
Provides a standard way for tools to learn about the properties, events and methods supported by a target Java Bean.
.NET Framework does not need more introspection than its normal reflection to extract the data or the corresponding exception.
A "PropertyChange" event gets delivered whenever a bean changes a "bound" or "constrained" property.
Conversion maps to SupportClass.PropertyChangingEventArgs which extends from PropertyChangedEventArgs and provides properties used in constrained properties
Provides listener to bean’s PropertyChange Event.
The listener related to the PropertyChangeEvent is converted like any other event listener.
Utility class used by beans that support bound properties.
In .NET Framework this is handled with += or -= operators through the PropertyChangeListener.
This class provides support for GUIs that want to allow users to edit a property value of a given type.
The enumerations and text representations are converted through System.ComponentModel.TypeConverter. Custom representations are supported partially since automatic conversion to System.Drawing.Design.UITypeEditor cannot be generalized.
Associates an editor to a data type.
In .NET Framework this functionality supported with editors like TypeConverter or UITypeEditor, with the System.ComponentModel.TypeConverterAttribute or System.ComponentModel.EditorAttribute
This exception is thrown when a proposed change to a property represents an unacceptable value.
The System.ArgumentOurOfRangeException is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method.
This is a utility class used by beans that support constrained properties.
.NET Framework can support the change of values in a property but not with the kind of restrictions provided by this class.
Determines whether the component must be visually displayed.
This methodology does not apply in .NET Framework.
Table 6: Java Beans Conversion Coverage – Package java.beans
Bean Info Classes
Bean Info classes are analyzed to extract information and convert supported features. They are not converted since do not apply for the .NET Framework Component Model. The user can ignore the converted BeanInfo classes since their features are “converted” to .NET Framework model.
Conversion of Icons used to represent Java Beans in tool boxes or list views is not supported.
A workaround could be to use the attribute System.Drawing.ToolboxBitmap.
Bean’s Unicast and Multicast Events
Conversion of setting the default event as Multicast is not converted. Setting event descriptors as Unicast is not supported too. A workaround can be to use the class attribute System.ComponentModel.DefaultEvent.
Conversion for Java Beans requires the respective Manifest File (META-INF\MANIFEST.MF) to reside inside the source code directory (or inside .jar files). It allows identify Java Bean and relative BeanInfo classes.
Table 7: Java Beans Conversion Issues