1 22 package org.jboss.kernel.plugins.deployment.xml; 23 24 import javax.xml.namespace.NamespaceContext ; 25 import javax.xml.namespace.QName ; 26 27 import org.jboss.beans.metadata.plugins.StringValueMetaData; 28 import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; 29 import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; 30 import org.xml.sax.Attributes ; 31 32 38 public class PlainValueHandler extends DefaultElementHandler 39 { 40 41 public static final PlainValueHandler HANDLER = new PlainValueHandler(); 42 43 public Object startElement(Object parent, QName name, ElementBinding element) 44 { 45 return new StringValueMetaData(); 46 } 47 48 public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) 49 { 50 StringValueMetaData value = (StringValueMetaData) o; 51 for (int i = 0; i < attrs.getLength(); ++i) 52 { 53 String localName = attrs.getLocalName(i); 54 if ("class".equals(localName)) 55 value.setType(attrs.getValue(i)); 56 } 57 } 58 } 59 | Popular Tags |