1 29 30 package com.caucho.jaxb.skeleton; 31 import javax.xml.bind.DatatypeConverter; 32 import javax.xml.bind.JAXBException; 33 import javax.xml.bind.Marshaller; 34 import javax.xml.stream.XMLStreamException; 35 import javax.xml.stream.XMLStreamWriter; 36 import java.io.IOException ; 37 38 41 public class ByteProperty extends CDataProperty { 42 public static final ByteProperty OBJECT_PROPERTY = new ByteProperty(true); 43 public static final ByteProperty PRIMITIVE_PROPERTY = new ByteProperty(false); 44 45 protected ByteProperty(boolean isNillable) 46 { 47 _isNillable = isNillable; 48 } 49 50 protected String write(Object in) 51 throws IOException , XMLStreamException 52 { 53 return DatatypeConverter.printByte(((Byte ) in).byteValue()); 54 } 55 56 protected Object read(String in) 57 throws IOException , XMLStreamException 58 { 59 return DatatypeConverter.parseByte(in); 60 } 61 62 public String getSchemaType() 63 { 64 return "xsd:byte"; 65 } 66 } 67 | Popular Tags |