// if this headerfile not defined define it
this.writer.write("#if !defined(__"+classname.toUpperCase()+"_"+getFileType().toUpperCase()+"_H__INCLUDED_)\n");
this.writer.write("#define __"+classname.toUpperCase()+"_"+getFileType().toUpperCase()+"_H__INCLUDED_\n\n");
if (attribs.length != 1){
System.out.println("Array "+classname+" contains unexpected no of variables");
throw new WrapperFault("Array type "+classname+" contain unexpected no of types");
}
//include header file for the contained type
QName qname = WrapperUtils.getArrayType(type).getName();
if (!CUtils.isSimpleType(qname)){
// writer.write("#include \""+attribs[0].getTypeName()+".h\"\n\n");
/*
* Needed for self referenced array else compilation failed (include cycles).
* <xsd:complexType name="Type1">
* <xsd:sequence>
* <xsd:element name="followings" maxOccurs="unbounded" minOccurs="0" type="tns:Type1" />
* <xsd:element name="kind" type="xsd:string" />
* <xsd:element name="index" type="xsd:int" />
* </xsd:sequence>
* <xsd:attribute name="att_kind" type="tns:Kind" />
* </xsd:complexType>
*/
writer.write("class "+attribs[0].getTypeName()+";\n\n");
}
else{
writer.write("#include <axis/server/AxisUserAPI.h>\n\n");
}
writeArrayStruct();
this.writer.write("#endif /* !defined(__"+classname.toUpperCase()+"_"+getFileType().toUpperCase()+"_H__INCLUDED_)*/\n");
writer.flush();
writer.close();
System.out.println(getFilePath().getAbsolutePath() + " created.....");
} catch (IOException e) {
e.printStackTrace();
throw new WrapperFault(e);
}
}