Hello everybody,
I have a question about the JavaBeans Property Naming Rules used in B&K book.
This rule explain that: (pag 9)
"Getter method signatures must be marked public,
take no arguments, and have a return type that matches the argument type of the setter method for that property."
But in the
Java APIs, this JavaBeans property is not observed.
For example:
1)In the Java URL class (java.net package) a getter has this signature:
public final Object getContent(Class[] classes) //it takes an array argument
2)In the Integer class (java.lang package) three getters don't have standard signatures:
public static Integer getInteger(
String nm)
public static Integer getInteger(String nm, int val)
public static Integer getInteger(String nm, Integer val)
and in other classes of other packages have this not standard JavaBeans behavior.
I will use this rule, but why in the Java API is not all the time respected?
Is it a issue/compatibility with the past?
Thanks, and sorry for my english
KK