### Question:
EnumType extends AegisType { @Override public Object readObject(MessageReader reader, Context context) { String value = reader.getValue(); return matchValue(value); }  @Override Object readObject(MessageReader reader, Context context); @Override void writeObject(Object object, MessageWriter writer, Context context); @Override void setTypeClass(Type typeClass); @Override void writeSchema(XmlSchema root); @Override boolean isComplex();  }### Answer:
@Test public void testNillable() throws Exception { AegisType type = tm.getTypeCreator().createType(EnumBean.class); tm.register(type); Element root = writeObjectToElement(type, new EnumBean(), getContext()); ElementReader reader = new ElementReader(StaxUtils.createXMLStreamReader(root)); Object value = type.readObject(reader, getContext()); assertTrue(value instanceof EnumBean); EnumBean bean = (EnumBean)value; assertNull(bean.getCurrency()); }
@Test public void testTypeWithJaxbAnnotations() throws Exception { AegisType type = tm.getTypeCreator().createType(JaxbTestEnum.class); Element element = writeObjectToElement(type, JaxbTestEnum.VALUE1, getContext()); assertEquals("Value1", element.getTextContent()); XMLStreamReader xreader = StaxUtils.createXMLStreamReader(element); ElementReader reader = new ElementReader(xreader); Object value = type.readObject(reader, getContext()); assertEquals(JaxbTestEnum.VALUE1, value); }