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

The following examples show how to use com.sun.xml.internal.bind.v2.runtime.XMLSerializer#writeDom() . 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: ArrayReferenceNodeProperty.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 2
Source File: SingleReferenceNodeProperty.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 3
Source File: ArrayReferenceNodeProperty.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 4
Source File: SingleReferenceNodeProperty.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 5
Source File: ArrayReferenceNodeProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 6
Source File: SingleReferenceNodeProperty.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 7
Source File: ArrayReferenceNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 8
Source File: SingleReferenceNodeProperty.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 9
Source File: ArrayReferenceNodeProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 10
Source File: SingleReferenceNodeProperty.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 11
Source File: ArrayReferenceNodeProperty.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 12
Source File: SingleReferenceNodeProperty.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 13
Source File: ArrayReferenceNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 14
Source File: SingleReferenceNodeProperty.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}
 
Example 15
Source File: ArrayReferenceNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected final void serializeListBody(BeanT o, XMLSerializer w, ListT list) throws IOException, XMLStreamException, SAXException {
    ListIterator<ItemT> itr = lister.iterator(list, w);

    while(itr.hasNext()) {
        try {
            ItemT item = itr.next();
            if (item != null) {
                if(isMixed && item.getClass()==String.class) {
                    w.text((String)item,null);
                } else {
                    JaxBeanInfo bi = w.grammar.getBeanInfo(item,true);
                    if(bi.jaxbType==Object.class && domHandler!=null)
                        // even if 'v' is a DOM node, it always derive from Object,
                        // so the getBeanInfo returns BeanInfo for Object
                        w.writeDom(item,domHandler,o,fieldName);
                    else
                        bi.serializeRoot(item,w);
                }
            }
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this item
        }
    }
}
 
Example 16
Source File: SingleReferenceNodeProperty.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
    ValueT v = acc.get(o);
    if(v!=null) {
        try {
            JaxBeanInfo bi = w.grammar.getBeanInfo(v,true);
            if(bi.jaxbType==Object.class && domHandler!=null)
                // even if 'v' is a DOM node, it always derive from Object,
                // so the getBeanInfo returns BeanInfo for Object
                w.writeDom(v,domHandler,o,fieldName);
            else
                bi.serializeRoot(v,w);
        } catch (JAXBException e) {
            w.reportError(fieldName,e);
            // recover by ignoring this property
        }
    }
}