1 26 package org.objectweb.util.explorer.context.lib; 27 28 import org.objectweb.util.explorer.api.Entry; 29 import org.objectweb.util.explorer.core.common.api.ContextContainer; 30 import org.objectweb.util.explorer.core.common.lib.DefaultContextContainer; 31 32 40 public class DecoderContextContainer 41 extends DecoderContext 42 implements ContextContainer 43 { 44 45 51 protected ContextContainer delegate_ = null; 52 53 59 62 public DecoderContextContainer(){ 63 this(new DefaultContextContainer()); 64 } 65 66 69 public DecoderContextContainer(ContextContainer delegate){ 70 if(delegate!=null) 71 delegate_ = delegate; 72 else 73 delegate_ = new DefaultContextContainer(); 74 super.delegate_= this.delegate_; 75 } 76 77 83 89 92 public Entry getEntry(Object name) { 93 Entry entry = delegate_.getEntry(name); 94 if(entry!=null && decoder_!=null){ 95 entry.setValue(decoder_.decode(entry.getValue())); 96 } 97 return entry; 98 } 99 100 103 public void addEntry(Object name, Object value) { 104 delegate_.addEntry(name,value); 105 } 106 107 110 public void addEntry(Entry entry) { 111 delegate_.addEntry(entry); 112 } 113 114 117 public void removeEntry(Object name) { 118 delegate_.removeEntry(name); 119 } 120 121 124 public void clear() { 125 delegate_.clear(); 126 } 127 128 131 public int getSize() { 132 return delegate_.getSize(); 133 } 134 135 } 136 137 138 | Popular Tags |