1 16 package org.apache.cocoon.components.flow.javascript.fom; 17 18 import org.mozilla.javascript.Scriptable; 19 import org.mozilla.javascript.ScriptableObject; 20 21 24 public class PageLocalScopeHolder implements PageLocalScope { 25 26 private Scriptable scope; 27 private PageLocalScopeImpl delegate; 28 29 public PageLocalScopeHolder(Scriptable scope) { 30 this.scope = scope; 31 } 32 33 public boolean has(PageLocal local, String name) { 34 return delegate.has(local, name); 35 } 36 37 public boolean has(PageLocal local, int index) { 38 return delegate.has(local, index); 39 } 40 41 public Object get(PageLocal local, String name) { 42 return delegate.get(local, name); 43 } 44 45 public Object get(PageLocal local, int index) { 46 return delegate.get(local, index); 47 } 48 49 public void put(PageLocal local, String name, Object value) { 50 delegate.put(local, name, value); 51 } 52 53 public void put(PageLocal local, int index, Object value) { 54 delegate.put(local, index, value); 55 } 56 57 public void delete(PageLocal local, String name) { 58 delegate.delete(local, name); 59 } 60 61 public void delete(PageLocal local, int index) { 62 delegate.delete(local, index); 63 } 64 65 public Object [] getIds(PageLocal local) { 66 return delegate.getIds(local); 67 } 68 69 public Object getDefaultValue(PageLocal local, Class hint) { 70 return delegate.getDefaultValue(local, hint); 71 } 72 73 public void setDelegate(PageLocalScopeImpl delegate) { 74 this.delegate = delegate; 75 } 76 77 public PageLocalScopeImpl getDelegate() { 78 return delegate; 79 } 80 81 public PageLocal createPageLocal() { 82 PageLocalImpl pageLocal = new PageLocalImpl(); 83 pageLocal.setPrototype(ScriptableObject.getClassPrototype(scope, 84 pageLocal.getClassName())); 85 pageLocal.setParentScope(scope); 86 pageLocal.setPageLocalScope(this); 87 return pageLocal; 88 } 89 } 90 | Popular Tags |