@Override public void write(OutputNode node, VectorClock value) throws Exception { node.setValue(value.toString()); } }
@Override public void write(OutputNode node, FileContent.FileChecksum value) throws Exception { node.setValue(value.toString()); } }
@Override public void write(OutputNode node, PartialFileHistory.FileHistoryId value) throws Exception { node.setValue(value.toString()); } }
@Override public void write(final OutputNode node, final String value) { node.setValue(value); } }
@Override public void write(final OutputNode node, final String value) { node.setValue(value); } }
@Override public void write(OutputNode outputNode, Date date) throws Exception { outputNode.setValue(Helpers.fromDate(date)); } }
@Override public void write(OutputNode outputNode, UUID uuid) throws Exception { outputNode.setValue(Helpers.base64FromUuid(uuid)); } }
@Override public void write(OutputNode outputNode, Boolean bool) throws Exception { outputNode.setValue(Helpers.fromBoolean(bool)); } }
public class ByteArrayConverter implements Converter<ByteArrayWrapper> { @Override public ByteArrayWrapper read(InputNode node) throws Exception { InputNode nextnode = node.getNext(); return new ByteArrayWrapper(Base64.decode(nextnode.getValue())); } public void write(OutputNode node, ByteArrayWrapper byteArray) throws Exception { OutputNode byteArrayNode = node.getChild("byteArray"); byteArrayNode.setValue(Base64.encode(byteArray.getByteArray(), false)); } }
/** * This <code>write</code> method will serialize the contents of * the provided object to the given XML element. This will use * the <code>String.valueOf</code> method to convert the object to * a string if the object represents a primitive, if however the * object represents an enumerated type then the text value is * created using <code>Enum.name</code>. * * @param source this is the object to be serialized * @param node this is the XML element to have its text set */ public void write(OutputNode node, Object source) throws Exception { String text = factory.getText(source); if(text != null) { node.setValue(text); } } }
/** * This <code>write</code> method will serialize the contents of * the provided object to the given XML element. This will use * the <code>String.valueOf</code> method to convert the object to * a string if the object represents a primitive, if however the * object represents an enumerated type then the text value is * created using <code>Enum.name</code>. * * @param source this is the object to be serialized * @param node this is the XML element to have its text set */ public void write(OutputNode node, Object source) throws Exception { String text = factory.getText(source); if(text != null) { node.setValue(text); } } }
/** * This <code>write</code> method will serialize the contents of * the provided object to the given XML element. This will use * the <code>String.valueOf</code> method to convert the object to * a string if the object represents a primitive, if however the * object represents an enumerated type then the text value is * created using <code>Enum.name</code>. * * @param source this is the object to be serialized * @param node this is the XML element to have its text set */ public void write(OutputNode node, Object source) throws Exception { String text = factory.getText(source); if(text != null) { node.setValue(text); } } }
public static void write(OutputNode parent, Element domElement) throws Exception { OutputNode child = parent.getChild(domElement.getNodeName()); child.getNamespaces().setReference(domElement.getNamespaceURI(), domElement.getPrefix()); child.setValue(domElement.getTextContent()); child.commit(); } }
@Override public boolean write(Object source, Class type, OutputNode output, XmlWriteContext context) { try { output.setValue(transformer.write(source, type)); return true; } catch (Exception exception) { throw new XmlPersisterException(exception); } }
@Override public void write(OutputNode outputNode, KeePassFile.ByteArray bytes) throws Exception { outputNode.setValue(Helpers.encodeBase64Content(bytes.getContent(), false)); } }
/** * This write method is used to set the value of the provided object * as the text for the XML element. This will acquire the string * value of the object using <code>toString</code> only if the * object provided is not an enumerated type. If the object is an * enumerated type then the <code>Enum.name</code> method is used. * * @param value this is the value to set as the XML element text * @param node this is the XML element to write the text value to * @param label the label that contains the contact details */ private void writeText(OutputNode node, Object value, Label label) throws Exception { if(value != null && !label.isTextList()) { String text = factory.getText(value); boolean data = label.isData(); node.setData(data); node.setValue(text); } }
/** * This write method is used to set the value of the provided object * as the text for the XML element. This will acquire the string * value of the object using <code>toString</code> only if the * object provided is not an enumerated type. If the object is an * enumerated type then the <code>Enum.name</code> method is used. * * @param value this is the value to set as the XML element text * @param node this is the XML element to write the text value to * @param label the label that contains the contact details */ private void writeText(OutputNode node, Object value, Label label) throws Exception { if(value != null && !label.isTextList()) { String text = factory.getText(value); boolean data = label.isData(); node.setData(data); node.setValue(text); } }
/** * This write method is used to set the value of the provided object * as the text for the XML element. This will acquire the string * value of the object using <code>toString</code> only if the * object provided is not an enumerated type. If the object is an * enumerated type then the <code>Enum.name</code> method is used. * * @param value this is the value to set as the XML element text * @param node this is the XML element to write the text value to * @param label the label that contains the contact details */ private void writeText(OutputNode node, Object value, Label label) throws Exception { if(value != null && !label.isTextList()) { String text = factory.getText(value); boolean data = label.isData(); node.setData(data); node.setValue(text); } }