public void writeObject(XmlOutputStream out, TypeInfo info, Object value, boolean isSet) throws IOException { if (!isSet && info.getMinOcc() == 0) { return; } if (value == null) { writeNull(out, info); return; } if (info.getMaxOcc() == 1) { writeSingleObject(out, info, value); } else { writeArrayObject(out, info, value); } }
public void writeObject(XmlOutputStream out, TypeInfo info, Object value, boolean isSet) throws IOException { if (!isSet && info.getMinOcc() == 0) { return; } if (value == null) { writeNull(out, info); return; } if (info.getMaxOcc() == 1) { writeSingleObject(out, info, value); } else { writeArrayObject(out, info, value); } }
private void writeSimpleType(XmlOutputStream out, TypeInfo info, String value, boolean isSet, String javaType) throws IOException { if (!isSet && info.getMinOcc() == 0) { return; } if (value == null) { writeNull(out, info); } else { out.writeStartTag(getNamespace(info), info.getName()); if (writeFieldXsiType) { writeXsiType(out, info.getTypeNS(), info.getType()); } else { if ("anyType".equals(info.getType()) && Constants.SCHEMA_NS.equals(info.getTypeNS())) { QName xmlType = getXmlType(javaType); if (xmlType == null) { throw new IOException("Failed to find xml type for java type: " + javaType); } writeXsiType(out, xmlType.getNamespaceURI(), xmlType.getLocalPart()); } } out.writeText(value); out.writeEndTag(getNamespace(info), info.getName()); } }
private void writeSimpleType(XmlOutputStream out, TypeInfo info, String value, boolean isSet, String javaType) throws IOException { if (!isSet && info.getMinOcc() == 0) { return; } if (value == null) { writeNull(out, info); } else { out.writeStartTag(getNamespace(info), info.getName()); if (writeFieldXsiType) { writeXsiType(out, info.getTypeNS(), info.getType()); } else { if ("anyType".equals(info.getType()) && Constants.SCHEMA_NS.equals(info.getTypeNS())) { QName xmlType = getXmlType(javaType); if (xmlType == null) { throw new IOException("Failed to find xml type for java type: " + javaType); } writeXsiType(out, xmlType.getNamespaceURI(), xmlType.getLocalPart()); } } out.writeText(value); out.writeEndTag(getNamespace(info), info.getName()); } }