Example usage for com.google.gwt.core.ext.typeinfo JConstructor isVarArgs

List of usage examples for com.google.gwt.core.ext.typeinfo JConstructor isVarArgs

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.typeinfo JConstructor isVarArgs.

Prototype

boolean isVarArgs();

Source Link

Usage

From source file:fr.onevu.gwt.uibinder.rebind.TypeOracleUtils.java

License:Apache License

/**
 * Check for a constructor which is compatible with the supplied argument
 * types./*  w  w w.  j a  v a 2s  . c  om*/
 * 
 * @param type
 * @param argTypes
 * @return true if a constructor compatible with the supplied arguments exists
 */
public static boolean hasCompatibleConstructor(JClassType type, JType... argTypes) {
    // Note that this does not return the constructor, since that is a more
    // complicated decision about finding the best matching arguments where
    // more than one are compatible.
    for (JConstructor ctor : type.getConstructors()) {
        if (typesAreCompatible(ctor.getParameterTypes(), argTypes, ctor.isVarArgs())) {
            return true;
        }
    }
    return false;
}