001    package railo.runtime.interpreter.ref.var;
002    
003    import railo.runtime.exp.PageException;
004    import railo.runtime.interpreter.ref.Ref;
005    import railo.runtime.interpreter.ref.RefSupport;
006    import railo.runtime.interpreter.ref.Set;
007    import railo.runtime.type.scope.BindScope;
008    
009    public final class Bind extends RefSupport implements Set {
010        
011        private Scope scope;
012    
013        public Bind(Scope scope) {
014            this.scope=scope;
015        }
016    
017        /**
018         * @return
019         * @throws PageException
020         */
021        public Object touchValue() throws PageException {
022            Object obj = scope.touchValue();
023            if(obj instanceof BindScope) ((BindScope)obj).setBind(true);
024            return obj;
025        }
026    
027        /**
028         * @see railo.runtime.interpreter.ref.Ref#getValue()
029         */
030        public Object getValue() throws PageException {
031            Object obj = scope.getValue();
032            if(obj instanceof BindScope) ((BindScope)obj).setBind(true);
033            return obj;
034        }
035    
036        /**
037         * @see railo.runtime.interpreter.ref.Ref#getTypeName()
038         */
039        public String getTypeName() {
040            return scope.getTypeName()+" bind";
041        }
042    
043        /**
044         * @see railo.runtime.interpreter.ref.Set#setValue(java.lang.Object)
045         */
046        public Object setValue(Object obj) throws PageException {
047            return scope.setValue(obj);
048        }
049    
050        /**
051         * @see railo.runtime.interpreter.ref.Set#getParent()
052         */
053        public Ref getParent() throws PageException {
054            return scope.getParent();
055        }
056    
057        /**
058         * @see railo.runtime.interpreter.ref.Set#getKey()
059         */
060        public Ref getKey() throws PageException {
061            return scope.getKey();
062        }
063    
064        /**
065         * @see railo.runtime.interpreter.ref.Set#getKeyAsString()
066         */
067        public String getKeyAsString() throws PageException {
068            return scope.getKeyAsString();
069        }
070    }