Java Code Examples for com.sun.xml.internal.bind.v2.runtime.XMLSerializer#endNamespaceDecls()

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.XMLSerializer#endNamespaceDecls() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArrayERProperty.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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
    }
}
 
Example 2
Source File: ListElementProperty.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }
}
 
Example 3
Source File: ListElementProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }
}
 
Example 4
Source File: ArrayERProperty.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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
    }
}
 
Example 5
Source File: ArrayERProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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
    }
}
 
Example 6
Source File: ListElementProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }
}
 
Example 7
Source File: ArrayERProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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
    }
}
 
Example 8
Source File: ListElementProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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);
        }
    }
}
 
Example 9
Source File: ArrayERProperty.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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
    }
}
 
Example 10
Source File: TransducedAccessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example 11
Source File: ArrayElementLeafProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 12
Source File: ArrayElementLeafProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 13
Source File: ArrayElementLeafProperty.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 14
Source File: TransducedAccessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example 15
Source File: TransducedAccessor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example 16
Source File: TransducedAccessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example 17
Source File: TransducedAccessor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example 18
Source File: TransducedAccessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@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();
}
 
Example 19
Source File: SingleMapNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void bareStartTag(XMLSerializer w, Name tagName, Object peer) throws IOException, XMLStreamException, SAXException {
    w.startElement(tagName,peer);
    w.endNamespaceDecls(peer);
    w.endAttributes();
}
 
Example 20
Source File: SingleMapNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void bareStartTag(XMLSerializer w, Name tagName, Object peer) throws IOException, XMLStreamException, SAXException {
    w.startElement(tagName,peer);
    w.endNamespaceDecls(peer);
    w.endAttributes();
}