Code example for XmlSerializer

Methods: endTagflush

0
				XmlSerializer serializer = XML_SERIALIZER_FACTORY
						.newSerializer();
				serializer.setOutput(writer);
				serializer = serializer.startTag(null, contentType_QNAME);
				if (class1.equals(InviteConnectType.class)) {
					XppUtils.setElementValue(serializer,
							((InviteConnectType) value).value());
				} else if (class1.equals(NetworkUpdateReturnType.class)) {
					XppUtils.setElementValue(serializer,
							((NetworkUpdateReturnType) value).value());
				} else if (class1.equals(NetworkUpdateContentType.class)) {
					XppUtils.setElementValue(serializer,
							((NetworkUpdateContentType) value).value());
				} else { 
					XppUtils.setElementValue(serializer, String.valueOf(value));
				} 
				serializer.endTag(null, contentType_QNAME);
				serializer.flush();
			} catch (Exception e) {
				LOG.log(Level.SEVERE,
						"An error occurred while creating xml content.", e);
			} 
			return writer.toString();
Contextual code suggestions in your IDE  Get Codota for Java