1 22 package org.jboss.xb.binding.sunday.unmarshalling; 23 24 import javax.xml.namespace.QName ; 25 import javax.xml.namespace.NamespaceContext ; 26 27 import org.jboss.xb.binding.metadata.ValueMetaData; 28 29 33 public abstract class AttributeHandler 34 { 35 public static AttributeHandler NOOP = new AttributeHandler() 36 { 37 public void attribute(QName elemName, QName attrName, AttributeBinding binding, Object owner, Object value) 38 { 39 } 40 }; 41 42 public Object unmarshal(QName elemName, 43 QName attrName, 44 AttributeBinding binding, 45 NamespaceContext nsCtx, 46 String value) 47 { 48 TypeBinding type = binding.getType(); 49 ValueMetaData valueMetaData = binding.getValueMetaData(); 50 return type == null ? value : type.getCharactersHandler().unmarshal(attrName, type, nsCtx, valueMetaData, value); 51 } 52 53 public abstract void attribute(QName elemName, 54 QName attrName, 55 AttributeBinding binding, 56 Object owner, 57 Object value); 58 } 59 | Popular Tags |