001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.type; 020 021import lucee.runtime.ComponentImpl; 022import lucee.runtime.PageContext; 023import lucee.runtime.exp.PageException; 024 025// FUTURE add to interface UDF 026 027public interface UDFPlus extends UDF { 028 029 030 public static final int RETURN_FORMAT_JAVA=5; 031 032 033 /** 034 * call user defined Funcion with a struct 035 * @param pageContext 036 * @param values named values 037 * @param doIncludePath 038 * @return return value of the function 039 * @throws PageException 040 */ 041 public abstract Object callWithNamedValues(PageContext pageContext,Collection.Key calledName,Struct values, boolean doIncludePath) throws PageException; 042 043 /** 044 * call user defined Funcion with parameters as Object Array 045 * @param pageContext 046 * @param args parameters for the function 047 * @param doIncludePath 048 * @return return value of the function 049 * @throws PageException 050 */ 051 public abstract Object call(PageContext pageContext, Collection.Key calledName, Object[] args, boolean doIncludePath) throws PageException; 052 053 public Object getDefaultValue(PageContext pc, int index, Object defaultValue) throws PageException; 054 public int getIndex(); 055 056 057 // !!!!!! do not move to public interface, make for example a interface calle UDFMod 058 public void setOwnerComponent(ComponentImpl component); 059 public void setAccess(int access); 060 061 public abstract int getReturnFormat(int defaultFormat); 062 063}