@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof XMLObject)) { return false; } XMLObject oxo = (XMLObject)o; boolean idsEqual = id == null ? oxo.getId() == null : id.equals(oxo.getId()); boolean encodingsEqual = encoding == null ? oxo.getEncoding() == null : encoding.equals(oxo.getEncoding()); boolean mimeTypesEqual = mimeType == null ? oxo.getMimeType() == null : mimeType.equals(oxo.getMimeType()); return idsEqual && encodingsEqual && mimeTypesEqual && equalsContent(getXmlObjectContent(oxo)); }
public static void marshal(XmlWriter xwriter, XMLObject xmlObj, String dsPrefix, XMLCryptoContext context) throws MarshalException { xwriter.writeStartElement(dsPrefix, "Object", XMLSignature.XMLNS); // set attributes xwriter.writeIdAttribute("", "", "Id", xmlObj.getId()); xwriter.writeAttribute("", "", "MimeType", xmlObj.getMimeType()); xwriter.writeAttribute("", "", "Encoding", xmlObj.getEncoding()); // create and append any elements and mixed content, if necessary @SuppressWarnings("unchecked") List<XMLStructure> content = xmlObj.getContent(); for (XMLStructure object : content) { xwriter.marshalStructure(object, dsPrefix, context); } xwriter.writeEndElement(); // "Object" }