private void bareStartTag(XMLSerializer w, Name tagName, Object peer) throws IOException, XMLStreamException, SAXException { w.startElement(tagName,peer); w.endNamespaceDecls(peer); w.endAttributes(); }
private void handleMissingObjectError(String fieldName) throws SAXException, IOException, XMLStreamException { reportMissingObjectError(fieldName); // as a marshaller, we should be robust, so we'll continue to marshal // this document by skipping this missing object. endNamespaceDecls(null); endAttributes(); }
public void serializeItem(JaxBeanInfo bi, ItemT item, XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException { xducer.declareNamespace(item,w); w.endNamespaceDecls(item); w.endAttributes(); // this is leaf, so by definition there's no type substitution // if there's, we'll be using ArrayElementNodeProperty xducer.writeText(w,item,fieldName); } }
/** * Short for the following call sequence: * * <pre> getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true); endNamespaceDecls(); attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true"); endAttributes(); * </pre> */ public final void writeXsiNilTrue() throws SAXException, IOException, XMLStreamException { getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true); endNamespaceDecls(null); attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true"); endAttributes(); }
@Override public void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException { w.startElement(tagName,null); declareNamespace(o,w); w.endNamespaceDecls(null); w.endAttributes(); xducer.writeText(w,acc.get(o),fieldName); w.endElement(); } }
serializer.endNamespaceDecls(null);
public void leafElement( Name tagName, String data, String fieldName ) throws SAXException, IOException, XMLStreamException { if(seenRoot) { textHasAlreadyPrinted = false; nse = nse.push(); out.beginStartTag(tagName); out.endStartTag(); if(data != null) try { out.text(data,false); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(Messages.ILLEGAL_CONTENT.format(fieldName, e.getMessage())); } out.endTag(tagName); nse = nse.pop(); } else { // root element has additional processing like xsi:schemaLocation, // so we need to go the slow way startElement(tagName,null); endNamespaceDecls(null); endAttributes(); try { out.text(data, false); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(Messages.ILLEGAL_CONTENT.format(fieldName, e.getMessage())); } endElement(); } }
if(child==null) { endNamespaceDecls(null); endAttributes(); cycleDetectionStack.pop(); reportError(fieldName,e); endNamespaceDecls(null); endAttributes(); cycleDetectionStack.pop(); endNamespaceDecls(child); beanInfo.serializeAttributes(child,this); endAttributes();
@Override public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException { ListT list = acc.get(o); if(list!=null) { if(xacc.useNamespace()) { w.startElement(tagName,null); xacc.declareNamespace(o,w); w.endNamespaceDecls(list); w.endAttributes(); xacc.writeText(w,o,fieldName); w.endElement(); } else { xacc.writeLeafElement(w, tagName, o, fieldName); } } }
public final void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException { ListT list = acc.get(o); if(list!=null) { if(wrapperTagName!=null) { w.startElement(wrapperTagName,null); w.endNamespaceDecls(list); w.endAttributes(); } serializeListBody(o,w,list); if(wrapperTagName!=null) w.endElement(); } else { // list is null if(isWrapperNillable) { w.startElement(wrapperTagName,null); w.writeXsiNilTrue(); w.endElement(); } // otherwise don't print the wrapper tag name } }
child = pushObject(child,fieldName); if(child==null) { // error recovery endNamespaceDecls(null); endAttributes(); return; endNamespaceDecls(null); endAttributes(); return; // recover by ignore endNamespaceDecls(child); if(!asExpected) { attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"type",
public void leafElement( Name tagName, Pcdata data, String fieldName ) throws SAXException, IOException, XMLStreamException { if(seenRoot) { textHasAlreadyPrinted = false; nse = nse.push(); out.beginStartTag(tagName); out.endStartTag(); if(data != null) out.text(data,false); out.endTag(tagName); nse = nse.pop(); } else { // root element has additional processing like xsi:schemaLocation, // so we need to go the slow way startElement(tagName,null); endNamespaceDecls(null); endAttributes(); out.text(data,false); endElement(); } }
if(bi.jaxbType==Void.class || bi.jaxbType==void.class) { serializer.endNamespaceDecls(null); serializer.endAttributes(); } else { // normal cases
private void handleMissingObjectError(String fieldName) throws SAXException, IOException, XMLStreamException { reportMissingObjectError(fieldName); // as a marshaller, we should be robust, so we'll continue to marshal // this document by skipping this missing object. endNamespaceDecls(null); endAttributes(); }
private void bareStartTag(XMLSerializer w, Name tagName, Object peer) throws IOException, XMLStreamException, SAXException { w.startElement(tagName,peer); w.endNamespaceDecls(peer); w.endAttributes(); }
public void serializeItem(JaxBeanInfo bi, ItemT item, XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException { xducer.declareNamespace(item,w); w.endNamespaceDecls(item); w.endAttributes(); // this is leaf, so by definition there's no type substitution // if there's, we'll be using ArrayElementNodeProperty xducer.writeText(w,item,fieldName); } }
/** * Short for the following call sequence: * * <pre> getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true); endNamespaceDecls(); attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true"); endAttributes(); * </pre> */ public final void writeXsiNilTrue() throws SAXException, IOException, XMLStreamException { getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true); endNamespaceDecls(null); attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true"); endAttributes(); }
@Override public void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException { w.startElement(tagName,null); declareNamespace(o,w); w.endNamespaceDecls(null); w.endAttributes(); xducer.writeText(w,acc.get(o),fieldName); w.endElement(); } }
@Override public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException { ListT list = acc.get(o); if(list!=null) { if(xacc.useNamespace()) { w.startElement(tagName,null); xacc.declareNamespace(o,w); w.endNamespaceDecls(list); w.endAttributes(); xacc.writeText(w,o,fieldName); w.endElement(); } else { xacc.writeLeafElement(w, tagName, o, fieldName); } } }
public void leafElement( Name tagName, Pcdata data, String fieldName ) throws SAXException, IOException, XMLStreamException { if(seenRoot) { textHasAlreadyPrinted = false; nse = nse.push(); out.beginStartTag(tagName); out.endStartTag(); if(data != null) out.text(data,false); out.endTag(tagName); nse = nse.pop(); } else { // root element has additional processing like xsi:schemaLocation, // so we need to go the slow way startElement(tagName,null); endNamespaceDecls(null); endAttributes(); out.text(data,false); endElement(); } }