Provide parameter SchemaType for XmlObject

早过忘川 提交于 2019-12-02 11:04:37

问题


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.

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?


回答1:


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


来源:https://stackoverflow.com/questions/27919772/provide-parameter-schematype-for-xmlobject

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!