1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import javax.xml.namespace.QName ; 25 26 import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; 27 import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; 28 import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; 29 import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; 30 import org.jboss.beans.metadata.plugins.AbstractValueMetaData; 31 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; 32 33 39 public abstract class ValueElementInterceptor extends DefaultElementInterceptor 40 { 41 public void add(Object parent, Object child, QName name) 42 { 43 if (parent instanceof AbstractCollectionMetaData) 44 { 45 AbstractCollectionMetaData collection = (AbstractCollectionMetaData) parent; 46 collection.add(getValue()); 47 } 48 else if (parent instanceof AbstractParameterMetaData) 49 { 50 AbstractParameterMetaData valueMetaData = (AbstractParameterMetaData) parent; 51 valueMetaData.setValue(getValue()); 52 } 53 else if (parent instanceof AbstractPropertyMetaData) 54 { 55 AbstractPropertyMetaData valueMetaData = (AbstractPropertyMetaData) parent; 56 valueMetaData.setValue(getValue()); 57 } 58 else if (parent instanceof AbstractClassLoaderMetaData) 59 { 60 AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent; 61 valueMetaData.setClassLoader(getValue()); 62 } 63 else 64 { 65 AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent; 66 valueMetaData.setValue(getValue()); 67 } 68 } 69 70 public abstract AbstractValueMetaData getValue(); 71 } | Popular Tags |