Java Code Examples for com.sun.codemodel.JDefinedClass#getConstructor()

The following examples show how to use com.sun.codemodel.JDefinedClass#getConstructor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PluginImpl.java    From immutable-xjc with MIT License 5 votes vote down vote up
private JMethod addPropertyContructor(JDefinedClass clazz, JFieldVar[] declaredFields, JFieldVar[] superclassFields, int constAccess) {
    JMethod ctor = clazz.getConstructor(getFieldTypes(declaredFields, superclassFields));
    if (ctor == null) {
        ctor = this.generatePropertyConstructor(clazz, declaredFields, superclassFields, constAccess);
    } else {
        this.log(Level.WARNING, "standardCtorExists");
    }
    return ctor;
}
 
Example 2
Source File: PluginImpl.java    From immutable-xjc with MIT License 5 votes vote down vote up
private JMethod addStandardConstructor(final JDefinedClass clazz, JFieldVar[] declaredFields, JFieldVar[] superclassFields) {
    JMethod ctor = clazz.getConstructor(NO_ARGS);
    if (ctor == null) {
        ctor = this.generateStandardConstructor(clazz, declaredFields, superclassFields);
    } else {
        this.log(Level.WARNING, "standardCtorExists");
    }
    return ctor;
}