1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 import javax.xml.namespace.QName ; 28 29 import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; 30 import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; 31 import org.jboss.beans.metadata.spi.ParameterMetaData; 32 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; 33 34 40 public class LifecycleParametersInterceptor extends DefaultElementInterceptor 41 { 42 43 public static final LifecycleParametersInterceptor INTERCEPTOR = new LifecycleParametersInterceptor(); 44 45 public void add(Object parent, Object child, QName name) 46 { 47 AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) parent; 48 AbstractParameterMetaData parameter = (AbstractParameterMetaData) child; 49 List <ParameterMetaData> parameters = lifecycle.getParameters(); 50 if (parameters == null) 51 { 52 parameters = new ArrayList <ParameterMetaData>(); 53 lifecycle.setParameters(parameters); 54 } 55 parameter.setIndex(parameters.size()); 56 parameters.add(parameter); 57 } 58 } 59 | Popular Tags |