Package l2p.extensions.scripts

Examples of l2p.extensions.scripts.ScriptObject


  {
    if(l2p.extensions.scripts.ScriptManager.loading)
    {
      return null;
    }
    ScriptObject o;
    try
    {
      o = scriptClass.newInstance();
    }
    catch(Exception e)
    {
      e.printStackTrace();
      return null;
    }
    if(variables != null && variables.size() > 0)
    {
      for(Map.Entry<String, Object> obj : variables.entrySet())
      {
        try
        {
          o.setProperty(obj.getKey(), obj.getValue());
        }
        catch(Exception e)
        {
        }
      }
    }
    try
    {
      o.setProperty("self", null);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    return args == null ? o.invokeMethod(method) : o.invokeMethod(method, args);
  }
View Full Code Here


  {
    if(l2p.extensions.scripts.ScriptManager.loading)
    {
      return null;
    }
    ScriptObject o;
    try
    {
      o = scriptClass.newInstance();
    }
    catch(Exception e)
    {
      e.printStackTrace();
      return null;
    }
    if(variables != null && variables.size() > 0)
    {
      for(Map.Entry<String, Object> obj : variables.entrySet())
      {
        try
        {
          o.setProperty(obj.getKey(), obj.getValue());
        }
        catch(Exception e)
        {
        }
      }
    }
    try
    {
      if(o.isFunctions())
      {
        o.setProperty("self", getStoredId());
      }
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    Object ret = args == null ? o.invokeMethod(method) : o.invokeMethod(method, args);
    try
    {
      if(o.isFunctions())
      {
        o.setProperty("self", null);
      }
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

  {
    if(l2p.extensions.scripts.ScriptManager.loading)
    {
      return null;
    }
    ScriptObject o;
    Script scriptClass = ScriptManager.getInstance().getClasses().get(_class);
    if(scriptClass == null)
    {
      _log.info("Script class " + _class + " not found");
      return null;
    }
    try
    {
      o = scriptClass.newInstance();
    }
    catch(Exception e)
    {
      e.printStackTrace();
      return null;
    }
    if(variables != null && variables.size() > 0)
    {
      for(Map.Entry<String, Object> obj : variables.entrySet())
      {
        try
        {
          o.setProperty(obj.getKey(), obj.getValue());
        }
        catch(Exception e)
        {
        }
      }
    }
    try
    {
      o.setProperty("self", getStoredId());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    Object ret = args == null ? o.invokeMethod(method) : o.invokeMethod(method, args);
    try
    {
      o.setProperty("self", null);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of l2p.extensions.scripts.ScriptObject

Copyright © 2018 www.massapicom. 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.