Hi Dean,

The aim of the Source Generator is to generate beans that follow the
Java Beans conventions.
In section 8.3.2 of the Java Beans specification, you can find the
following:

"This �is<PropertyName>� method may be provided instead of a
�get<PropertyName>� method, or it may be provided in addition to a
�get<PropertyName>� method.
In either case, if the �is<PropertyName>� method is present for a
boolean property then we will use the �is<PropertyName>� method to read
the property value."

Meaning that the isX() method is not mandatory. However if you think it
would make your life easier; feel free to submit an enhancement request.
I think it will be straightforward to add a switch in the binding file
to decide whether or not to use isX for Booleans.

Arnaud


-----Original Message-----
From: Chalker, Dean [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 30, 2003 4:43 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] RE: Suggestion: generate isX() methods for boolean
types

Ooops: two line change: gotta change FieldInfo.getReadMethodName() too
-----Original Message-----
From: Chalker, Dean 
Sent: Monday, 30 June 2003 12:32 PM
To: '[EMAIL PROTECTED]'
Subject: Suggestion: generate isX() methods for boolean types
HI all,
�
As a suggestion, how about generating isX() methods for boolean fields
rather than getX(), which is the norm.� This seems to be the industry
standard.
�
Looks like a one-line change.� In FieldInfo.createAccessMethods(JClass),
change the line:
method = new JMethod(jType,�"get"+mname);
to
method = new JMethod(jType, ((jType != JType.Boolean) ? "get" : "is") +
mname);
�
Regards
Dean
�
�
�
�
intelli WHERE www.intelliwhere.com

Dr. Dean Chalker�
Senior Architect
[EMAIL PROTECTED]

IntelliWhere Division, �Intergraph Corporation
Australia

Phone: 61-7-3510 8918� Fax: 61-7-3510 8901�
�
�
�

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to