A factory method name corresponding a constructor is generated from a class name that is not qualified by a package name. Factory method names including methods inherited from the super classes must all be unique to one another. However, names conflict when:
Super classes have a same name qualified by different packages.
Two or more constructors are defined for one class.
In this case, the J adapter class generator assigns numbers to the methods with a same name according to the following rules:
Number 01 is assigned to the name that appears first and then serial numbers are assigned in ascending order to the subsequent names.
The above rule is applied to names in order from the constructor defined in the super class. When two or more constructors are defined for one class, the rule is applied to them in order they are defined.
Example
The factory methods corresponding to the constructor of the java.util.Date class and java.sql.Date class (subclass of the java.util.Date class) are assigned names as shown below:
java.util.Date class | Date() | ava-util-Date class | Create-Date-01 |
Date(int, int, int) | Create-Date-02 | ||
Date(int, int, int, int, int) | Create-Date-03 | ||
Date(int, int, int, int, int, int) | Create-Date-04 | ||
Date(long) | Create-Date-05 | ||
Date(String) | Create-Date-06 | ||
java.sql.Date class | Date(int, int, int) | java-sql-Date class | Create-Date-07 |
Date(long) | Create-Date-08 |