gpt4 book ai didi

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

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

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

XMLSerializer.endNamespaceDecls介绍

暂无

代码示例

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

private void bareStartTag(XMLSerializer w, Name tagName, Object peer) throws IOException, XMLStreamException, SAXException {
  w.startElement(tagName,peer);
  w.endNamespaceDecls(peer);
  w.endAttributes();
}

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

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();
}

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

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

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

/**
 * 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();
}

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

@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();
  }
}

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

serializer.endNamespaceDecls(null);

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

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();
  }
}

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

if(child==null) {
  endNamespaceDecls(null);
  endAttributes();
  cycleDetectionStack.pop();
  reportError(fieldName,e);
  endNamespaceDecls(null);
  endAttributes();
  cycleDetectionStack.pop();
endNamespaceDecls(child);
beanInfo.serializeAttributes(child,this);
endAttributes();

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

@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);
    }
  }
}

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

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

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

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",

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

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();
  }
}

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

if(bi.jaxbType==Void.class || bi.jaxbType==void.class) {
  serializer.endNamespaceDecls(null);
  serializer.endAttributes();
} else { // normal cases

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

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();
}

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

private void bareStartTag(XMLSerializer w, Name tagName, Object peer) throws IOException, XMLStreamException, SAXException {
  w.startElement(tagName,peer);
  w.endNamespaceDecls(peer);
  w.endAttributes();
}

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

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

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

/**
 * 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();
}

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

@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();
  }
}

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

@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);
    }
  }
}

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

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();
  }
}

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