1 26 27 package org.objectweb.util.browser.core.naming; 28 29 30 import org.objectweb.util.browser.api.Context; 31 import org.objectweb.util.browser.api.Entry; 32 import org.objectweb.util.browser.api.Wrapper; 33 import org.objectweb.util.browser.core.api.Decoder; 34 35 42 public class ContextDecoderManager 43 implements Context, Wrapper { 44 45 51 52 protected Decoder decoder_; 53 54 55 protected Context delegate_; 56 57 63 69 78 protected Entry createEntry(Object value, String id) { 79 return new DefaultEntry(value, new DefaultName(id), this); 80 } 81 82 88 92 public Entry[] getEntries(){ 93 Entry[] entries = delegate_.getEntries(); 94 Entry[] decodedEntries = new Entry[entries.length]; 95 for (int i = 0; i < entries.length; i++) { 96 if (entries[i] != null) 97 decodedEntries[i] = createEntry(decoder_.decode(entries[i].getValue()),entries[i].getName().toString()); 98 } 99 return decodedEntries; 100 } 101 102 108 114 public void setWrapped(Object object) { 115 ((Wrapper) delegate_).setWrapped(object); 117 } 118 119 125 public Object getWrapped() { 126 return ((Wrapper) delegate_).getWrapped(); 127 } 128 129 135 138 public void setDelegate(Context context) { 139 delegate_ = context; 140 } 141 142 145 public void setDecoder(Decoder decoder) { 146 decoder_ = decoder; 147 } 148 } 149 | Popular Tags |