Search in sources :

Example 1 with Constructors

use of org.whole.lang.pojo.model.Constructors in project whole by wholeplatform.

the class PojoUtils method getConstructors.

public static List<Constructor> getConstructors(PojoDeclaration pojoDeclaration) {
    Constructors constructors = pojoDeclaration.getConstructors();
    List<Constructor> constructorsList = new ArrayList<Constructor>(constructors.wSize());
    IEntityIterator<Constructor> i = IteratorFactory.<Constructor>childIterator();
    i.reset(constructors);
    for (Constructor constructor : i) constructorsList.add(constructor);
    Collections.sort(constructorsList, new Comparator<Constructor>() {

        public int compare(Constructor c1, Constructor c2) {
            return c1.getParameters().wSize() - c2.getParameters().wSize();
        }
    });
    return constructorsList;
}
Also used : Constructor(org.whole.lang.pojo.model.Constructor) ArrayList(java.util.ArrayList) Constructors(org.whole.lang.pojo.model.Constructors)

Aggregations

ArrayList (java.util.ArrayList)1 Constructor (org.whole.lang.pojo.model.Constructor)1 Constructors (org.whole.lang.pojo.model.Constructors)1