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