org.apache.axis2.wsdl.template.java.TestObjectCreationTemplate.xsl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axis2-codegen Show documentation
Show all versions of axis2-codegen Show documentation
Axis2 Code Generation module
//Create the desired XmlObject and provide it as the test object
public org.apache.xmlbeans.XmlObject getTestObject(java.lang.Class type) throws java.lang.Exception{
java.lang.reflect.Method creatorMethod = null;
if (org.apache.xmlbeans.XmlObject.class.isAssignableFrom(type)){
Class[] declaredClasses = type.getDeclaredClasses();
for (int i = 0; i < declaredClasses.length; i++) {
Class declaredClass = declaredClasses[i];
if (declaredClass.getName().endsWith("$Factory")){
creatorMethod = declaredClass.getMethod("newInstance",null);
break;
}
}
}
if (creatorMethod!=null){
return (org.apache.xmlbeans.XmlObject)creatorMethod.invoke(null,null);
}else{
throw new java.lang.Exception("Creator not found!");
}
}
private get (
wrappedType){
return wrappedType.get ().xget Array();
return wrappedType.get ().xget ();
}
//Create an ADBBean and provide it as the test object
public org.apache.axis2.databinding.ADBBean getTestObject(java.lang.Class type) throws java.lang.Exception{
return (org.apache.axis2.databinding.ADBBean) type.newInstance();
}
private get (
wrappedType){
return wrappedType.get ().get ();
return wrappedType.get ();
}
private get (
wrappedType){
return wrappedType.get ();
}
private wrap (
innerType){
wrappedElement = new ();
wrappedElement.set (innerType);
return wrappedElement;
}
// create the desired object and provide it as the test object
public java.lang.Object getTestObject(java.lang.Class type) throws java.lang.Exception {
return type.newInstance();
}
//Create an object and provide it as the test object
public Object getTestObject(java.lang.Class type) throws java.lang.Exception{
return type.newInstance();
}
//Create an OMElement and provide it as the test object
public org.apache.axiom.om.OMElement getTestObject(java.lang.Object dummy){
org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
org.apache.axiom.om.OMNamespace defNamespace = factory.createOMNamespace("",null);
return org.apache.axiom.om.OMAbstractFactory.getOMFactory().createOMElement("test",defNamespace);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy