Package de.tuhrig.thofu.java

Source Code of de.tuhrig.thofu.java.LJClass

package de.tuhrig.thofu.java;

import de.tuhrig.thofu.Environment;
import de.tuhrig.thofu.types.LException;
import de.tuhrig.thofu.types.LObject;
import de.tuhrig.thofu.types.LSymbol;

/**
* Represents a Java class.
*
* @author Thomas Uhrig (tuhrig.de)
*/
public class LJClass extends LJava {

  private String className;

  public LJClass(LSymbol key) {

    className = key.toString().replace(".class", "");
   
    if(result == null) {
     
      try {
       
        result = LJava.getClass(className);
      }
      catch (Exception e) {

        throw new LException("[" + e.getClass() + "] - " + e.getMessage(), e);
      }
    }
  }

  @Override
  public LObject evaluate(Environment environment, LObject tokens) {
   
    return this;
  }

  @Override
  public int argrumentSize(LObject tokens) {

    return -1;
  }
}
TOP

Related Classes of de.tuhrig.thofu.java.LJClass

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.