为XmlObject提供参数SchemaType

编程入门 行业动态 更新时间:2024-10-23 15:23:00
本文介绍了为XmlObject提供参数SchemaType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个类似

public class CreditCardDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements creditcard.CreditCardDocument { public CreditCardDocumentImpl(org.apache.xmlbeans.SchemaType sType) { super(sType); } }

该类正在实现"CreditCardDocument"接口.

That class is implementing "CreditCardDocument" interface.

界面就像

public interface CreditCardDocument extends org.apache.xmlbeans.XmlObject {

现在,如果我想以

CreditCardDocument creditCardDocument = new CreditCardDocumentImpl(CreditCardDocumentImpl.class.instanceType());

它抛出错误

groovy.lang.MissingMethodException: No signature of method: static creditcard.impl.CreditCardDocumentImpl.instanceType() is applicable for argument types: () values: []

我没有得到什么错误.我需要传递给构造函数的参数是什么?

I'm not getting what is the error. What could be the parameter that I need to pass to the constructor?

推荐答案

您是否使用XmlBeans通过CXF生成了这些类?如果是这样,则可能是您的界面提供了具有模式类型的公共静态属性,或者甚至更好,您可以尝试:

Did you generate these classes through CXF using XmlBeans? If so, probably your interface provides a public static property with the schema type, or even better, you can try:

CreditCardDocument creditCardDocument = CreditCardDocument.Factory.newInstance();

更多推荐

为XmlObject提供参数SchemaType

本文发布于:2023-11-25 12:07:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629680.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数   XmlObject   SchemaType

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!