public Object getAttributeValue(Object o, MarshallingContext ctx, String namespaceURI, String localName) { boolean optional = ctx == null ? ignoreNotFoundField : !ctx.isAttributeRequired() || ignoreNotFoundField; return getJavaValue(namespaceURI, localName, null, o, false, optional); }
public Object getElementValue(Object o, MarshallingContext ctx, String namespaceURI, String localName) { Object value; if(writeAsValue(o.getClass())) { value = o; } else { String fieldName = null; if(ctx != null && ctx.isTypeComplex()) { // this is how it should be fieldName = ctx.getSimpleContentProperty(); } // this is a hack for soap enc try { value = getJavaValue(namespaceURI, localName, fieldName, o, false, false); } catch(JBossXBRuntimeException e) { value = getJavaValue(namespaceURI, localName, null, o, false, ignoreNotFoundField); } } return value; }
public void marshal(MarshallingContext ctx, Object o) { if (o == null) { return; } Element e = (Element)o; ContentHandler ch = ctx.getContentHandler(); try { Dom2Sax.dom2sax(e, ch); } catch (SAXException e1) { throw NativeMessages.MESSAGES.failedToMarshalDOMElement(new QName(e.getNamespaceURI(), e.getLocalName()), e1); } } };