gpt4 book ai didi

com.sun.xml.bind.v2.runtime.XMLSerializer.text()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 21:03:05 26 4
gpt4 key购买 nike

本文整理了Java中com.sun.xml.bind.v2.runtime.XMLSerializer.text()方法的一些代码示例,展示了XMLSerializer.text()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLSerializer.text()方法的具体详情如下:
包路径:com.sun.xml.bind.v2.runtime.XMLSerializer
类名称:XMLSerializer
方法名:text

XMLSerializer.text介绍

[英]The #text(String,String) method that takes Pcdata.
[中]获取Pcdata的#text(String,String)方法。

代码示例

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

@Override
public final void writeText(XMLSerializer w, String o, String fieldName) throws IOException, SAXException, XMLStreamException {
  w.text(o, fieldName);
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

private void flushText() throws SAXException, IOException, XMLStreamException {
  if( text.length()!=0 ) {
    serializer.text(text.toString(),null);
    text.setLength(0);
  }
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public void writeText(XMLSerializer w, T o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException {
    w.text(print(o),fieldName);
  }
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public void writeText(XMLSerializer w, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException {
  w.text(print(o),fieldName);
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public final void writeText(XMLSerializer w, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException {
  w.text(print(o),fieldName);
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

public void serializeBody(Object element, XMLSerializer target) throws SAXException, IOException, XMLStreamException {
  NodeList childNodes = ((Element)element).getChildNodes();
  int len = childNodes.getLength();
  for( int i=0; i<len; i++ ) {
    Node child = childNodes.item(i);
    switch(child.getNodeType()) {
    case Node.CDATA_SECTION_NODE:
    case Node.TEXT_NODE:
      target.text(child.getNodeValue(),null);
      break;
    case Node.ELEMENT_NODE:
      target.writeDom((Element)child,domHandler,null,null);
      break;
    }
  }
}

代码示例来源:origin: com.sun.xml.bind/jaxb-impl

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
    }
  }
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

@Override
public final void writeText(XMLSerializer w, String o, String fieldName) throws IOException, SAXException, XMLStreamException {
  w.text(o, fieldName);
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

private void flushText() throws SAXException, IOException, XMLStreamException {
  if( text.length()!=0 ) {
    serializer.text(text.toString(),null);
    text.setLength(0);
  }
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public void writeText(XMLSerializer w, T o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException {
    w.text(print(o),fieldName);
  }
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public void writeText(XMLSerializer w, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException {
  w.text(print(o),fieldName);
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public final void writeText(XMLSerializer w, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException {
  w.text(print(o),fieldName);
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

public void serializeBody(Object element, XMLSerializer target) throws SAXException, IOException, XMLStreamException {
  NodeList childNodes = ((Element)element).getChildNodes();
  int len = childNodes.getLength();
  for( int i=0; i<len; i++ ) {
    Node child = childNodes.item(i);
    switch(child.getNodeType()) {
    case Node.CDATA_SECTION_NODE:
    case Node.TEXT_NODE:
      target.text(child.getNodeValue(),null);
      break;
    case Node.ELEMENT_NODE:
      target.writeDom((Element)child,domHandler,null,null);
      break;
    }
  }
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

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
    }
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

private void flushText() throws SAXException, IOException, XMLStreamException {
  if( text.length()!=0 ) {
    serializer.text(text.toString(),null);
    text.setLength(0);
  }
}

代码示例来源:origin: apache/servicemix-bundles

private void flushText() throws SAXException, IOException, XMLStreamException {
  if( text.length()!=0 ) {
    serializer.text(text.toString(),null);
    text.setLength(0);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

public void writeText(XMLSerializer w, T o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException {
    w.text(print(o),fieldName);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

public void writeText(XMLSerializer w, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException {
  w.text(print(o),fieldName);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

public final void writeText(XMLSerializer w, T o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException {
  w.text(print(o),fieldName);
}

代码示例来源:origin: apache/servicemix-bundles

public void writeText(XMLSerializer w, T o, String fieldName) throws AccessorException, SAXException, IOException, XMLStreamException {
    w.text(print(o),fieldName);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com