Package com.sun.xml.bind.v2.runtime

Examples of com.sun.xml.bind.v2.runtime.XMLSerializer


/*     */
/* 102 */     if (list == null) {
/* 103 */       return null;
/*     */     }
/* 105 */     StringBuilder buf = new StringBuilder();
/* 106 */     XMLSerializer w = XMLSerializer.getInstance();
/* 107 */     ListIterator itr = this.lister.iterator(list, w);
/*     */
/* 109 */     while (itr.hasNext()) {
/*     */       try {
/* 111 */         Object item = itr.next();
/* 112 */         if (item != null) {
/* 113 */           if (buf.length() > 0) buf.append(' ');
/* 114 */           buf.append(this.xducer.print(item));
/*     */         }
/*     */       } catch (JAXBException e) {
/* 117 */         w.reportError(null, e);
/*     */       }
/*     */     }
/* 120 */     return buf.toString();
/*     */   }
View Full Code Here


/*     */
/*     */     public String print(BeanT bean) throws AccessorException, SAXException {
/* 279 */       Object target = this.acc.get(bean);
/* 280 */       if (target == null) return null;
/*     */
/* 282 */       XMLSerializer w = XMLSerializer.getInstance();
/*     */       try {
/* 284 */         String id = w.grammar.getBeanInfo(target, true).getId(target, w);
/* 285 */         if (id == null)
/* 286 */           w.errorMissingId(target);
/* 287 */         return id;
/*     */       } catch (JAXBException e) {
/* 289 */         w.reportError(null, e);
/* 290 */       }return null;
/*     */     }
View Full Code Here

        public String print(BeanT bean) throws AccessorException, SAXException {
            TargetT target = acc.get(bean);
            if(target==null)    return null;
           
            XMLSerializer w = XMLSerializer.getInstance();
            try {
                String id = w.grammar.getBeanInfo(target,true).getId(target,w);
                if(id==null)
                    w.errorMissingId(target);
                return id;
            } catch (JAXBException e) {
                w.reportError(null,e);
                return null;
            }
        }
View Full Code Here

        if(list==null)
            return null;

        StringBuilder buf = new StringBuilder();
        XMLSerializer w = XMLSerializer.getInstance();
        ListIterator<ItemT> itr = lister.iterator(list, w);

        while(itr.hasNext()) {
            try {
                ItemT item = itr.next();
                if (item != null) {
                    if(buf.length()>0buf.append(' ');
                    buf.append(xducer.print(item));
                }
            } catch (JAXBException e) {
                w.reportError(null,e);
            }
        }
        return buf.toString();
    }
View Full Code Here

        public String print(BeanT bean) throws AccessorException, SAXException {
            TargetT target = acc.get(bean);
            if(target==null)    return null;
           
            XMLSerializer w = XMLSerializer.getInstance();
            try {
                String id = w.grammar.getBeanInfo(target,true).getId(target,w);
                if(id==null)
                    w.errorMissingId(target);
                return id;
            } catch (JAXBException e) {
                w.reportError(null,e);
                return null;
            }
        }
View Full Code Here

    public synchronized Encoded[] getUTF8NameTable() {
        if(utf8nameTable==null) {
            Encoded[] x = new Encoded[nameList.localNames.length];
            for( int i=0; i<x.length; i++ ) {
                Encoded e = new Encoded(nameList.localNames[i]);
                e.compact();
                x[i] = e;
            }
            utf8nameTable = x;
        }
        return utf8nameTable;
View Full Code Here

            return null;

        ClassBeanInfoImpl cb = (ClassBeanInfoImpl) bi;
        for (Property p : cb.properties) {
            if (p instanceof AttributeProperty) {
                AttributeProperty ap = (AttributeProperty) p;
                if(ap.attName.equals(WellKnownNamespace.XML_MIME_URI,"contentType"))
                    try {
                        return (String)ap.xacc.print(o);
                    } catch (AccessorException e) {
                        return null;
View Full Code Here

        startElement(attributeName);
    }

    private RuntimePropertyInfo getCurrentElementRuntimePropertyInfo() {
        final XMLSerializer xs = XMLSerializer.getInstance();
        final Property cp = (xs == null) ? null : xs.getCurrentProperty();
        return (cp == null) ? null : cp.getInfo();
    }
View Full Code Here

        Collection<? extends RuntimePropertyInfo> ps = ci.getProperties();
        this.properties = new Property[ps.size()];
        int idx=0;
        boolean elementOnly = true;
        for( RuntimePropertyInfo info : ps ) {
            Property p = PropertyFactory.create(owner,info);
            if(info.id()==ID.ID)
                idProperty = p;
            properties[idx++] = p;
            elementOnly &= info.elementOnlyContent();
            checkOverrideProperties(p);
View Full Code Here

        // create a list of attribute/URI handlers
        List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
        List<Property> uriProps = new FinalArrayList<Property>();
        for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
            for (int i = 0; i < bi.properties.length; i++) {
                Property p = bi.properties[i];
                if(p instanceof AttributeProperty)
                    attProps.add((AttributeProperty) p);
                if(p.hasSerializeURIAction())
                    uriProps.add(p);
            }
        }
        if(grammar.c14nSupport)
            Collections.sort(attProps);
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.runtime.XMLSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.