1 50 51 package org.openlaszlo.iv.flash.context; 52 53 import org.openlaszlo.iv.flash.util.PropertyManager; 54 55 import java.util.*; 56 57 63 public class StandardContext extends Context { 64 65 private Hashtable table = new Hashtable(); 66 67 70 public StandardContext() {} 71 72 77 public StandardContext( Hashtable table ) { 78 this.table = table; 79 } 80 81 86 public StandardContext( Context context ) { 87 setParent( context ); 88 } 89 90 96 public void setValue( String name, String value ) { 97 if( !PropertyManager.varCaseSensitive ) name = name.toUpperCase(); 98 table.put(name, value); 99 } 100 101 107 public String getValue( String name ) { 108 String _name = PropertyManager.varCaseSensitive? name: name.toUpperCase(); 109 String value = (String ) table.get(_name); 110 if( value != null ) return value; 111 return getValueFromParent(name); 112 } 113 114 protected StandardContext( StandardContext from ) { 115 table = (Hashtable) from.table.clone(); 116 setParent( from.getParent() ); 117 } 118 119 public Object clone() { 120 return new StandardContext(this); 121 } 122 } 123 | Popular Tags |