<complexType name="Struct5"> <choice> <group ref="PriceGroup"/> <element name="USPrice" type="xsd:float"/> <element name="UKPrice" type="xsd:double"/> <element name="INDPrice" type="xsd:int"/> <element name="ENGPrice" type="xsd:string"/> </choice> </complexType> <group name="PriceGroup"> <sequence> <element name="price" type="xsd:double"/> <element name="currency" type="xsd:string"/> </sequence> </group>
// Generated from examples.xsd // On Wed Jun 09 11:15:17 EDT 2004 package examples_olddb; public class Struct5 implements java.io.Serializable { private int _choice = -1; public int getChoice() { return _choice; } private java.lang.Object _value; public final static int group0 = 0; public examples_olddb.PriceGroupGroup getGroup0() { | return (examples_olddb.PriceGroupGroup)_value; } public void setGroup0(examples_olddb.PriceGroupGroup group0Val) { | _choice = 0; | _value = group0Val; } public final static int usPrice = 1; public java.lang.Float getUsPrice() { | return (java.lang.Float)_value; } public void setUsPrice(java.lang.Float usPriceVal) { | _choice = 1; | _value = usPriceVal; } public final static int ukPrice = 2; public java.lang.Double getUkPrice() { | return (java.lang.Double)_value; } public void setUkPrice(java.lang.Double ukPriceVal) { | _choice = 2; | _value = ukPriceVal; } public final static int indPrice = 3; public java.lang.Integer getIndPrice() { | return (java.lang.Integer)_value; } public void setIndPrice(java.lang.Integer indPriceVal) { | _choice = 3; | _value = indPriceVal; } public final static int engPrice = 4; public java.lang.String getEngPrice() { | return (java.lang.String)_value; } public void setEngPrice(java.lang.String engPriceVal) { | _choice = 4; | _value = engPriceVal; } public java.lang.String toString() { | java.lang.StringBuffer buffer = new java.lang.StringBuffer(); | buffer.append("examples_olddb.Struct5={"); | buffer.append(""+_value); | return new java.lang.String(buffer); } public boolean equals(java.lang.Object object) { | if (!(object instanceof examples_olddb.Struct5)) return false; | examples_olddb.Struct5 obj = (examples_olddb.Struct5) object; | | if (this._value == null) return (obj._value == null); | return this._value.equals(obj._value); } public int hashCode() { return toString().hashCode(); } }
// Generated from examples.xsd // On Wed Jun 09 11:15:17 EDT 2004 package examples_olddb; 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 { | examples_olddb.Struct5 obj = (examples_olddb.Struct5) object; | int choiceSwitch = obj.getChoice(); | if (choiceSwitch == obj.group0) { | | examples_olddb.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 (!examples_olddb.Struct5.class.isAssignableFrom(javaType)) | throw new | com.sssw.jbroker.web.ServiceException("can not deserialize " + javaType.getName()); | | examples_olddb.Struct5 obj = null; | try { | | obj = (examples_olddb.Struct5) javaType.newInstance(); | } catch(Throwable e) { | | throw new com.sssw.jbroker.web.ServiceException("error instantiating " + javaType.getName()); | } | is.setObject(null, obj); | // read elements | com.sssw.jbroker.web.QName qname = null; | java.lang.String fName = null; | | qname = is.peek(); | if (qname != null) { | | fName = qname.getLocalPart(); | | examples_olddb.PriceGroupGroup group0 = null; | | group0 = examples_olddb.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; | examples_olddb.Struct5 obj = (examples_olddb.Struct5) object; | return null; } private void deserializeAttributes(examples_olddb.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; } }
Copyright © 2003, 2004 Novell, Inc. All rights reserved. Copyright © 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.