io.github.kiryu1223.expressionTree.expressions.NewExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ExpressionTree Show documentation
Show all versions of ExpressionTree Show documentation
java static expressionTree
package io.github.kiryu1223.expressionTree.expressions;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
public class NewExpression extends Expression
{
private final Class> type;
private final List> typeArgs;
private final Constructor> constructor;
private final List constructorArgs;
private final BlockExpression classBody;
public NewExpression(Class> type, List> typeArgs, Constructor> constructor, List constructorArgs, BlockExpression classBody)
{
this.type = type;
this.typeArgs = typeArgs;
this.constructor = constructor;
this.constructorArgs = constructorArgs;
this.classBody = classBody;
}
public Class> getType()
{
return type;
}
public List> getTypeArgs()
{
return typeArgs;
}
public List getConstructorArgs()
{
return constructorArgs;
}
public BlockExpression getClassBody()
{
return classBody;
}
@Override
public Kind getKind()
{
return Kind.New;
}
@Override
public Object getValue()
{
try
{
List