// Generated from complex.xsd
// On Mon Dec 08 11:11:34 EST 2003
package complex;
public class Struct5Marshaler
implements com.sssw.jbroker.web.encoding.Marshaler
{
// attributes
// elements
private static final javax.xml.namespace.QName _USPRICE = new javax.xml.namespace.QName("http://www.structs.com", "USPrice");
private static final javax.xml.namespace.QName _UKPRICE = new javax.xml.namespace.QName("http://www.structs.com", "UKPrice");
private static final javax.xml.namespace.QName _INDPRICE = new javax.xml.namespace.QName("http://www.structs.com", "INDPrice");
private static final javax.xml.namespace.QName _ENGPRICE = new javax.xml.namespace.QName("http://www.structs.com", "ENGPrice");
public void serialize(com.sssw.jbroker.web.portable.OutputStream os, java.lang.Object object) throws java.io.IOException
{
| complex.Struct5 obj = (complex.Struct5) object;
| int choiceSwitch = obj.getChoice();
| if (choiceSwitch == obj.group0) {
| | complex.PriceGroupGroupMarshaler.serialize(os, obj.getGroup0());
| }
| else if (choiceSwitch == obj.usPrice) {
| | os.writeObject(obj.getUsPrice(), "", _USPRICE.getLocalPart()
| , "http://www.w3.org/2001/XMLSchema", "float");}
| else if (choiceSwitch == obj.ukPrice) {
| | os.writeObject(obj.getUkPrice(), "", _UKPRICE.getLocalPart()
| , "http://www.w3.org/2001/XMLSchema", "double");}
| else if (choiceSwitch == obj.indPrice) {
| | os.writeObject(obj.getIndPrice(), "", _INDPRICE.getLocalPart()
| , "http://www.w3.org/2001/XMLSchema", "int");}
| else if (choiceSwitch == obj.engPrice) {
| | os.writeObject(obj.getEngPrice(), "", _ENGPRICE.getLocalPart()
| , "http://www.w3.org/2001/XMLSchema", "string");}
}
public java.lang.Object deserialize(com.sssw.jbroker.web.portable.InputStream is, java.lang.Class javaType) throws java.io.IOException
{
| if (!complex.Struct5.class.isAssignableFrom(javaType))
| throw new
| com.sssw.jbroker.web.ServiceException("can not deserialize " + javaType.getName());
|
| complex.Struct5 obj = null;
| try {
| | obj = (complex.Struct5) javaType.newInstance();
| } catch(Throwable e) {
| | throw new com.sssw.jbroker.web.ServiceException("error instantiating " + javaType.getName());
| }
| // read elements
| com.sssw.jbroker.web.QName qname = null;
| java.lang.String fName = null;
|
| qname = is.peek();
| if (qname != null) {
| | fName = qname.getLocalPart();
| | complex.PriceGroupGroup group0 = null;
| | group0 = complex.PriceGroupGroupMarshaler.deserialize(is);
| |
| | if (group0 != null) {
| | | obj.setGroup0(group0);
| | | return obj;
| | }
| |
| | java.lang.Float usPrice = null;
| |
| | if (fName.equals(_USPRICE.getLocalPart())) {
| | | usPrice = (java.lang.Float)is.readObject(java.lang.Float.class, "", _USPRICE.getLocalPart(), "http://www.w3.org/2001/XMLSchema", "float");
| | }
| |
| |
| | if (usPrice != null) {
| | | obj.setUsPrice(usPrice);
| | | return obj;
| | }
| |
| | java.lang.Double ukPrice = null;
| |
| | if (fName.equals(_UKPRICE.getLocalPart())) {
| | | ukPrice = (java.lang.Double)is.readObject(java.lang.Double.class, "", _UKPRICE.getLocalPart(), "http://www.w3.org/2001/XMLSchema", "double");
| | }
| |
| |
| | if (ukPrice != null) {
| | | obj.setUkPrice(ukPrice);
| | | return obj;
| | }
| |
| | java.lang.Integer indPrice = null;
| |
| | if (fName.equals(_INDPRICE.getLocalPart())) {
| | | indPrice = (java.lang.Integer)is.readObject(java.lang.Integer.class, "", _INDPRICE.getLocalPart(), "http://www.w3.org/2001/XMLSchema", "int");
| | }
| |
| |
| | if (indPrice != null) {
| | | obj.setIndPrice(indPrice);
| | | return obj;
| | }
| |
| | java.lang.String engPrice = null;
| |
| | if (fName.equals(_ENGPRICE.getLocalPart())) {
| | | engPrice = (java.lang.String)is.readObject(java.lang.String.class, "", _ENGPRICE.getLocalPart(), "http://www.w3.org/2001/XMLSchema", "string");
| | }
| |
| |
| | if (engPrice != null) {
| | | obj.setEngPrice(engPrice);
| | | return obj;
| | }
| |
| }
|
|
|
| return obj;
}
public com.sssw.jbroker.web.encoding.Attribute[] getAttributes(java.lang.Object object)
{
| javax.xml.namespace.QName qname = null;
| java.lang.String attVal = null;
| java.util.ArrayList attribs = new java.util.ArrayList();
| com.sssw.jbroker.web.encoding.Attribute[] attrs = null;
| com.sssw.jbroker.web.encoding.Attribute attr = null;
| complex.Struct5 obj = (complex.Struct5) object;
| return null;
}
private void deserializeAttributes(complex.Struct5 obj, java.util.Map attributes)
throws java.io.IOException
{
| // set attributes
| java.lang.String attr = null;
}
private java.util.Map readAttributes(org.xml.sax.Attributes attributes) {
| java.util.Map attrs = new java.util.HashMap();
| return attrs;
}
public java.lang.String getMechanismType() { return null; }
}