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