1 29 30 package com.caucho.jaxb.skeleton; 31 import javax.xml.bind.DatatypeConverter; 32 import javax.xml.stream.XMLStreamException; 33 import java.io.IOException ; 34 import java.math.BigDecimal ; 35 36 39 public class BigDecimalProperty extends CDataProperty { 40 public static final BigDecimalProperty PROPERTY = new BigDecimalProperty(); 41 42 protected String write(Object in) 43 throws IOException , XMLStreamException 44 { 45 return DatatypeConverter.printDecimal((BigDecimal ) in); 46 } 47 48 protected Object read(String in) 49 throws IOException , XMLStreamException 50 { 51 return DatatypeConverter.parseDecimal(in); 52 } 53 54 public String getSchemaType() 55 { 56 return "xsd:decimal"; 57 } 58 59 public boolean isXmlPrimitiveType() 60 { 61 return true; 62 } 63 } 64 65 66 | Popular Tags |