org.azolla.l.ling.lang.Class0 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.azolla.l.ling Show documentation
Show all versions of org.azolla.l.ling Show documentation
Azolla.org Core Library for Java
/*
* @(#)Class0.java Created at 2013-10-31
*
* Copyright (c) 2011-2013 azolla.org All rights reserved.
* Azolla PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package org.azolla.l.ling.lang;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import javax.annotation.Nullable;
import org.azolla.l.ling.exception.code.AzollaCode;
import org.azolla.l.ling.text.Fmt0;
import org.azolla.l.ling.util.KV;
import org.azolla.l.ling.util.Log0;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
/**
* The coder is very lazy, nothing to write for this Class0 class
*
* @author [email protected]
* @since ADK1.0
*/
public class Class0
{
private Class> clazz = null;
private Object instance = null;
public Class0(String className, Object... args) throws Exception
{
this(className, null, args);
}
@SuppressWarnings("rawtypes")
public Class0(String className, @Nullable Class>[] argTypes, Object... args) throws Exception
{
// clazz = ClassLoader.getSystemClassLoader().loadClass(className);
clazz = loadClass(className);
if(argTypes == null)
{
instance = clazz.getConstructor(Lists.transform(Lists.newArrayList(args), new Function