diff options
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/AbstractFactory.java')
-rw-r--r-- | framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/AbstractFactory.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/AbstractFactory.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/AbstractFactory.java new file mode 100644 index 000000000..3d6de9753 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/AbstractFactory.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This + * program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Composent, Inc. - initial API and implementation + ******************************************************************************/ +package org.eclipse.ecf.core.util; + +public class AbstractFactory { + public static Class[] getClassesForTypes(String[] argTypes, Object[] args, + ClassLoader cl) throws ClassNotFoundException { + Class clazzes[] = null; + if (args == null || args.length == 0) + clazzes = new Class[0]; + else if (argTypes != null) { + clazzes = new Class[argTypes.length]; + for (int i = 0; i < argTypes.length; i++) { + clazzes[i] = Class.forName(argTypes[i], true, cl); + } + } else { + clazzes = new Class[args.length]; + for (int i = 0; i < args.length; i++) { + if (args[i] == null) + clazzes[i] = null; + else + clazzes[i] = args[i].getClass(); + } + } + return clazzes; + } +}
\ No newline at end of file |