001 package railo.runtime.type.scope; 002 003 import java.util.List; 004 005 import railo.runtime.PageContext; 006 import railo.runtime.exp.PageException; 007 import railo.runtime.type.Collection; 008 import railo.runtime.type.Query; 009 import railo.runtime.type.Struct; 010 import railo.runtime.util.QueryStack; 011 012 /** 013 * interface of the cope undefined 014 */ 015 public interface Undefined extends Scope { 016 017 public static final int MODE_NO_LOCAL_AND_ARGUMENTS=0; 018 public static final int MODE_LOCAL_OR_ARGUMENTS_ONLY_WHEN_EXISTS=1; 019 public static final int MODE_LOCAL_OR_ARGUMENTS_ALWAYS=2; 020 021 022 /** 023 * @return returns the current local scope defined in the undefined scope 024 */ 025 public abstract Local localScope(); 026 027 public Argument argumentsScope(); 028 029 public Variables variablesScope(); 030 031 /** 032 * sets mode of scope 033 * @param mode new mode 034 * @return old mode 035 */ 036 public abstract int setMode(int mode); 037 038 public boolean getLocalAlways(); 039 040 041 /** 042 * sets the functions scopes 043 * @param local local scope 044 * @param argument argument scope 045 */ 046 public abstract void setFunctionScopes(Local local, Argument argument); 047 048 /** 049 * @return returns actuell collection stack 050 */ 051 public abstract QueryStack getQueryStack(); 052 053 /** 054 * sets a individual query stack to the undefined scope 055 * @param qryStack Query stack 056 */ 057 public abstract void setQueryStack(QueryStack qryStack); 058 059 /** 060 * add a collection to the undefined scope 061 * @param qry Query to add to undefined scope 062 */ 063 public abstract void addQuery(Query qry); 064 065 /** 066 * remove a collection from the undefined scope 067 */ 068 public abstract void removeQuery(); 069 070 /** 071 * return value matching key, if value is from Query return a QueryColumn 072 * @param key 073 * @return return matched value 074 * @throws PageException 075 * @deprecated use instead <code>{@link #getCollection(railo.runtime.type.Collection.Key)}</code> 076 */ 077 public abstract Object getCollection(String key) throws PageException; 078 079 080 public List<String> getScopeNames(); 081 082 /** 083 * return value matching key, if value is from Query return a QueryColumn 084 * @param key 085 * @return return matched value 086 * @throws PageException 087 */ 088 public abstract Object getCollection(Collection.Key key) throws PageException; 089 090 /** 091 * gets a key from all cascaded scopes, but not from variables scope 092 * @param key key to get 093 * @return matching value or null 094 * @deprecated use instead <code>{@link #getCascading(railo.runtime.type.Collection.Key)}</code> 095 */ 096 public abstract Object getCascading(String key); 097 098 /** 099 * gets a key from all cascaded scopes, but not from variables scope 100 * @param key key to get 101 * @return matching value or null 102 */ 103 public abstract Object getCascading(Collection.Key key); 104 105 /** 106 * change the variable scope 107 * @param scope 108 */ 109 public abstract void setVariableScope(Variables scope); 110 111 /** 112 * @return if check for arguments and local scope values 113 */ 114 public boolean getCheckArguments(); 115 116 public Struct getScope(Collection.Key key); 117 118 public boolean setAllowImplicidQueryCall(boolean allowImplicidQueryCall); 119 120 public void reinitialize(PageContext pc) ; 121 }