// SomeType cannot be boolean public void setProp( SomeType x ); public SomeType getProp( );or:
// type must be boolean public void setProp( boolean x ); public boolean isProp( );For example, class java.awt.Component has many properties, including:
PROPERTY NAME TYPE background java.awt.Color enabled boolean location java.awt.PointThe derived class java.awt.Container has all those properties plus also, among others:
PROPERTY NAME TYPE font java.awt.Font layout java.awt.LayoutManager
package cop4338;
public class Utilities
{
public static java.util.Map getProperties( Class cl )
{ ... }
public static java.util.Map getPropertyVals( Object obj )
{ ... }
}
The getProperties method returns a Map that stores the properties (as defined above) of Class cl. In the map that is returned, the keys are Strings (each of which represents a property name) and the values are Class objects (each of which represents the corresponding property type).
The getPropertyVals method returns a Map that stores the current value of the properties (as defined above) of Object obj. In the map that is returned, the keys are Strings (each of which represents a property name) and the values are of type Object each of which represents the current value of the corresponding property type. You can get the value by invoking the appropriate get method (using the invoke method of class Method. Under no circumstances may either method produce any output at all, and you will receive a huge deduction if you violate this requirement.
Next, create an object of type java.util.Date and invoke getPropertyVals on it, outputting the state of the Date object's properties. If you are careful, the routine that traverses the Map (written above) can be reused. Needless to say, you should invoke getProperties as part of your implementation.
Finally, you should write a class that you will pass as a parameter to getProperties to show that getProperties correctly:
You will receive a huge deduction if you violate the submission requirements.