1 10 11 package org.picocontainer.defaults; 12 13 import org.picocontainer.ComponentAdapter; 14 import org.picocontainer.PicoContainer; 15 import org.picocontainer.PicoInitializationException; 16 import org.picocontainer.PicoIntrospectionException; 17 import org.picocontainer.PicoVisitor; 18 19 import java.io.Serializable ; 20 21 26 public class DecoratingComponentAdapter implements ComponentAdapter, Serializable { 27 28 private ComponentAdapter delegate; 29 30 public DecoratingComponentAdapter(ComponentAdapter delegate) { 31 this.delegate = delegate; 32 } 33 34 public Object getComponentKey() { 35 return delegate.getComponentKey(); 36 } 37 38 public Class getComponentImplementation() { 39 return delegate.getComponentImplementation(); 40 } 41 42 public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException { 43 return delegate.getComponentInstance(container); 44 } 45 46 public void verify(PicoContainer container) throws PicoIntrospectionException { 47 delegate.verify(container); 48 } 49 50 public ComponentAdapter getDelegate() { 51 return delegate; 52 } 53 54 public void accept(PicoVisitor visitor) { 55 visitor.visitComponentAdapter(this); 56 delegate.accept(visitor); 57 } 58 59 public String toString() { 60 StringBuffer buffer = new StringBuffer (this.getClass().getName()); 61 buffer.append("["); 62 buffer.append(delegate.toString()); 63 buffer.append("]"); 64 return buffer.toString(); 65 } 66 } 67 | Popular Tags |