- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType()
方法的一些代码示例,展示了XMLSerializer.childAsXsiType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLSerializer.childAsXsiType()
方法的具体详情如下:
包路径:com.sun.xml.bind.v2.runtime.XMLSerializer
类名称:XMLSerializer
方法名:childAsXsiType
[英]This method is called when a type child object is found.
This method produces events of the following form:
NSDECL* "endNamespaceDecls" ATTRIBUTE* "endAttributes" BODY
optionally including @xsi:type if necessary.
[中]
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
public void serializeItem(JaxBeanInfo expected, ItemT item, XMLSerializer w) throws SAXException, IOException, XMLStreamException {
if(item==null) {
w.writeXsiNilTrue();
} else {
w.childAsXsiType(item,fieldName,expected, false);
}
}
}
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
public void serializeBody(Object array, XMLSerializer target) throws SAXException, IOException, XMLStreamException {
int len = Array.getLength(array);
for( int i=0; i<len; i++ ) {
Object item = Array.get(array,i);
// TODO: check the namespace URI.
target.startElement("","item",null,null);
if(item==null) {
target.writeXsiNilTrue();
} else {
target.childAsXsiType(item,"arrayItem",itemBeanInfo, false);
}
target.endElement();
}
}
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
public void marshal(T value, XMLSerializer out) throws IOException, SAXException, XMLStreamException {
out.startElement(tagName,null);
if(value==null) {
out.writeXsiNilTrue();
} else {
out.childAsXsiType(value,null,bi,false);
}
out.endElement();
}
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
w.childAsXsiType(v,fieldName,w.grammar.getBeanInfo(Object.class), addNilDecl && nillable);
} else {
w.startElement(tt.tagName,null);
w.childAsXsiType(v,fieldName,tt.beanInfo, addNilDecl && nillable);
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
@Override
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
ValueT v = acc.get(o);
if(v!=null) {
bareStartTag(w,tagName,v);
for( Map.Entry e : (Set<Map.Entry>)v.entrySet() ) {
bareStartTag(w,entryTag,null);
Object key = e.getKey();
if(key!=null) {
w.startElement(keyTag,key);
w.childAsXsiType(key,fieldName,keyBeanInfo, false);
w.endElement();
}
Object value = e.getValue();
if(value!=null) {
w.startElement(valueTag,value);
w.childAsXsiType(value,fieldName,valueBeanInfo, false);
w.endElement();
}
w.endElement();
}
w.endElement();
} else
if(nillable) {
w.startElement(tagName,null);
w.writeXsiNilTrue();
w.endElement();
}
}
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
w.childAsXsiType(item,fieldName,w.grammar.getBeanInfo(Object.class), false);
} else {
w.startElement(tt.tagName,null);
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
target.writeXsiNilTrue();
} else {
target.childAsXsiType(value,"value",tbi, false);
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
@Override
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
boolean hasValue = xacc.hasValue(o);
Object obj = null;
try {
obj = acc.getUnadapted(o);
} catch (AccessorException ae) {
; // noop
}
Class valueType = acc.getValueType();
// check for different type than expected. If found, add xsi:type declaration
if (xsiTypeNeeded(o, w, obj, valueType)) {
w.startElement(tagName, outerPeer);
w.childAsXsiType(obj, fieldName, w.grammar.getBeanInfo(valueType), false);
w.endElement();
} else { // current type is expected
if (hasValue) {
xacc.writeLeafElement(w, tagName, o, fieldName);
} else if (nillable) {
w.startElement(tagName, null);
w.writeXsiNilTrue();
w.endElement();
}
}
}
代码示例来源:origin: com.sun.xml.bind/jaxb-impl
serializer.writeXsiNilTrue();
else
serializer.childAsXsiType(obj,"root",bi, false);
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
public void serializeItem(JaxBeanInfo expected, ItemT item, XMLSerializer w) throws SAXException, IOException, XMLStreamException {
if(item==null) {
w.writeXsiNilTrue();
} else {
w.childAsXsiType(item,fieldName,expected, false);
}
}
}
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
public void serializeBody(Object array, XMLSerializer target) throws SAXException, IOException, XMLStreamException {
int len = Array.getLength(array);
for( int i=0; i<len; i++ ) {
Object item = Array.get(array,i);
// TODO: check the namespace URI.
target.startElement("","item",null,null);
if(item==null) {
target.writeXsiNilTrue();
} else {
target.childAsXsiType(item,"arrayItem",itemBeanInfo, false);
}
target.endElement();
}
}
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
public void marshal(T value, XMLSerializer out) throws IOException, SAXException, XMLStreamException {
out.startElement(tagName,null);
if(value==null) {
out.writeXsiNilTrue();
} else {
out.childAsXsiType(value,null,bi,false);
}
out.endElement();
}
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
w.childAsXsiType(v,fieldName,w.grammar.getBeanInfo(Object.class), addNilDecl && nillable);
} else {
w.startElement(tt.tagName,null);
w.childAsXsiType(v,fieldName,tt.beanInfo, addNilDecl && nillable);
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
@Override
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
ValueT v = acc.get(o);
if(v!=null) {
bareStartTag(w,tagName,v);
for( Map.Entry e : (Set<Map.Entry>)v.entrySet() ) {
bareStartTag(w,entryTag,null);
Object key = e.getKey();
if(key!=null) {
w.startElement(keyTag,key);
w.childAsXsiType(key,fieldName,keyBeanInfo, false);
w.endElement();
}
Object value = e.getValue();
if(value!=null) {
w.startElement(valueTag,value);
w.childAsXsiType(value,fieldName,valueBeanInfo, false);
w.endElement();
}
w.endElement();
}
w.endElement();
} else
if(nillable) {
w.startElement(tagName,null);
w.writeXsiNilTrue();
w.endElement();
}
}
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
w.childAsXsiType(item,fieldName,w.grammar.getBeanInfo(Object.class), false);
} else {
w.startElement(tt.tagName,null);
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
target.writeXsiNilTrue();
} else {
target.childAsXsiType(value,"value",tbi, false);
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
@Override
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException {
boolean hasValue = xacc.hasValue(o);
Object obj = null;
try {
obj = acc.getUnadapted(o);
} catch (AccessorException ae) {
; // noop
}
Class valueType = acc.getValueType();
// check for different type than expected. If found, add xsi:type declaration
if (xsiTypeNeeded(o, w, obj, valueType)) {
w.startElement(tagName, outerPeer);
w.childAsXsiType(obj, fieldName, w.grammar.getBeanInfo(valueType), false);
w.endElement();
} else { // current type is expected
if (hasValue) {
xacc.writeLeafElement(w, tagName, o, fieldName);
} else if (nillable) {
w.startElement(tagName, null);
w.writeXsiNilTrue();
w.endElement();
}
}
}
代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime
serializer.writeXsiNilTrue();
else
serializer.childAsXsiType(obj,"root",bi, false);
代码示例来源:origin: apache/servicemix-bundles
public void serializeItem(JaxBeanInfo expected, ItemT item, XMLSerializer w) throws SAXException, IOException, XMLStreamException {
if(item==null) {
w.writeXsiNilTrue();
} else {
w.childAsXsiType(item,fieldName,expected, false);
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl
public void marshal(T value, XMLSerializer out) throws IOException, SAXException, XMLStreamException {
out.startElement(tagName,null);
if(value==null) {
out.writeXsiNilTrue();
} else {
out.childAsXsiType(value,null,bi,false);
}
out.endElement();
}
在 JRE 中,Sun 的内部包以 2 个顶级域(sun 和 com)为前缀。例如, com.sun.security.jgss sun.security.jgss 他们选择哪个前缀对我来说似乎很随机
我最近从 Java 8 迁移到了 Java 11。对于 jax.ws 我必须向我的 pom.xml 添加以下外部依赖项,因为它在 Java 11 中不再可用。但是,我遇到了一些论点,即 com.sun
奇怪的是,以下 C++ 程序在 Sun Studio 10 上编译时没有针对 undefined variable 产生警告: int main() { return sun; } sun的值好像
在使用 jhat 分析堆转储时,我观察到创建了许多 DelegatingClassLoader 实例,尽管它们没有在代码中显式调用。我希望这是某种反射优化机制。有人知道细节吗? 最佳答案 是的,这可能
我正在使用 Web 服务在 Android 应用程序和 SOAP Web 服务之间发送数据。此 Web 服务仅接受序列化对象,而执行此操作的唯一方法是使用: import sun.misc.BASE6
我正在将 JDK 版本从 8 更新到 11,以解决某些并发数据结构的问题。 error: type Contended is not a member of package sun.misc [ERR
尝试在两台不同的 Ubuntu 计算机上运行 Android Studio 2.2.3 时,我不断收到此错误。一个运行 14.04 Trusty,另一个运行 16.04 Xenial。 它运行初始屏幕
我有一个具有以下特征的 J2EE 项目: CDI 1.0 Dynamic Web Module 3.0 Java 1.7 (it's being changed to 1.8) JSF 2.0 JPA
JSF 2 的 Mojarra 实现具有以下上下文参数: com.sun.faces.numberOfViewsInSession(默认为 15) com.sun.faces.numberOfLogi
我们有一些代码在使用这个旧的内部 Sun 包来处理图像,本质上是在从输入流中读取/解码后将 JPEG 编码为特定的大小和质量。下面的代码示例。我将不胜感激使用适当的 java.* 或 javax.*
在 go 语言中 spec他们在其中一个示例中使用了三个点: days := [...]string{"Sat", "Sun"} // len(days) == 2 如果省略这三个点有什么不同吗?
我正在使用 jersey 客户端 进行休息调用。我的代码的导入是: import com.sun.jersey.api.client.Client; import com.sun.jersey.api
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 9 年前。 Improve
我们的一个插件需要安装 JDK,而不仅仅是 JRE。我们需要 com.sun.javadoc 和 tools.jar 中的 friend 。我认为 Sun 的许可证不允许重新分发 tools.jar(
起初,我想说这个问题还有其他主题,但我尝试了解决方案,但对我不起作用。 我解释我的问题。我开始在我的电脑上用 Maven 开发一个 Javafx 项目。在这台计算机中,SDK java 是 10。 现
当我这样做时,我收到以下错误 mvn clean deploy -DperformRelease=true [ERROR] Exit code: 1 - .java:3: package javax.
情况: (1) 我正在使用 Android Studio 4.1 并尝试构建示例 Android 应用程序 (2) 我支持代理和代理设置工作正常,因为我能够下载和安装 SDK 我收到以下错误:我尝试了
我在 Linux 上使用 openJDK 11 运行 junit 测试并收到以下错误: java.lang.ClassCastException: class sun.font.CompositeFo
我正在使用 selenium 库进行测试。但下面的代码给了我类转换异常。我已经用谷歌搜索了这个异常,但没有得到解决方案。我对 Https 连接和 http 连接感到困惑。帮我解决这个异常。谢谢 imp
有人知道什么可能导致主题错误吗?我发现了另一个帖子 Enunciate Issue = Assembling the enunciate app. com.sun.tools.apt.mirror.t
我是一名优秀的程序员,十分优秀!