Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.kasource.commons.reflection.filter.constructors;
 
 
 
Filters constructors which parameters types passes a ClassFilter.

Note: It's not recommended to use this class directly, instead use the org.kasource.commons.reflection.ConstructorFilterBuilder.

Author(s):
rikardwi
    private int parameterIndex;
    private ClassFilter filter;
    private ClassFilter[] filters;
    
        this. = filters;
    }
    
    public ParameterClassFilterConstructorFilter(int parameterIndexClassFilter filter) {
        this. = parameterIndex;
        this. = filter;
    }
    @SuppressWarnings("rawtypes")
    @Override
    public boolean passFilter(Constructor constructor) {
        if( != null) {
            if((constructor.getParameterTypes().length - 1) < ) {
                return false;
            }
            return .passFilter(constructor.getParameterTypes()[]);
        } else if( != null) {
            if(. != constructor.getParameterTypes().length) {
                return false;
            }
            for(int i = 0; i <  .; ++i) {
                Class<?> paramterType = constructor.getParameterTypes()[i];
                if(![i].passFilter(paramterType)) {
                    return false;
                }
            }
        }
        return true;
    }
New to GrepCode? Check out our FAQ X