简体   繁体   English

为XmlObject提供参数SchemaType

[英]Provide parameter SchemaType for XmlObject

I have a class like 我有一个像

public class CreditCardDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements creditcard.CreditCardDocument
{

   public CreditCardDocumentImpl(org.apache.xmlbeans.SchemaType sType)
   {
       super(sType);
   }
}

That class is implementing "CreditCardDocument" interface. 该类正在实现“ CreditCardDocument”接口。

The interface is like 界面就像

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

Now, if I want to access that constructor as 现在,如果我想访问该构造函数

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

It throws as error, 它抛出错误,

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? 我需要传递给构造函数的参数是什么?

Did you generate these classes through CXF using XmlBeans? 您是否使用XmlBeans通过CXF生成了这些类? 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();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM