Here you can find the source of isa(Collection
Parameter | Description |
---|---|
types | class tokens to check against |
type | class token |
private static boolean isa(Collection<Class<?>> types, Class<?> type)
//package com.java2s; /**/*from ww w . ja v a 2s .c om*/ * Copyright 2005-2015 The Kuali Foundation * * Licensed under the Educational Community License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ecl2.php * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.util.Collection; public class Main { /** * @param types class tokens to check against * @param type class token * @return true if the given Class is assignable from one of the classes in * the given Class[] */ private static boolean isa(Collection<Class<?>> types, Class<?> type) { for (Class<?> cur : types) { if (cur.isAssignableFrom(type)) { return true; } } return false; } }