User: jung
Date: 00/12/04 04:36:26
Modified: src/org/zoap/xml Appearance.java AppearanceException.java
Attribute.java AttributeException.java Binding.java
ComplexType.java Deserialisation Process.dfSequence
Element.java ElementException.java Environment.java
Exception Design.dfClass
IllegalSuperTypeException.java
IllegalTypeException.java
NoCompatibleElementException.java Schema.java
SchemaException.java Serialisation
Process.dfSequence SimpleType.java Type.java
TypeException.java URNResolver.java XML Schema
Model.dfClass XmlException.java
XmlObjectReader.java XmlObjectWriter.java
XmlSchemaInstance.java xml.dfPackage
Added: src/org/zoap/xml SerialisationPolicy.java
Log:
adopted to latest jboss container,
added decimal and date
removed some problems due to forward-referencing in meta-data
added serialisation policy
Revision Changes Path
1.2 +219 -192 zoap/src/org/zoap/xml/Appearance.java
Index: Appearance.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Appearance.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Appearance.java 2000/08/10 21:07:25 1.1
+++ Appearance.java 2000/12/04 12:36:19 1.2
@@ -1,195 +1,228 @@
-/*
- * $Id: Appearance.java,v 1.1 2000/08/10 21:07:25 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * Appearances are the actual tags appearing in XML documents <br>
- * Appearances are associated a type that describes their substructure in more
detail. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class Appearance {
-
- /** constructor is quite empty */
-
- public Appearance() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".Appearance()\n");
-
- }
-
- /**
- * gets the type @return Type that is associated with this appearance inside
the
- * given @arg object. If object is null, it should return the default type
- * for deserialisation, if object is non-null the appearance can
- * return a more specialised type. Is used in both serialisation and
deserialisation.
- */
-
- public Type getType(Object object) {
- return getType();
- }
-
- /**
- * gets the type @return Type that is associated with this appearance.
- * Should return the default type for deserialisation, if object is non-null
the appearance can
- * return a more specialised type. Is used in both serialisation and
deserialisation.
- */
-
- public Type getType() {
- return type;
- }
-
-
- public void setType(Type type) throws IllegalTypeException {
- this.type = type;
- }
-
- /** returns the @return Schema that this appearance belongs to */
- public Schema getAppearanceSchema() {
- return appearanceSchema;
- }
-
- /** sets the @arg schema that this part belongs to */
- public void setAppearanceSchema(Schema appearanceSchema) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setAppearanceSchema(" +
appearanceSchema + ")\n");
-
- this.appearanceSchema = appearanceSchema;
- }
-
- /** get the @return String -based name of that part within the schema */
- public String getAppearanceName() {
- return appearanceName;
- }
-
- /** set the @arg name of that part within the schema */
- public void setAppearanceName(String appearanceName) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setAppearanceName(" +
appearanceName + ")\n");
-
- this.appearanceName = appearanceName;
- }
-
- /** overrides the default equals method to cater for schema and name-based
equality */
- public boolean equals(Object other) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".equals(" + other + ")\n");
-
- try {
- return (other == this ||
(appearanceName.equals(((Appearance)other).appearanceName) &&
-
appearanceSchema.equals(((Appearance)other).appearanceSchema)));
- } catch (ClassCastException e) {
- return false;
- } catch (NullPointerException e) {
- return false;
- }
-
- }
-
- /** overrides the default hashCode implementation to coincide with above
equality concept */
-
- public int hashCode() {
-
- // only if both schema and name are non-null
- try {
- return appearanceSchema.hashCode() + appearanceName.hashCode();
- } catch (NullPointerException e) {
- return super.hashCode();
- }
- }
-
- /**
- * the schema this part is belonging to
- * @label definingSchema
- * @directed
- * @clientRole *
- * @supplierCardinality 1
- */
- private Schema appearanceSchema;
-
- /** the schema-wide unique name. */
- private String appearanceName;
-
- /**
- * the type that this appearance is dedicated to
- * @label associatedType
- * @clientCardinality *
- * @supplierCardinality 1
- * @directed
- */
-
- private Type type;
-
-}
-
-/*
+/*
+ * $Id: Appearance.java,v 1.2 2000/12/04 12:36:19 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * Appearances are the actual tags appearing in XML documents <br>
+ * Appearances are associated a type that describes their substructure in more
detail. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class Appearance implements Cloneable {
+
+ /** constructor is quite empty */
+
+ public Appearance() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".Appearance()\n");
+
+ }
+
+ /**
+ * gets the type @return Type that is associated with this appearance inside
the
+ * given @arg object. If object is null, it should return the default type
+ * for deserialisation, if object is non-null the appearance can
+ * return a more specialised type. Is used in both serialisation and
deserialisation.
+ */
+
+ public Type getType(Object object) {
+ return getType();
+ }
+
+ /**
+ * gets the type @return Type that is associated with this appearance.
+ * Should return the default type for deserialisation, if object is non-null
the appearance can
+ * return a more specialised type. Is used in both serialisation and
deserialisation.
+ */
+
+ public Type getType() {
+ return type;
+ }
+
+
+ public void setType(Type type) throws IllegalTypeException {
+ this.type = type;
+ }
+
+ /** returns the @return Schema that this appearance belongs to */
+ public Schema getAppearanceSchema() {
+ return appearanceSchema;
+ }
+
+ /** sets the @arg schema that this part belongs to */
+ public void setAppearanceSchema(Schema appearanceSchema) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setAppearanceSchema(" +
appearanceSchema + ")\n");
+
+ this.appearanceSchema = appearanceSchema;
+ }
+
+ /** get the @return String -based name of that part within the schema */
+ public String getAppearanceName() {
+ return appearanceName;
+ }
+
+ /** set the @arg name of that part within the schema */
+ public void setAppearanceName(String appearanceName) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setAppearanceName(" +
appearanceName + ")\n");
+
+ this.appearanceName = appearanceName;
+ }
+
+ /** overrides the default equals method to cater for schema and name-based
equality */
+ public boolean equals(Object other) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".equals(" + other + ")\n");
+
+ try {
+ return (other == this ||
(appearanceName.equals(((Appearance)other).appearanceName) &&
+
appearanceSchema.equals(((Appearance)other).appearanceSchema)));
+ } catch (ClassCastException e) {
+ return false;
+ } catch (NullPointerException e) {
+ return false;
+ }
+
+ }
+
+ /** overrides the default hashCode implementation to coincide with above
equality concept */
+
+ public int hashCode() {
+
+ // only if both schema and name are non-null
+ try {
+ return appearanceSchema.hashCode() + appearanceName.hashCode();
+ } catch (NullPointerException e) {
+ return super.hashCode();
+ }
+ }
+
+ /**
+ * this method is to clone the actual appearance into some
+ * other appearance with the same name, but a
+ * possibly modified internal structure. It is used to
+ * implement the copy semantics of the type-element
+ * association in some parts of XML-Schema.
+ */
+
+ public Object clone() {
+
+ // first construct a clone
+ Appearance returnAppearance=null;
+
+ try{
+ returnAppearance=(Appearance) super.clone();
+ } catch(CloneNotSupportedException e) {
+ // not possible, we implement it!
+ }
+
+ return returnAppearance;
+
+ }
+
+ /**
+ * the schema this part is belonging to
+ * @label definingSchema
+ * @directed
+ * @clientRole *
+ * @supplierCardinality 1
+ */
+ private Schema appearanceSchema;
+
+ /** the schema-wide unique name. */
+ private String appearanceName;
+
+ /**
+ * the type that this appearance is dedicated to
+ * @label associatedType
+ * @clientCardinality *
+ * @supplierCardinality 1
+ * @directed
+ */
+
+ private Type type;
+
+}
+
+/*
* $Log: Appearance.java,v $
- * Revision 1.1 2000/08/10 21:07:25 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:19 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:25 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +68 -64 zoap/src/org/zoap/xml/AppearanceException.java
Index: AppearanceException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/AppearanceException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AppearanceException.java 2000/08/10 21:07:25 1.1
+++ AppearanceException.java 2000/12/04 12:36:20 1.2
@@ -1,67 +1,77 @@
-/*
- * $Id: AppearanceException.java,v 1.1 2000/08/10 21:07:25 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-public class AppearanceException extends XmlException {
-}
-
-/*
+/*
+ * $Id: AppearanceException.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+public class AppearanceException extends XmlException {
+}
+
+/*
* $Log: AppearanceException.java,v $
- * Revision 1.1 2000/08/10 21:07:25 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/07/13 12:46:23 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:25 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:23 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +163 -159 zoap/src/org/zoap/xml/Attribute.java
Index: Attribute.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Attribute.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Attribute.java 2000/08/10 21:07:26 1.1
+++ Attribute.java 2000/12/04 12:36:20 1.2
@@ -1,162 +1,172 @@
-/*
- * $Id: Attribute.java,v 1.1 2000/08/10 21:07:26 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import java.util.Properties;
-import java.util.Map;
-
-/**
- * Attributes are "basic" appearances inside XML documents <br>
- * They are tight to simple types which have just a body, but no elements and
- * attributes by themselves. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class Attribute extends Appearance {
-
- /** empty contructor */
- public Attribute() {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
-
- }
-
- /**
- * set the type of this attribute to @arg type
- */
-
- public void setType(Type type) throws IllegalTypeException {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"setType("+type+")\n");
-
- if(type instanceof SimpleType)
- setType((SimpleType) type);
- else
- throw new IllegalTypeException();
- }
-
- /**
- * set the type of this attribute to the simple type @arg type
- */
-
- public void setType(SimpleType type) {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"setType("+type+")\n");
-
- try{
- super.setType(type);
- } catch(IllegalTypeException e) {
- // will not be thrown in fact!
- }
-
- }
-
- /**
- * returns the value @return Object of the attribute from the given
- * java @arg object. @arg ids is a property structure that
- * describes the global ids that this object has been assigned in more detail.
- * @throws AttributeException if the access to the attribute did not succeed.
- * This method is used when serialising some object.
- */
-
- public Object getAttributeContent(Object object, boolean isNew,
- Properties ids) throws AttributeException {
- return null;
- }
-
- /**
- * sets the value @arg value for this attribute into the given
- * java @arg object and producing a new @return Object. @arg references is a
map that
- * describes the assignment of the global ids to objects.
- * @throws AttributeException if the access to the attribute did not succeed.
- * This method is used when deserialising some object.
- */
-
- public Object setAttributeContent(Object object, Object value, Map references,
Map nameSpaces)
- throws AttributeException {
- return object;
- }
-
- /**
- * Each appearance has an associated type
- * with it.
- * @label associatedType
- * @directed
- * @clientCardinality *
- * @supplierCardinality 1
- */
-
- private SimpleType type;
-
-}
-
-/*
+/*
+ * $Id: Attribute.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import java.util.Properties;
+import java.util.Map;
+
+/**
+ * Attributes are "basic" appearances inside XML documents <br>
+ * They are tight to simple types which have just a body, but no elements and
+ * attributes by themselves. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class Attribute extends Appearance {
+
+ /** empty contructor */
+ public Attribute() {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString()+"()\n");
+
+ }
+
+ /**
+ * set the type of this attribute to @arg type
+ */
+
+ public void setType(Type type) throws IllegalTypeException {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString()+"setType("+type+")\n");
+
+ if(type instanceof SimpleType)
+ setType((SimpleType) type);
+ else
+ throw new IllegalTypeException();
+ }
+
+ /**
+ * set the type of this attribute to the simple type @arg type
+ */
+
+ public void setType(SimpleType type) {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString()+"setType("+type+")\n");
+
+ try{
+ super.setType(type);
+ } catch(IllegalTypeException e) {
+ // will not be thrown in fact!
+ }
+
+ }
+
+ /**
+ * returns the value @return Object of the attribute from the given
+ * java @arg object. @arg ids is a property structure that
+ * describes the global ids that this object has been assigned in more detail.
+ * @throws AttributeException if the access to the attribute did not succeed.
+ * This method is used when serialising some object.
+ */
+
+ public Object getAttributeContent(Object object, boolean isNew,
+ Properties ids) throws AttributeException {
+ return null;
+ }
+
+ /**
+ * sets the value @arg value for this attribute into the given
+ * java @arg object and producing a new @return Object. @arg references is a
map that
+ * describes the assignment of the global ids to objects.
+ * @throws AttributeException if the access to the attribute did not succeed.
+ * This method is used when deserialising some object.
+ */
+
+ public Object setAttributeContent(Object object, Object value, Map references,
Map nameSpaces)
+ throws AttributeException {
+ return object;
+ }
+
+ /**
+ * Each appearance has an associated type
+ * with it.
+ * @label associatedType
+ * @directed
+ * @clientCardinality *
+ * @supplierCardinality 1
+ */
+
+ private SimpleType type;
+
+}
+
+/*
* $Log: Attribute.java,v $
- * Revision 1.1 2000/08/10 21:07:26 jung
- * Initial revision
- *
- * Revision 1.1.2.3 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:23 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:26 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.3 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:23 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +67 -63 zoap/src/org/zoap/xml/AttributeException.java
Index: AttributeException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/AttributeException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AttributeException.java 2000/08/10 21:07:26 1.1
+++ AttributeException.java 2000/12/04 12:36:20 1.2
@@ -1,66 +1,76 @@
-/*
- * $Id: AttributeException.java,v 1.1 2000/08/10 21:07:26 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.zoap.xml;
-
-public class AttributeException extends AppearanceException {
-}
-
-/*
+/*
+ * $Id: AttributeException.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.zoap.xml;
+
+public class AttributeException extends AppearanceException {
+}
+
+/*
* $Log: AttributeException.java,v $
- * Revision 1.1 2000/08/10 21:07:26 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/07/13 12:46:23 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:26 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:23 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +350 -346 zoap/src/org/zoap/xml/Binding.java
Index: Binding.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Binding.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Binding.java 2000/08/10 21:07:27 1.1
+++ Binding.java 2000/12/04 12:36:20 1.2
@@ -1,349 +1,359 @@
-/*
- * $Id: Binding.java,v 1.1 2000/08/10 21:07:27 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import de.infor.ce.util.URN;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.HashMap;
-
-/**
- * Binding is the central abstraction that connects a dedicated meta-model to the
(de-)serialization facilities of infor:XML.
- * <br> It collects a bundle of schemas that determine the possible namespaces and
furthermore the top-level elements that
- * could appear in an XML document. A binding furthermore identifies
- * a default namespace environment/context (that is mappings of namespace
- * prefixes to schemas) that is used to parse/generate documents. <br>
- * When we say that infor:XML successfully processes or generates an XML document
- * according to that binding, this means that this document is valid with respect
to one
- * of the bundled schemas under the context of the other schemas and the default
namespace environment. <br>
- * There is a default binding @see org.zoap.xml.meta.builtin.DefaultBinding
- * shipped with infor:XML that provides support for most of the basic datatypes
known
- * in Java/XML-Schema and additionally is able to build schema-information from
- * Java serialization information on the fly. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class Binding {
-
- /** constructor is quite empty, we like to build bindings on the fly */
-
- public Binding() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
-
- }
-
- /**
- * registers an additional @arg schema and returns the overwritten @return
Schema.
- * lazily initialises the internal schema map. Throws @throws
NullPointerException if the given schema is null.
- */
-
- public Schema addSchema(Schema schema) throws NullPointerException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addSchema(" + schema +
")\n");
-
- // this could be a nice optimization elsewhere
- // most of the time, schemas will be initialized, such
- // that we simply dive into the right method call,
- // catch the NullPointerException if its not there and
- // do the synchronized construction of the hashtable
- // in that deferred code
-
- try {
- return (Schema)schemas.put(schema.getUrn(), schema);
- } catch (NullPointerException e) {
-
- synchronized(this) {
- if (schemas == null) {
- schemas = new HashMap();
- }
- }
-
- return (Schema)schemas.put(schema.getUrn(), schema);
- }
-
- } // addSchema
-
- /**
- * removes a @arg schema and returns the removed @return Schema.
- * @throws NullPointerException if the given schema is null
- */
-
- public Schema removeSchema(Schema schema) throws NullPointerException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeSchema(" + schema +
")\n");
-
- if (schemas != null)
- return (Schema)schemas.remove(schema.getUrn());
- else
- return null;
- }
-
- /**
- * looks up a @return Schema by its @arg urn. Here, the default schema
- * XmlSchemaInstance is fixedly installed, but this method can be overridden.
- * getSchema is used to resolve namespace references in infor:XML.
- * Returns @return null if no schema matching the given urn could be found.
- * @label fixedReference
- * @clientCardinality *
- * @supplierCardinality 1
- * @directed
- */
-
- /*#XmlSchemaInstance lnkXmlSchemaInstance;*/
- public Schema getSchema(URN urn) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getSchema(" + urn +
")\n");
-
- Schema result = null;
-
- try {
- result = (Schema)schemas.get(urn);
- } catch (NullPointerException e) { }
-
- if (result == null &&
XmlSchemaInstance.getXmlSchemaInstance().getUrn().equals(urn)) {
- return XmlSchemaInstance.getXmlSchemaInstance();
- } else {
- return result;
- }
-
- }
-
- /**
- * method to lookup a @return Element in the registered schemas
- * whose type most specifically complies to the given Java @arg object
- * under the given @arg clazz, where object is typically an instance of clazz.
- * This function used to find initial XML encodings by infor:XML. Returns
@return null
- * if no such element exists. If object is null, then just the clazz
information is taken.
- * If clazz is null, it is taken as the class of object. If both are null, we
find an element
- * belonging to Object.class <br> This is implemented yet in a very naive
manner simply by going
- * through the schemas and asking them whether they support the object/clazz
by a dedicated element.
- * When no such schema is found, this function climbs up the inheritance
hierarchy to find a more
- * general mapping.
- * <br> This function is normally just called once when an object has to be
serialised, so it does
- * not hurt that much.
- * <br> Since the object to serialise is also present, you can implement
- * instance-specific mappings by overriding this method.
- */
-
- public Element findElementCompatibleTo(Object object, Class clazz) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".findElementCompatibleTo("
+ object + "," + clazz + ")\n");
-
- if (clazz == null)
- if (object == null)
- clazz = Object.class;
- else
- clazz = object.getClass();
-
- // this is where the final result is stored
- Element result = null;
-
- // only if we have any schemas registered
- try{
-
- // the iterator to loop through them
- java.util.Iterator allSchemas;
-
- // as long as the most specific class we inspect has not
produced any result, yet
- while (clazz != null && result == null) {
- // reset the iterator
- allSchemas = schemas.values().iterator();
-
- while (allSchemas.hasNext() && result == null) {
- // and ask the corresponding schema
- Schema currentSchema =
(Schema)allSchemas.next();
- result =
currentSchema.findElementCompatibleTo(object, clazz);
- } // while
-
- // only if we go into the loop, we climb up the
inheritance tree
- if (result == null)
- clazz = clazz.getSuperclass();
- } // while
-
- } catch(NullPointerException e) {
- }
-
- return result;
- }
-
- /**
- * method to lookup a @return Type in the registered schemas that complies
most specifically to the given Java @arg objectunder the given @arg clazz, where
object is typically an instance of clazz.
- * This function used to find the right polymorphic annotations by infor:XML.
Returns @return null
- * if no such element exists. If object is null, then just the clazz
information is taken.
- * If clazz is null, it is taken as the class of object. If both are null, we
find an element
- * belonging to Object.class <br> This is implemented yet in a very naive
manner simply by going
- * through the schemas and asking them whether they support the object/clazz
by a dedicated element.
- * <br> This is critical at the moment, since this function will be called a
lot of times. Maybe
- * we have to redesign this part of the meta-model to speed this up.
- * <br>
- * When no such schema is found, this function climbs up the inheritance
hierarchy to find a more
- * general mapping. <br>
- * Since the object to serialise is also present, you can implement
instance-specific polymorphism
- * by overriding this method.
- */
-
- public Type findTypeCompatibleTo(Object object, Class clazz) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".findTypeCompatibleTo(" +
object + "," + clazz + ")\n");
-
- if (clazz == null)
- if (object == null)
- clazz = Object.class;
- else
- clazz = object.getClass();
-
- // this is where the final result is stored
- Type result = null;
-
- try{
-
- // the iterator to loop through them
- java.util.Iterator allSchemas;
-
- // as long as the most specific class we inspect has not
produced any result, yet
- while (clazz != null && result == null) {
- // reset the iterator
- allSchemas = schemas.values().iterator();
-
- while (allSchemas.hasNext() && result == null) {
- // and ask the corresponding schema
- Schema currentSchema =
(Schema)allSchemas.next();
- result =
currentSchema.findTypeCompatibleTo(object, clazz);
- } // while
-
- // only if we go into the loop, we climb up the
inheritance tree
- if (result == null)
- clazz = clazz.getSuperclass();
- } // while
-
- } catch(NullPointerException e) {
- }
-
- return result;
- }
-
- /**
- * return the default namespace environment that will be used for documents
- * parsed/generated with this binding.
- * <br>
- * The result of this function is currently a 1-size hashmap in which
- * the namespace "" is mapped to some schema that is configurable per VM through
- * Environment.defaultNameSpace, but should be configurable per-instance in the
future
- */
-
- public Map getDefaultNameSpaceEnvironment() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() +
".getDefaultNameSpaceEnvironment()\n");
-
- if (defaultNameSpaceEnvironment == null) {
-
- synchronized(this) {
-
- if (defaultNameSpaceEnvironment == null) {
-
- defaultNameSpaceEnvironment = new HashMap();
-
- } // if
-
- } // sync
-
- } // if
-
- return defaultNameSpaceEnvironment;
- }
-
-
- /**
- * A Binding consists of a bunch of schemas indexed via their urn.
- * @associates <{Schema}>
- * @supplierCardinality *
- * @clientCardinality *
- * @label registeredSchemas
- */
- private Map schemas;
-
- /**
- * the default namespace store
- */
-
- private Map defaultNameSpaceEnvironment=new HashMap();
-
-}
-
-/*
+/*
+ * $Id: Binding.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import de.infor.ce.util.URN;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.HashMap;
+
+/**
+ * Binding is the central abstraction that connects a dedicated meta-model to the
(de-)serialization facilities of infor:XML.
+ * <br> It collects a bundle of schemas that determine the possible namespaces and
furthermore the top-level elements that
+ * could appear in an XML document. A binding furthermore identifies
+ * a default namespace environment/context (that is mappings of namespace
+ * prefixes to schemas) that is used to parse/generate documents. <br>
+ * When we say that infor:XML successfully processes or generates an XML document
+ * according to that binding, this means that this document is valid with respect
to one
+ * of the bundled schemas under the context of the other schemas and the default
namespace environment. <br>
+ * There is a default binding @see org.zoap.xml.meta.builtin.DefaultBinding
+ * shipped with infor:XML that provides support for most of the basic datatypes
known
+ * in Java/XML-Schema and additionally is able to build schema-information from
+ * Java serialization information on the fly. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class Binding {
+
+ /** constructor is quite empty, we like to build bindings on the fly */
+
+ public Binding() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "()\n");
+
+ }
+
+ /**
+ * registers an additional @arg schema and returns the overwritten @return
Schema.
+ * lazily initialises the internal schema map. Throws @throws
NullPointerException if the given schema is null.
+ */
+
+ public Schema addSchema(Schema schema) throws NullPointerException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addSchema(" + schema +
")\n");
+
+ // this could be a nice optimization elsewhere
+ // most of the time, schemas will be initialized, such
+ // that we simply dive into the right method call,
+ // catch the NullPointerException if its not there and
+ // do the synchronized construction of the hashtable
+ // in that deferred code
+
+ try {
+ return (Schema)schemas.put(schema.getUrn(), schema);
+ } catch (NullPointerException e) {
+
+ synchronized(this) {
+ if (schemas == null) {
+ schemas = new HashMap();
+ }
+ }
+
+ return (Schema)schemas.put(schema.getUrn(), schema);
+ }
+
+ } // addSchema
+
+ /**
+ * removes a @arg schema and returns the removed @return Schema.
+ * @throws NullPointerException if the given schema is null
+ */
+
+ public Schema removeSchema(Schema schema) throws NullPointerException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeSchema(" + schema +
")\n");
+
+ if (schemas != null)
+ return (Schema)schemas.remove(schema.getUrn());
+ else
+ return null;
+ }
+
+ /**
+ * looks up a @return Schema by its @arg urn. Here, the default schema
+ * XmlSchemaInstance is fixedly installed, but this method can be overridden.
+ * getSchema is used to resolve namespace references in infor:XML.
+ * Returns @return null if no schema matching the given urn could be found.
+ * @label fixedReference
+ * @clientCardinality *
+ * @supplierCardinality 1
+ * @directed
+ */
+
+ /*#XmlSchemaInstance lnkXmlSchemaInstance;*/
+ public Schema getSchema(URN urn) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getSchema(" + urn +
")\n");
+
+ Schema result = null;
+
+ try {
+ result = (Schema)schemas.get(urn);
+ } catch (NullPointerException e) { }
+
+ if (result == null &&
XmlSchemaInstance.getXmlSchemaInstance().getUrn().equals(urn)) {
+ return XmlSchemaInstance.getXmlSchemaInstance();
+ } else {
+ return result;
+ }
+
+ }
+
+ /**
+ * method to lookup a @return Element in the registered schemas
+ * whose type most specifically complies to the given Java @arg object
+ * under the given @arg clazz, where object is typically an instance of clazz.
+ * This function used to find initial XML encodings by infor:XML. Returns
@return null
+ * if no such element exists. If object is null, then just the clazz
information is taken.
+ * If clazz is null, it is taken as the class of object. If both are null, we
find an element
+ * belonging to Object.class <br> This is implemented yet in a very naive
manner simply by going
+ * through the schemas and asking them whether they support the object/clazz
by a dedicated element.
+ * When no such schema is found, this function climbs up the inheritance
hierarchy to find a more
+ * general mapping.
+ * <br> This function is normally just called once when an object has to be
serialised, so it does
+ * not hurt that much.
+ * <br> Since the object to serialise is also present, you can implement
+ * instance-specific mappings by overriding this method.
+ */
+
+ public Element findElementCompatibleTo(Object object, Class clazz) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".findElementCompatibleTo("
+ object + "," + clazz + ")\n");
+
+ if (clazz == null)
+ if (object == null)
+ clazz = Object.class;
+ else
+ clazz = object.getClass();
+
+ // this is where the final result is stored
+ Element result = null;
+
+ // only if we have any schemas registered
+ try{
+
+ // the iterator to loop through them
+ java.util.Iterator allSchemas;
+
+ // as long as the most specific class we inspect has not
produced any result, yet
+ while (clazz != null && result == null) {
+ // reset the iterator
+ allSchemas = schemas.values().iterator();
+
+ while (allSchemas.hasNext() && result == null) {
+ // and ask the corresponding schema
+ Schema currentSchema =
(Schema)allSchemas.next();
+ result =
currentSchema.findElementCompatibleTo(object, clazz);
+ } // while
+
+ // only if we go into the loop, we climb up the
inheritance tree
+ if (result == null)
+ clazz = clazz.getSuperclass();
+ } // while
+
+ } catch(NullPointerException e) {
+ }
+
+ return result;
+ }
+
+ /**
+ * method to lookup a @return Type in the registered schemas that complies
most specifically to the given Java @arg objectunder the given @arg clazz, where
object is typically an instance of clazz.
+ * This function used to find the right polymorphic annotations by infor:XML.
Returns @return null
+ * if no such element exists. If object is null, then just the clazz
information is taken.
+ * If clazz is null, it is taken as the class of object. If both are null, we
find an element
+ * belonging to Object.class <br> This is implemented yet in a very naive
manner simply by going
+ * through the schemas and asking them whether they support the object/clazz
by a dedicated element.
+ * <br> This is critical at the moment, since this function will be called a
lot of times. Maybe
+ * we have to redesign this part of the meta-model to speed this up.
+ * <br>
+ * When no such schema is found, this function climbs up the inheritance
hierarchy to find a more
+ * general mapping. <br>
+ * Since the object to serialise is also present, you can implement
instance-specific polymorphism
+ * by overriding this method.
+ */
+
+ public Type findTypeCompatibleTo(Object object, Class clazz) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".findTypeCompatibleTo(" +
object + "," + clazz + ")\n");
+
+ if (clazz == null)
+ if (object == null)
+ clazz = Object.class;
+ else
+ clazz = object.getClass();
+
+ // this is where the final result is stored
+ Type result = null;
+
+ try{
+
+ // the iterator to loop through them
+ java.util.Iterator allSchemas;
+
+ // as long as the most specific class we inspect has not
produced any result, yet
+ while (clazz != null && result == null) {
+ // reset the iterator
+ allSchemas = schemas.values().iterator();
+
+ while (allSchemas.hasNext() && result == null) {
+ // and ask the corresponding schema
+ Schema currentSchema =
(Schema)allSchemas.next();
+ result =
currentSchema.findTypeCompatibleTo(object, clazz);
+ } // while
+
+ // only if we go into the loop, we climb up the
inheritance tree
+ if (result == null)
+ clazz = clazz.getSuperclass();
+ } // while
+
+ } catch(NullPointerException e) {
+ }
+
+ return result;
+ }
+
+ /**
+ * return the default namespace environment that will be used for documents
+ * parsed/generated with this binding.
+ * <br>
+ * The result of this function is currently a 1-size hashmap in which
+ * the namespace "" is mapped to some schema that is configurable per VM through
+ * Environment.defaultNameSpace, but should be configurable per-instance in the
future
+ */
+
+ public Map getDefaultNameSpaceEnvironment() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() +
".getDefaultNameSpaceEnvironment()\n");
+
+ if (defaultNameSpaceEnvironment == null) {
+
+ synchronized(this) {
+
+ if (defaultNameSpaceEnvironment == null) {
+
+ defaultNameSpaceEnvironment = new HashMap();
+
+ } // if
+
+ } // sync
+
+ } // if
+
+ return defaultNameSpaceEnvironment;
+ }
+
+
+ /**
+ * A Binding consists of a bunch of schemas indexed via their urn.
+ * @associates <{Schema}>
+ * @supplierCardinality *
+ * @clientCardinality *
+ * @label registeredSchemas
+ */
+ private Map schemas;
+
+ /**
+ * the default namespace store
+ */
+
+ private Map defaultNameSpaceEnvironment=new HashMap();
+
+}
+
+/*
* $Log: Binding.java,v $
- * Revision 1.1 2000/08/10 21:07:27 jung
- * Initial revision
- *
- * Revision 1.1.2.3 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:23 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:27 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.3 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:23 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +122 -118 zoap/src/org/zoap/xml/ComplexType.java
Index: ComplexType.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/ComplexType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ComplexType.java 2000/08/10 21:07:27 1.1
+++ ComplexType.java 2000/12/04 12:36:20 1.2
@@ -1,121 +1,131 @@
-/*
- * $Id: ComplexType.java,v 1.1 2000/08/10 21:07:27 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Collection;
-
-/**
- * The infor:XML interface to types. <br> XML types determine sub-structures inside
an XML document in terms of attribute,
- * element, and raw character appearances. XML types are arranged in inheritance
hierarchies quite as traditional classes are.
- * <br> XML types hence correspond quite naturally to Java classes. Thus, in
infor:X,
- * each XML type is associated with a compatible Java class from which any type
- * appearance can be derived in writing and whose instances the type can manipulate
in reading. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-
-public class ComplexType extends Type {
-
- /** empty constructor */
- public ComplexType() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
-
- }
-
- public void setSuperType(Type superType) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() +
".setSuperType("+superType+")\n");
-
- try{
- super.setSuperType(superType);
- } catch(IllegalSuperTypeException e) {
- // cant happen
- }
- }
-
-
-
-}
-
-/*
+/*
+ * $Id: ComplexType.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Collection;
+
+/**
+ * The infor:XML interface to types. <br> XML types determine sub-structures inside
an XML document in terms of attribute,
+ * element, and raw character appearances. XML types are arranged in inheritance
hierarchies quite as traditional classes are.
+ * <br> XML types hence correspond quite naturally to Java classes. Thus, in
infor:X,
+ * each XML type is associated with a compatible Java class from which any type
+ * appearance can be derived in writing and whose instances the type can manipulate
in reading. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+
+public class ComplexType extends Type {
+
+ /** empty constructor */
+ public ComplexType() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "()\n");
+
+ }
+
+ public void setSuperType(Type superType) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() +
".setSuperType("+superType+")\n");
+
+ try{
+ super.setSuperType(superType);
+ } catch(IllegalSuperTypeException e) {
+ // cant happen
+ }
+ }
+
+
+
+}
+
+/*
* $Log: ComplexType.java,v $
- * Revision 1.1 2000/08/10 21:07:27 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.2 2000/07/20 14:35:28 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1.2.1 2000/07/11 08:08:34 jung
- * added functionality to store retrieve a part of a types elements
- * within "ignored" strings. Useful for writing generic handlers that
- * just process a part of the XML and transfer the rest.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:27 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.2 2000/07/20 14:35:28 jung
+ * some refactoring inside infor:xml
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1.2.1 2000/07/11 08:08:34 jung
+ * added functionality to store retrieve a part of a types elements
+ * within "ignored" strings. Useful for writing generic handlers that
+ * just process a part of the XML and transfer the rest.
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
No revision
No revision
1.2 +185 -181 zoap/src/org/zoap/xml/Element.java
Index: Element.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Element.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Element.java 2000/08/10 21:07:28 1.1
+++ Element.java 2000/12/04 12:36:20 1.2
@@ -1,184 +1,194 @@
-/*
- * $Id: Element.java,v 1.1 2000/08/10 21:07:28 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import java.util.Properties;
-import java.util.Map;
-
-/**
- * Elements are "complex" appearances inside XML documents - the usual tags that
you encounter in XML are elements. <br>
- * Elements can be tight to arbitrary types which describe their substructure in
more detail. <br>
- * Elements could also occur in multiple instances within the same context (e.g.,
an array). <br>
- *
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class Element extends Appearance {
-
- /**
- * constructor is quite empty
- */
-
- public Element() {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+"()\n");
-
- }
-
- /** setType */
- public void setType(Type type) {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".setType("+type+")\n");
-
- try{
- super.setType(type);
- } catch(IllegalTypeException e) {
- // cant happen
- }
-
- }
-
- /**
- * creates an array of recursively evaluated @return Object[]
- * for this element of the object @arg object. The flag @arg isNew indicates
whether
- * this object has already been seen on the stream. The @arg ids is a property
structure
- * that describes the global ids that have been assigned to this object in more
detail.
- * @throws ElementException if the access to this element did not work. This
method is used when serializing an object.
- */
-
- public Object[] getElementContents(Object object, boolean isNew, Properties ids)
- throws ElementException {
- return null;
- }
-
- /**
- * adds the given @arg value to this element of the object @arg object by
creating a new
- * @return Object. The @arg references is a map
- * that describes how global ids have been assigned to objects.
- * @throws ElementException if the access to this element did not work.
- * This method is used when deserializing an object.
- */
-
- public Object addElementContent(Object object, Object value, Map references,
Map nameSpaces)
- throws ElementException {
- return object;
- }
-
- /**
- * ask the element the minimal amount of appearances it needs
- */
-
- public int getMinOccurs() {
- return minOccurs;
- }
-
- /**
- * set the minimal amount of appearances this element can have
- */
-
- public void setMinOccurs(int minOccurs) {
- this.minOccurs=minOccurs;
- }
-
- /**
- * return the maximal amount of appearances, this element can have
- * unbounded if negative
- */
-
- public int getMaxOccurs() {
- return maxOccurs;
- }
-
- /**
- * set the maximal amount of appearances this element can have
- * negative means unbounded
- */
-
- public void setMaxOccurs(int maxOccurs) {
- this.maxOccurs=maxOccurs;
- }
-
- /**
- * how often this element can minimally occur, default is 1, but
- * is currently ignored completely
- */
- private int minOccurs=1;
-
- /**
- * how often this element can maximally occur, default is 1, but is
- * currenty ignored in processing. Unbounded is encoded as an arbitrary
- * negative number
- */
- private int maxOccurs=1;
-
-}
-
-/*
+/*
+ * $Id: Element.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import java.util.Properties;
+import java.util.Map;
+
+/**
+ * Elements are "complex" appearances inside XML documents - the usual tags that
you encounter in XML are elements. <br>
+ * Elements can be tight to arbitrary types which describe their substructure in
more detail. <br>
+ * Elements could also occur in multiple instances within the same context (e.g.,
an array). <br>
+ *
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class Element extends Appearance {
+
+ /**
+ * constructor is quite empty
+ */
+
+ public Element() {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString()+"()\n");
+
+ }
+
+ /** setType */
+ public void setType(Type type) {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString()+".setType("+type+")\n");
+
+ try{
+ super.setType(type);
+ } catch(IllegalTypeException e) {
+ // cant happen
+ }
+
+ }
+
+ /**
+ * creates an array of recursively evaluated @return Object[]
+ * for this element of the object @arg object. The flag @arg isNew indicates
whether
+ * this object has already been seen on the stream. The @arg ids is a property
structure
+ * that describes the global ids that have been assigned to this object in more
detail.
+ * @throws ElementException if the access to this element did not work. This
method is used when serializing an object.
+ */
+
+ public Object[] getElementContents(Object object, boolean isNew, Properties ids)
+ throws ElementException {
+ return null;
+ }
+
+ /**
+ * adds the given @arg value to this element of the object @arg object by
creating a new
+ * @return Object. The @arg references is a map
+ * that describes how global ids have been assigned to objects.
+ * @throws ElementException if the access to this element did not work.
+ * This method is used when deserializing an object.
+ */
+
+ public Object addElementContent(Object object, Object value, Map references,
Map nameSpaces)
+ throws ElementException {
+ return object;
+ }
+
+ /**
+ * ask the element the minimal amount of appearances it needs
+ */
+
+ public int getMinOccurs() {
+ return minOccurs;
+ }
+
+ /**
+ * set the minimal amount of appearances this element can have
+ */
+
+ public void setMinOccurs(int minOccurs) {
+ this.minOccurs=minOccurs;
+ }
+
+ /**
+ * return the maximal amount of appearances, this element can have
+ * unbounded if negative
+ */
+
+ public int getMaxOccurs() {
+ return maxOccurs;
+ }
+
+ /**
+ * set the maximal amount of appearances this element can have
+ * negative means unbounded
+ */
+
+ public void setMaxOccurs(int maxOccurs) {
+ this.maxOccurs=maxOccurs;
+ }
+
+ /**
+ * how often this element can minimally occur, default is 1, but
+ * is currently ignored completely
+ */
+ private int minOccurs=1;
+
+ /**
+ * how often this element can maximally occur, default is 1, but is
+ * currenty ignored in processing. Unbounded is encoded as an arbitrary
+ * negative number
+ */
+ private int maxOccurs=1;
+
+}
+
+/*
* $Log: Element.java,v $
- * Revision 1.1 2000/08/10 21:07:28 jung
- * Initial revision
- *
- * Revision 1.1.2.3 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:28 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.3 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +75 -71 zoap/src/org/zoap/xml/ElementException.java
Index: ElementException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/ElementException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ElementException.java 2000/08/10 21:07:28 1.1
+++ ElementException.java 2000/12/04 12:36:20 1.2
@@ -1,74 +1,84 @@
-/*
- * $Id: ElementException.java,v 1.1 2000/08/10 21:07:28 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * an exception that is thrown whenever something with elements has been broken.
- */
-
-public class ElementException extends AppearanceException {
-}
-
-/*
+/*
+ * $Id: ElementException.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * an exception that is thrown whenever something with elements has been broken.
+ */
+
+public class ElementException extends AppearanceException {
+}
+
+/*
* $Log: ElementException.java,v $
- * Revision 1.1 2000/08/10 21:07:28 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:28 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +451 -346 zoap/src/org/zoap/xml/Environment.java
Index: Environment.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Environment.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Environment.java 2000/08/10 21:07:29 1.1
+++ Environment.java 2000/12/04 12:36:20 1.2
@@ -1,349 +1,460 @@
-/*
- * $Id: Environment.java,v 1.1 2000/08/10 21:07:29 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import de.infor.ce.util.URN;
-
-import java.util.StringTokenizer;
-import java.util.Properties;
-
-import java.io.PrintStream;
-import java.io.InputStream;
-
-/**
- * Environment contains static variables and other helping stuff that either
influence
- * the compilation of the package or initialise its runtime environment from
config files.
- *
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public abstract class Environment {
-
- /**
- * whether debug messages are produced
- */
-
- public static final boolean DEBUG_XML=false;
- public static final boolean DEBUG_XML_META=false;
-
- /**
- * runtime logging settings
- */
-
- public static int LOG_XML=1;
- public static int LOG_XML_META=1;
-
- /**
- * the namespace prefix for schemas that are built up internally,
- * such as those generated from serializable java classes
- */
-
- final public static URN INTERNAL_URN=
- new URN(new String[] {"http://xml.zoap.org/"});
-
- /**
- * compile-time constants
- */
-
- public final static String PROPERTY="xml";
- public final static String CONFIG_FILE=PROPERTY+".conf";
-
- /**
- * runtime streams
- */
-
- public final static PrintStream out=System.out;
- public final static InputStream in=System.in;
- public final static PrintStream err=System.err;
-
- /**
- * initialisation is done at class loading time
- */
-
- static{
-
- if(DEBUG_XML)
- out.print(Environment.class.toString()+".static initializer\n");
-
- // clone the system settings
- Properties properties = new Properties(System.getProperties());
-
- try{
-
- // and add your personal configuration file
- properties.load(Thread.currentThread().getContextClassLoader().
- getResourceAsStream(CONFIG_FILE));
-
- } catch(Exception e) {
-
- if(DEBUG_XML || LOG_XML>0)
- err.print(Environment.class.toString()+".static initializer: "+
- " encountered "+e+" maybe config file does not exist. Using defaults.\n");
-
- }
-
- } // static
-
- /**
- * the line seperator that is used after a tag has been uttered
- * change this to "" if you like to save a few bytes ;-)
- */
-
- public final static String LINE_SEPERATOR="\r\n";
-
- /**
- * how java class features are encoded into XML tags
- * this must be a sign or a sequence of signs that cannot
- * occur in a fully qualified java class name
- * we use the minus sign, for the moment
- */
-
- public static final String FEATURE_SEPERATOR="-";
-
- /**
- * seperate a namespace prefix of a tag from its proper name
- */
-
- public static String getNameSpacePrefix(String tag) {
-
- if(Environment.DEBUG_XML)
- out.print(Environment.class.toString()+".getNameSpacePrefix("+tag+")\n");
-
- if(tag.indexOf(":")!=-1)
- return tag.substring(0,tag.indexOf(":"));
-
- return "";
- }
-
- /**
- * seperate the proper name of a tag from its namespace prefix
- */
-
- public static String getProperName(String tag) {
-
-
- if(Environment.DEBUG_XML)
- out.print(Environment.class.toString()+".getProperName("+tag+")\n");
-
- if(tag.indexOf(":")!=-1)
- return tag.substring(tag.indexOf(":")+1);
-
- return tag;
- }
-
- /**
- * if @arg properClassTag is a proper xml-tag that has been
- * generated for a serializable Java class, this function seperates
- * the feature part (e.g., whether its a method, an attribute,
- * or an array) from it
- */
- public static String getClassFeature(String properClassTag) {
-
- if(Environment.DEBUG_XML)
-
out.print(Environment.class.toString()+".getClassFeature("+properClassTag+")\n");
-
- if(properClassTag.indexOf(FEATURE_SEPERATOR)!=-1)
- return properClassTag.substring(properClassTag.indexOf(FEATURE_SEPERATOR)+
- FEATURE_SEPERATOR.length());
-
- return "";
- }
-
- /**
- * if @arg properClassTag is a proper xml-tag that has been
- * generated for a serializable Java class, this function seperates
- * the class part from it
- */
- public static String getProperClassName(String properClassTag) {
-
- if(Environment.DEBUG_XML)
-
out.print(Environment.class.toString()+".getProperClassName("+properClassTag+")\n");
-
- if(properClassTag.indexOf(FEATURE_SEPERATOR)!=-1)
- return properClassTag.substring(0,properClassTag.indexOf(FEATURE_SEPERATOR));
-
- return properClassTag;
- }
-
-
- /** turns a dedicated url into a class name */
- public static Class getClassForUrn(URN theUrn) throws ClassNotFoundException {
-
- if(Environment.DEBUG_XML)
- out.println(Environment.class+".getClassForUrn("+theUrn+")");
-
- String fullName=theUrn.toString();
-
- // look if we find the internal marker
- if(fullName.startsWith(INTERNAL_URN.toString())) {
-
- // convert the url-part into
- String className="";
-
- StringTokenizer tokenizer=new StringTokenizer(fullName.
- substring(INTERNAL_URN.toString().length()),"/");
-
- while(tokenizer.hasMoreTokens())
- className=className+tokenizer.nextToken()+".";
-
- if(className.length()>0) {
- className=className.substring(0,className.length()-1);
-
- return
Class.forName(className,true,Thread.currentThread().getContextClassLoader());
- }
- }
-
- throw new ClassNotFoundException();
- } // getClassForUrn
-
- /**
- * construct a correct shortname for that class
- */
-
- public static String getShortNameForClass(Class forClass) {
-
- if(Environment.DEBUG_XML)
- out.println(Environment.class+".getShortNameForClass("+forClass+")");
-
- // that is how we suffix arrays
- if(forClass.isArray())
- return
getShortNameForClass(forClass.getComponentType())+FEATURE_SEPERATOR+"Array";
-
- String className=forClass.getName();
-
- if(className.indexOf(".")!=-1)
- return(className.substring(className.lastIndexOf(".")+1));
-
- return className;
- }
-
- /**
- * how to encode an arbitrary UTF-string into an XML-shippable form
- */
-
- public static String encodeIntoXml(String output) {
-
- if(Environment.DEBUG_XML)
- out.println(Environment.class+".encodeIntoXml("+output+")");
-
- return output;
- }
-
- /**
- * how to decode an arbitrary UTF-string from the XML-shippable form
- */
-
- public static String decodeFromXml(String input) {
-
- if(Environment.DEBUG_XML)
- out.println(Environment.class+".decodeFromXml("+input+")");
-
- return input;
- }
-
- /**
- * how java classes are mapped to name spaces
- */
-
- public static String getNameSpaceForClass(Class forClass) {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
-
Environment.out.print(Environment.class.toString()+".getNameSpace("+forClass+")\n");
-
- // normal classes and arrays thereof share the same namespace
- if(forClass.isArray())
- return getNameSpaceForClass(forClass.getComponentType());
-
- String properClassName=forClass.getName();
- String nameSpace="";
-
- StringTokenizer tokenizer=new StringTokenizer(forClass.getName(),".");
-
- while(tokenizer.hasMoreTokens()) {
- nameSpace+=tokenizer.nextToken()+"/";
- }
-
- return nameSpace;
- }
-
-} // Environment
-
-/*
+/*
+ * $Id: Environment.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright (c) 2000 infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+package org.zoap.xml;
+
+import de.infor.ce.util.URN;
+
+import java.util.StringTokenizer;
+import java.util.Properties;
+
+import java.io.PrintStream;
+import java.io.InputStream;
+
+/**
+ * Environment contains static variables and other helping stuff that either
influence
+ * the compilation of the package or initialise its runtime environment from
config files.
+ *
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public abstract class Environment {
+
+ /**
+ * whether debug messages are produced
+ */
+
+ public static final boolean DEBUG_XML=false;
+ public static final boolean DEBUG_XML_META=false;
+
+ /**
+ * runtime logging settings
+ */
+
+ public static int LOG_XML=0;
+ public static int LOG_XML_META=0;
+
+ /**
+ * the namespace prefix for schemas that are built up internally,
+ * such as those generated from serializable java classes
+ */
+
+ final public static URN INTERNAL_URN=
+ new URN(new String[] {"http://xml.zoap.org/"});
+
+ /**
+ * compile-time constants
+ */
+
+ public final static String PROPERTY="xml";
+ public final static String CONFIG_FILE=PROPERTY+".conf";
+
+ /**
+ * runtime streams
+ */
+
+ public final static PrintStream out=System.out;
+ public final static InputStream in=System.in;
+ public final static PrintStream err=System.err;
+
+ /**
+ * the line seperator that is used after a tag has been uttered
+ * change this to "" if you like to save a few bytes ;-)
+ */
+
+ public final static String LINE_SEPERATOR= ""; //"\r\n";
+
+ /**
+ * how java class features are encoded into XML tags
+ * this must be a sign or a sequence of signs that cannot
+ * occur in a fully qualified java class name
+ * we use the minus sign, for the moment
+ */
+
+ public static final String FEATURE_SEPERATOR="-";
+
+ /**
+ * seperate a namespace prefix of a tag from its proper name
+ */
+
+ public static String getNameSpacePrefix(String tag) {
+
+ if(Environment.DEBUG_XML)
+ out.print(Environment.class.toString()+".getNameSpacePrefix("+tag+")\n");
+
+ if(tag.indexOf(":")!=-1)
+ return tag.substring(0,tag.indexOf(":"));
+
+ return "";
+ }
+
+ /**
+ * seperate the proper name of a tag from its namespace prefix
+ */
+
+ public static String getProperName(String tag) {
+
+
+ if(Environment.DEBUG_XML)
+ out.print(Environment.class.toString()+".getProperName("+tag+")\n");
+
+ if(tag.indexOf(":")!=-1)
+ return tag.substring(tag.indexOf(":")+1);
+
+ return tag;
+ }
+
+ /**
+ * if @arg properClassTag is a proper xml-tag that has been
+ * generated for a serializable Java class, this function seperates
+ * the feature part (e.g., whether its a method, an attribute,
+ * or an array) from it
+ */
+ public static String getClassFeature(String properClassTag) {
+
+ if(Environment.DEBUG_XML)
+
out.print(Environment.class.toString()+".getClassFeature("+properClassTag+")\n");
+
+ if(properClassTag.indexOf(FEATURE_SEPERATOR)!=-1)
+ return properClassTag.substring(properClassTag.indexOf(FEATURE_SEPERATOR)+
+ FEATURE_SEPERATOR.length());
+
+ return "";
+ }
+
+ /**
+ * if @arg properClassTag is a proper xml-tag that has been
+ * generated for a serializable Java class, this function seperates
+ * the class part from it
+ */
+ public static String getProperClassName(String properClassTag) {
+
+ if(Environment.DEBUG_XML)
+
out.print(Environment.class.toString()+".getProperClassName("+properClassTag+")\n");
+
+ if(properClassTag.indexOf(FEATURE_SEPERATOR)!=-1)
+ return properClassTag.substring(0,properClassTag.indexOf(FEATURE_SEPERATOR));
+
+ return properClassTag;
+ }
+
+
+ /** turns a dedicated url into a class name */
+ public static Class getClassForUrn(URN theUrn) throws ClassNotFoundException {
+
+ if(Environment.DEBUG_XML)
+ out.println(Environment.class+".getClassForUrn("+theUrn+")");
+
+ String fullName=theUrn.toString();
+
+ // look if we find the internal marker
+ if(fullName.startsWith(INTERNAL_URN.toString())) {
+
+ // convert the url-part into
+ String className="";
+
+ StringTokenizer tokenizer=new StringTokenizer(fullName.
+ substring(INTERNAL_URN.toString().length()),"/");
+
+ while(tokenizer.hasMoreTokens())
+ className=className+tokenizer.nextToken()+".";
+
+ if(className.length()>0) {
+ className=className.substring(0,className.length()-1);
+
+ return
Class.forName(className,true,Thread.currentThread().getContextClassLoader());
+ }
+ }
+
+ throw new ClassNotFoundException();
+ } // getClassForUrn
+
+ /**
+ * construct a correct shortname for that class
+ */
+
+ public static String getShortNameForClass(Class forClass) {
+
+ if(Environment.DEBUG_XML)
+ out.println(Environment.class+".getShortNameForClass("+forClass+")");
+
+ // that is how we suffix arrays
+ if(forClass.isArray())
+ return
getShortNameForClass(forClass.getComponentType())+FEATURE_SEPERATOR+"Array";
+
+ String className=forClass.getName();
+
+ if(className.indexOf(".")!=-1)
+ return(className.substring(className.lastIndexOf(".")+1));
+
+ return className;
+ }
+
+ /**
+ * how to encode an arbitrary UTF-string into an XML-shippable form
+ */
+
+ public static String encodeIntoXml(String output) {
+
+ if(Environment.DEBUG_XML)
+ out.println(Environment.class+".encodeIntoXml("+output+")");
+
+ char[] chs = output.toCharArray();
+ StringBuffer bf = new StringBuffer();
+
+ for (int i = 0; i < chs.length; i++)
+ {
+ char ch = chs[i];
+ int num = Character.getNumericValue(ch);
+ if (Character.isISOControl(ch) || num > 0x7e) {
+ bf.append("&#" + Integer.toString(num,16) + ";");
+ }
+ else {
+ switch (ch) {
+ // case '!': bf.append("!"); break;
+ case '"': bf.append("""); break;
+ // case '#': bf.append("#"); break;
+ // case '$': bf.append("$"); break;
+ // case '%': bf.append("%"); break;
+ case '&': bf.append("&"); break;
+ case '\'': bf.append("'"); break;
+ // case '(': bf.append("("); break;
+ // case ')': bf.append(")"); break;
+ // case '*': bf.append("*"); break;
+ // case '+': bf.append("+"); break;
+ // case ',': bf.append(","); break;
+ // case '-': bf.append("‐"); break;
+ // case '.': bf.append("."); break;
+ //case '/': bf.append("/"); break;
+ // case ':': bf.append("&col;"); break;
+ // case ';': bf.append(";"); break;
+ case '<': bf.append("<"); break;
+ // case '=': bf.append("="); break;
+ case '>': bf.append(">"); break;
+ // case '?': bf.append("?"); break;
+ // case '@': bf.append("@"); break;
+ // case '[': bf.append("["); break;
+ // case '\\': bf.append("\"); break;
+ // case ']': bf.append("]"); break;
+ case '^': bf.append("ˆ"); break;
+ // case '_': bf.append("―"); break;
+ // case 0x60: bf.append("`"); break;
+ // case '{': bf.append("{"); break;
+ // case '|': bf.append("|"); break;
+ // case '}': bf.append("}"); break;
+ case '~': bf.append("˜"); break;
+ default: bf.append(ch);
+ }
+ }
+ }
+ return bf.toString();
+ }
+
+ static String[] toBeDecoded = {
+ "#00","\000",
+ "#01","\001",
+ "#02","\002",
+ "#03","\003",
+ "#04","\004",
+ "#05","\005",
+ "#06","\006",
+ "#07","\007",
+ "#08","\010",
+ "#09","\011",
+ "#0A","\012",
+ "#0B","\013",
+ "#0C","\014",
+ "#0D","\015",
+ "#0E","\016",
+ "#0F","\017",
+ "#10","\020",
+ "#11","\021",
+ "#12","\022",
+ "#13","\023",
+ "#14","\024",
+ "#15","\025",
+ "#16","\026",
+ "#17","\027",
+ "#18","\030",
+ "#19","\031",
+ "#1A","\032",
+ "#1B","\033",
+ "#1C","\034",
+ "#1D","\035",
+ "#1E","\036",
+ "#1F","\037",
+ "excl","!",
+ "quot","\"",
+ "num","#",
+ "dollar","$",
+ "percnt","%",
+ "amp","&",
+ "apos","\'",
+ "lpar","(",
+ "rpar",")",
+ "ast","*",
+ "plus","+",
+ "comma",",",
+ "hyphen","-",
+ "period",".",
+ "sol","/",
+ "col",":",
+ "semi",";",
+ "lt","<",
+ "equals","=",
+ "gt",">",
+ "quest","?",
+ "commat","@",
+ "lsqb","[",
+ "bsol","\\",
+ "rsqb","]",
+ "circ","^",
+ "horbar","_",
+ "grave","^",
+ "lcub","{",
+ "verbar","|",
+ "rcub","}",
+ "tilde","~" };
+
+ static java.util.HashMap toBeDecodedMap;
+ {
+ toBeDecodedMap = new java.util.HashMap(toBeDecoded.length / 2);
+ for (int i = 0; i < toBeDecoded.length / 2; i++) {
+ toBeDecodedMap.put(toBeDecoded[i * 2],toBeDecoded[i*2 + 1]);
+ }
+ }
+
+ /**
+ * how to decode an arbitrary UTF-string from the XML-shippable form
+ */
+
+ public static String decodeFromXml(String input) {
+
+ if(Environment.DEBUG_XML)
+ out.println(Environment.class+".decodeFromXml("+input+")");
+
+ StringBuffer bf = new StringBuffer();
+ int pos = 0;
+ int slen = input.length();
+ do {
+ int newpos = input.indexOf('&',pos);
+ if (newpos < 0) {
+ bf.append(input.substring(pos));
+ break;
+ }
+ else {
+ bf.append(input.substring(pos,newpos-slen-1));
+ int semipos = input.indexOf(";",newpos);
+ if (semipos < 0)
+ throw new RuntimeException("decodeFromXml: & not closed by ;, should not
occur in homogenous env");
+ String ss = input.substring(newpos+1,semipos-newpos-2);
+ String replacement = (String)toBeDecodedMap.get(ss);
+ if (replacement == null)
+ throw new RuntimeException("decodeFromXml: & ... ; not decodable, should
not occur in homogenous env");
+ bf.append(replacement);
+ pos = newpos + 1;
+ }
+ }
+ while (pos < slen);
+
+ return bf.toString();
+ }
+
+ /**
+ * how java classes are mapped to name spaces
+ */
+
+ public static String getNameSpaceForClass(Class forClass) {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+
Environment.out.print(Environment.class.toString()+".getNameSpace("+forClass+")\n");
+
+ // normal classes and arrays thereof share the same namespace
+ if(forClass.isArray())
+ return getNameSpaceForClass(forClass.getComponentType());
+
+ String properClassName=forClass.getName();
+ String nameSpace="";
+
+ StringTokenizer tokenizer=new StringTokenizer(forClass.getName(),".");
+
+ while(tokenizer.hasMoreTokens()) {
+ nameSpace+=tokenizer.nextToken()+"/";
+ }
+
+ return nameSpace;
+ }
+
+} // Environment
+
+/*
* $Log: Environment.java,v $
- * Revision 1.1 2000/08/10 21:07:29 jung
- * Initial revision
- *
- * Revision 1.1.2.4 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.3 2000/07/20 14:35:27 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.2 2000/07/17 12:46:18 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.2.2.1 2000/07/07 12:42:41 jung
- * changed the method-request and response structure to be more
- * explicit instead of just serializable (such that MS-SOAP gets the
- * chance ot do something with that stuff).
- *
- * Revision 1.2 2000/07/06 16:55:06 jung
- * moved the default binding caches in order to make apartments
- * with different versions of the same class possible.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.2 2000/09/20 09:36:56 schoerk
+ * en-decoding of Strings
+ *
+ * Revision 1.1.1.1 2000/09/15 12:28:08 jung
+ * no message
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:29 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.4 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.3 2000/07/20 14:35:27 jung
+ * some refactoring inside infor:xml
+ *
+ * Revision 1.1.2.2 2000/07/17 12:46:18 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.2.2.1 2000/07/07 12:42:41 jung
+ * changed the method-request and response structure to be more
+ * explicit instead of just serializable (such that MS-SOAP gets the
+ * chance ot do something with that stuff).
+ *
+ * Revision 1.2 2000/07/06 16:55:06 jung
+ * moved the default binding caches in order to make apartments
+ * with different versions of the same class possible.
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
No revision
No revision
1.2 +75 -71 zoap/src/org/zoap/xml/IllegalSuperTypeException.java
Index: IllegalSuperTypeException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/IllegalSuperTypeException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IllegalSuperTypeException.java 2000/08/10 21:07:29 1.1
+++ IllegalSuperTypeException.java 2000/12/04 12:36:20 1.2
@@ -1,74 +1,84 @@
-/*
- * $Id: IllegalSuperTypeException.java,v 1.1 2000/08/10 21:07:29 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * an exception that is thrown when a wrong supertype of a type has tried to been
- * assigned.
- */
-public class IllegalSuperTypeException extends IllegalTypeException {
-}
-
-/*
+/*
+ * $Id: IllegalSuperTypeException.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * an exception that is thrown when a wrong supertype of a type has tried to been
+ * assigned.
+ */
+public class IllegalSuperTypeException extends IllegalTypeException {
+}
+
+/*
* $Log: IllegalSuperTypeException.java,v $
- * Revision 1.1 2000/08/10 21:07:29 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:29 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +75 -71 zoap/src/org/zoap/xml/IllegalTypeException.java
Index: IllegalTypeException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/IllegalTypeException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- IllegalTypeException.java 2000/08/10 21:07:30 1.1
+++ IllegalTypeException.java 2000/12/04 12:36:20 1.2
@@ -1,74 +1,84 @@
-/*
- * $Id: IllegalTypeException.java,v 1.1 2000/08/10 21:07:30 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * an exception that is thrown whenever a type is wrongly assigned
- */
-
-public class IllegalTypeException extends TypeException {
-}
-
-/*
+/*
+ * $Id: IllegalTypeException.java,v 1.2 2000/12/04 12:36:20 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * an exception that is thrown whenever a type is wrongly assigned
+ */
+
+public class IllegalTypeException extends TypeException {
+}
+
+/*
* $Log: IllegalTypeException.java,v $
- * Revision 1.1 2000/08/10 21:07:30 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:20 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:30 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +76 -72 zoap/src/org/zoap/xml/NoCompatibleElementException.java
Index: NoCompatibleElementException.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/xml/NoCompatibleElementException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NoCompatibleElementException.java 2000/08/10 21:07:30 1.1
+++ NoCompatibleElementException.java 2000/12/04 12:36:21 1.2
@@ -1,75 +1,85 @@
-/*
- * $Id: NoCompatibleElementException.java,v 1.1 2000/08/10 21:07:30 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * an exception that is thrown in XmlObjectWriter when no element for serialising
- * a particular object could be found
- */
-
-public class NoCompatibleElementException extends ElementException {
-}
-
-/*
+/*
+ * $Id: NoCompatibleElementException.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * an exception that is thrown in XmlObjectWriter when no element for serialising
+ * a particular object could be found
+ */
+
+public class NoCompatibleElementException extends ElementException {
+}
+
+/*
* $Log: NoCompatibleElementException.java,v $
- * Revision 1.1 2000/08/10 21:07:30 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:30 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +451 -447 zoap/src/org/zoap/xml/Schema.java
Index: Schema.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Schema.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Schema.java 2000/08/10 21:07:31 1.1
+++ Schema.java 2000/12/04 12:36:21 1.2
@@ -1,450 +1,460 @@
-/*
- * $Id: Schema.java,v 1.1 2000/08/10 21:07:31 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import de.infor.ce.util.URN;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * Schema is the Java interface to an XML schema. <br> A Schema consists of a set
of element, attribute, and type definitions
- * (where we have ommitted the direct references to attribute definitions in the
implementation because
- * of redundancies, for the moment) <br> The elements of a schema determine which
top-level appearances in an
- * XML document are legal in order to conform to that schema. Types determine
- * conformant element/attribute substructures of such documents (and documents that
are
- * evaluated in the context of this schema). <br> In infor:XML, schemas are
uniquely identified via their
- * Unique Resource Name. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class Schema {
-
- /** empty constructor */
- public Schema() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
-
- }
-
- /** access the internal urn */
- public URN getUrn() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getUrn()\n");
-
- return urn;
- }
-
- /** access the internal urn */
- public void setUrn(URN urn) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setUrn(" + urn + ")\n");
-
- this.urn = urn;
- }
-
- /**
- * registers an additional @arg element and returns the overwritten @return
Element. Uses
- * a lazy initialization of elements. element must be non-null, otherwise
@throws NullPointerException
- * and, in addition, must have a reasonable appearance name to be hashed
accordingly.
- * This is only needed for top-level elements and elements that should be
embedded
- * into other "container" elements. Otherwise, elements must not be registered
in the schema.
- */
-
- public Element addElement(Element element) throws NullPointerException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addElement(" + element +
")\n");
-
- try {
- return (Element)elements.put(element.getAppearanceName(),
element);
- } catch (NullPointerException e) {
-
- synchronized(this) {
- if (elements == null) {
- elements = new HashMap();
- }
- }
-
- return (Element)elements.put(element.getAppearanceName(),
element);
-
- } // try
-
- } // addElement
-
- /**
- * removes an @arg element and returns the removed @return Element.
- */
-
- public Element removeElement(Element element) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeElement(" + element
+ ")\n");
-
- try{
- return (Element)elements.remove(element.getAppearanceName());
- } catch(NullPointerException e) {
- return null;
- }
-
- } // removeElement
-
- /**
- * returns a top-level element registered in this schema under the given name
- * return null if not registered. This method is used when
- * deserialising documents using this schema as a namespace reference.
- * This is only needed for top-level elements and elements that should be
embedded
- * into other "container" elements. Otherwise, elements must not be registered
in the schema.
- */
-
- public Element getElement(String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getElement(" + name +
")\n");
-
- try{
- return (Element) elements.get(name);
- } catch(NullPointerException e) {
- return null;
- }
-
- }
-
- /**
- * registers an additional @arg type and returns the overwritten @return Type.
Uses
- * a lazy initialization of elements. element must be non-null, otherwise
@throws
- * NullPointerException.
- * If certain types should not be used in a polymorphic context,
- * you do not have to register them in the schema.
- */
-
- public Type addType(Type type) throws NullPointerException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addType(" + type + ")\n");
-
- try{
- return (Type)types.put(type.getTypeName(), type);
- } catch(NullPointerException e) {
-
- synchronized(this) {
- if (types == null)
- types = new HashMap();
- }
-
- return (Type)types.put(type.getTypeName(), type);
- }
- }
-
- /** removes a @arg type and returns the removed @return Type */
- public Type removeType(Type type) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeType(" + type +
")\n");
-
- try{
- return (Type)types.remove(type.getTypeName());
- } catch(NullPointerException e) {
- return null;
- }
-
- }
-
- /**
- * returns a type registered in this schema under the given name
- * return null if not registered. Is used to support polymorphism in
deserialisation.
- * If certain types should not be used in a polymorphic context,
- * you do not have to register them in the schema.
- */
-
- public Type getType(String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getType(" + name + ")\n");
-
- try{
- return (Type)types.get(name);
- } catch(NullPointerException e) {
- return null;
- }
- }
-
- /**
- * registers an additional @arg attribute and returns the overwritten @return
Attribuet. Uses
- * a lazy initialization of attributes. attribute must be non-null,
- * otherwise @throws NullPointerException and, in addition, must have a
reasonable
- * appearance name to be hashed accordingly.
- * attribute references in schemas (as opposed to types)
- * are currently not used at all, so you do not have to register them.
- */
-
- public Attribute addAttribute(Attribute attribute) throws NullPointerException
{
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addAttribute(" +
attribute + ")\n");
-
- try {
- return
(Attribute)attributes.put(attribute.getAppearanceName(), attribute);
- } catch (NullPointerException e) {
-
- synchronized(this) {
- if (attributes == null) {
- attributes = new HashMap();
- }
- }
-
- return
(Attribute)attributes.put(attribute.getAppearanceName(), attribute);
-
- } // try
-
- } // addAttribute
-
- /**
- * removes an @arg attribute and returns the removed @return Attribute.
- */
-
- public Attribute removeAttribute(Attribute attribute) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeAttribute(" +
attribute + ")\n");
-
- try{
- return (Attribute)attributes.remove(attribute.getAppearanceName());
- } catch(NullPointerException e) {
- return null;
- }
-
- } // removeElement
-
- /**
- * returns a top-level @arg Attribute registered in this schema under the
given name
- * return null if not registered.
- */
-
- public Attribute getAttribute(String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getAttribute(" + name +
")\n");
-
- try{
- return (Attribute) attributes.get(name);
- } catch(NullPointerException e) {
- return null;
- }
-
- }
-
- /**
- * returns the hash code of the urn, if present. Else returns the standard
hashCode.
- * Be aware that changing the urn on the fly hence can have unwanted effects in
hashmaps, etc.
- */
-
- public int hashCode() {
-
- try{
- return urn.hashCode();
- } catch(NullPointerException e) {
- return super.hashCode();
- }
-
- }
-
- /** returns pointer-wise or urn-wise equality */
- public boolean equals(Object other) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".equals(" + other + ")\n");
-
- try{
- return (other==this || urn.equals(((Schema)other).urn));
- } catch(NullPointerException e) {
- return false;
- } catch(ClassCastException e) {
- return false;
- }
- }
-
- /**
- * looks through the registered elements to find some @return Element whose
- * type is compatible with the given @arg clazz. Is implemented in a very
naive way by
- * stepping through the registered elements and asking their type for support.
Is not
- * too bad, because it is normalyy just called to find out the initial hook into
- * the meta-model.
- */
-
- public Element findElementCompatibleTo(Object object, Class clazz) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".findElementCompatibleTo("
+ object + "," + clazz + ")\n");
-
- try{
- Iterator allElements = elements.values().iterator();
-
- while (allElements.hasNext()) {
- Element currentElement = (Element)allElements.next();
-
- if
(currentElement.getType(object).isCompatibleTo(object, clazz))
- return currentElement;
- } // while
-
- return null;
-
- } catch(NullPointerException e) {
- return null;
- }
-
- } // findElementCompatibleTo
-
- /**
- * looks through the registered types to find some @return Element whose
- * type is comptible with the given @arg clazz. Is implemented in a very naive
way by
- * stepping through the registered types and asking them for their support.
This is critical,
- * since it is called very often. We must probably enhance the meta-model to
support this
- * efficiently.
- */
-
- public Type findTypeCompatibleTo(Object object, Class clazz) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".findTypeCompatibleTo(" +
object + "," + clazz + ")\n");
-
- try{
- Iterator allTypes = types.values().iterator();
-
- while (allTypes.hasNext()) {
- Type currentType = (Type)allTypes.next();
-
- if (currentType.isCompatibleTo(object, clazz))
- return currentType;
- } // while
-
- return null;
- } catch(NullPointerException e) {
- return null;
- }
-
- } // findTypeCompatibleTo
-
- /**
- * Each schema is identified via a unique URN.
- * @directed
- * @label identifier
- * @supplierCardinality 1
- */
-
- private URN urn;
-
- /**
- * each schema explodes into parts each of which are uniquely indexed via
their name
- * @label registeredElements
- * @clientCardinality 1
- * @supplierCardinality *
- * @undirected
- * @link aggregation
- */
-
- /*#Element element;*/
-
- private Map elements;
-
- /**
- * each schema explodes into parts each of which are uniquely indexed via
their name
- * @label registeredTypes
- * @clientCardinality 1
- * @supplierCardinality *
- * @undirected
- * @link aggregation
- */
-
- /*#Type type;*/
-
- private Map types;
-
- /**
- * each schema explodes into parts each of which are uniquely indexed via
their name
- * @label registeredAttributes
- * @clientCardinality 1
- * @supplierCardinality *
- * @undirected
- * @link aggregation
- */
-
- /*#Attribute attribute;*/
-
- private Map attributes;
-
-}
-
-/*
+/*
+ * $Id: Schema.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import de.infor.ce.util.URN;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Schema is the Java interface to an XML schema. <br> A Schema consists of a set
of element, attribute, and type definitions
+ * (where we have ommitted the direct references to attribute definitions in the
implementation because
+ * of redundancies, for the moment) <br> The elements of a schema determine which
top-level appearances in an
+ * XML document are legal in order to conform to that schema. Types determine
+ * conformant element/attribute substructures of such documents (and documents that
are
+ * evaluated in the context of this schema). <br> In infor:XML, schemas are
uniquely identified via their
+ * Unique Resource Name. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class Schema {
+
+ /** empty constructor */
+ public Schema() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "()\n");
+
+ }
+
+ /** access the internal urn */
+ public URN getUrn() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getUrn()\n");
+
+ return urn;
+ }
+
+ /** access the internal urn */
+ public void setUrn(URN urn) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setUrn(" + urn + ")\n");
+
+ this.urn = urn;
+ }
+
+ /**
+ * registers an additional @arg element and returns the overwritten @return
Element. Uses
+ * a lazy initialization of elements. element must be non-null, otherwise
@throws NullPointerException
+ * and, in addition, must have a reasonable appearance name to be hashed
accordingly.
+ * This is only needed for top-level elements and elements that should be
embedded
+ * into other "container" elements. Otherwise, elements must not be registered
in the schema.
+ */
+
+ public Element addElement(Element element) throws NullPointerException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addElement(" + element +
")\n");
+
+ try {
+ return (Element)elements.put(element.getAppearanceName(),
element);
+ } catch (NullPointerException e) {
+
+ synchronized(this) {
+ if (elements == null) {
+ elements = new HashMap();
+ }
+ }
+
+ return (Element)elements.put(element.getAppearanceName(),
element);
+
+ } // try
+
+ } // addElement
+
+ /**
+ * removes an @arg element and returns the removed @return Element.
+ */
+
+ public Element removeElement(Element element) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeElement(" + element
+ ")\n");
+
+ try{
+ return (Element)elements.remove(element.getAppearanceName());
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ } // removeElement
+
+ /**
+ * returns a top-level element registered in this schema under the given name
+ * return null if not registered. This method is used when
+ * deserialising documents using this schema as a namespace reference.
+ * This is only needed for top-level elements and elements that should be
embedded
+ * into other "container" elements. Otherwise, elements must not be registered
in the schema.
+ */
+
+ public Element getElement(String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getElement(" + name +
")\n");
+
+ try{
+ return (Element) elements.get(name);
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ }
+
+ /**
+ * registers an additional @arg type and returns the overwritten @return Type.
Uses
+ * a lazy initialization of elements. element must be non-null, otherwise
@throws
+ * NullPointerException.
+ * If certain types should not be used in a polymorphic context,
+ * you do not have to register them in the schema.
+ */
+
+ public Type addType(Type type) throws NullPointerException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addType(" + type + ")\n");
+
+ try{
+ return (Type)types.put(type.getTypeName(), type);
+ } catch(NullPointerException e) {
+
+ synchronized(this) {
+ if (types == null)
+ types = new HashMap();
+ }
+
+ return (Type)types.put(type.getTypeName(), type);
+ }
+ }
+
+ /** removes a @arg type and returns the removed @return Type */
+ public Type removeType(Type type) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeType(" + type +
")\n");
+
+ try{
+ return (Type)types.remove(type.getTypeName());
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ }
+
+ /**
+ * returns a type registered in this schema under the given name
+ * return null if not registered. Is used to support polymorphism in
deserialisation.
+ * If certain types should not be used in a polymorphic context,
+ * you do not have to register them in the schema.
+ */
+
+ public Type getType(String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getType(" + name + ")\n");
+
+ try{
+ return (Type)types.get(name);
+ } catch(NullPointerException e) {
+ return null;
+ }
+ }
+
+ /**
+ * registers an additional @arg attribute and returns the overwritten @return
Attribuet. Uses
+ * a lazy initialization of attributes. attribute must be non-null,
+ * otherwise @throws NullPointerException and, in addition, must have a
reasonable
+ * appearance name to be hashed accordingly.
+ * attribute references in schemas (as opposed to types)
+ * are currently not used at all, so you do not have to register them.
+ */
+
+ public Attribute addAttribute(Attribute attribute) throws NullPointerException
{
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addAttribute(" +
attribute + ")\n");
+
+ try {
+ return
(Attribute)attributes.put(attribute.getAppearanceName(), attribute);
+ } catch (NullPointerException e) {
+
+ synchronized(this) {
+ if (attributes == null) {
+ attributes = new HashMap();
+ }
+ }
+
+ return
(Attribute)attributes.put(attribute.getAppearanceName(), attribute);
+
+ } // try
+
+ } // addAttribute
+
+ /**
+ * removes an @arg attribute and returns the removed @return Attribute.
+ */
+
+ public Attribute removeAttribute(Attribute attribute) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeAttribute(" +
attribute + ")\n");
+
+ try{
+ return (Attribute)attributes.remove(attribute.getAppearanceName());
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ } // removeElement
+
+ /**
+ * returns a top-level @arg Attribute registered in this schema under the
given name
+ * return null if not registered.
+ */
+
+ public Attribute getAttribute(String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getAttribute(" + name +
")\n");
+
+ try{
+ return (Attribute) attributes.get(name);
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ }
+
+ /**
+ * returns the hash code of the urn, if present. Else returns the standard
hashCode.
+ * Be aware that changing the urn on the fly hence can have unwanted effects in
hashmaps, etc.
+ */
+
+ public int hashCode() {
+
+ try{
+ return urn.hashCode();
+ } catch(NullPointerException e) {
+ return super.hashCode();
+ }
+
+ }
+
+ /** returns pointer-wise or urn-wise equality */
+ public boolean equals(Object other) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".equals(" + other + ")\n");
+
+ try{
+ return (other==this || urn.equals(((Schema)other).urn));
+ } catch(NullPointerException e) {
+ return false;
+ } catch(ClassCastException e) {
+ return false;
+ }
+ }
+
+ /**
+ * looks through the registered elements to find some @return Element whose
+ * type is compatible with the given @arg clazz. Is implemented in a very
naive way by
+ * stepping through the registered elements and asking their type for support.
Is not
+ * too bad, because it is normalyy just called to find out the initial hook into
+ * the meta-model.
+ */
+
+ public Element findElementCompatibleTo(Object object, Class clazz) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".findElementCompatibleTo("
+ object + "," + clazz + ")\n");
+
+ try{
+ Iterator allElements = elements.values().iterator();
+
+ while (allElements.hasNext()) {
+ Element currentElement = (Element)allElements.next();
+
+ if
(currentElement.getType(object).isCompatibleTo(object, clazz))
+ return currentElement;
+ } // while
+
+ return null;
+
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ } // findElementCompatibleTo
+
+ /**
+ * looks through the registered types to find some @return Element whose
+ * type is comptible with the given @arg clazz. Is implemented in a very naive
way by
+ * stepping through the registered types and asking them for their support.
This is critical,
+ * since it is called very often. We must probably enhance the meta-model to
support this
+ * efficiently.
+ */
+
+ public Type findTypeCompatibleTo(Object object, Class clazz) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".findTypeCompatibleTo(" +
object + "," + clazz + ")\n");
+
+ try{
+ Iterator allTypes = types.values().iterator();
+
+ while (allTypes.hasNext()) {
+ Type currentType = (Type)allTypes.next();
+
+ if (currentType.isCompatibleTo(object, clazz))
+ return currentType;
+ } // while
+
+ return null;
+ } catch(NullPointerException e) {
+ return null;
+ }
+
+ } // findTypeCompatibleTo
+
+ /**
+ * Each schema is identified via a unique URN.
+ * @directed
+ * @label identifier
+ * @supplierCardinality 1
+ */
+
+ private URN urn;
+
+ /**
+ * each schema explodes into parts each of which are uniquely indexed via
their name
+ * @label registeredElements
+ * @clientCardinality 1
+ * @supplierCardinality *
+ * @undirected
+ * @link aggregation
+ */
+
+ /*#Element element;*/
+
+ private Map elements;
+
+ /**
+ * each schema explodes into parts each of which are uniquely indexed via
their name
+ * @label registeredTypes
+ * @clientCardinality 1
+ * @supplierCardinality *
+ * @undirected
+ * @link aggregation
+ */
+
+ /*#Type type;*/
+
+ private Map types;
+
+ /**
+ * each schema explodes into parts each of which are uniquely indexed via
their name
+ * @label registeredAttributes
+ * @clientCardinality 1
+ * @supplierCardinality *
+ * @undirected
+ * @link aggregation
+ */
+
+ /*#Attribute attribute;*/
+
+ private Map attributes;
+
+}
+
+/*
* $Log: Schema.java,v $
- * Revision 1.1 2000/08/10 21:07:31 jung
- * Initial revision
- *
- * Revision 1.1.2.3 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:31 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.3 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +63 -59 zoap/src/org/zoap/xml/SchemaException.java
Index: SchemaException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/SchemaException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SchemaException.java 2000/08/10 21:07:31 1.1
+++ SchemaException.java 2000/12/04 12:36:21 1.2
@@ -1,62 +1,72 @@
-/*
- * $Id: SchemaException.java,v 1.1 2000/08/10 21:07:31 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * an exception that is thrown inside schemas
- */
-
-public class SchemaException extends XmlException {
-}
-
-/*
+/*
+ * $Id: SchemaException.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * an exception that is thrown inside schemas
+ */
+
+public class SchemaException extends XmlException {
+}
+
+/*
* $Log: SchemaException.java,v $
- * Revision 1.1 2000/08/10 21:07:31 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- */
\ No newline at end of file
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:31 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ */
No revision
No revision
1.2 +214 -208 zoap/src/org/zoap/xml/SimpleType.java
Index: SimpleType.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/SimpleType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SimpleType.java 2000/08/10 21:07:32 1.1
+++ SimpleType.java 2000/12/04 12:36:21 1.2
@@ -1,211 +1,223 @@
-/*
- * $Id: SimpleType.java,v 1.1 2000/08/10 21:07:32 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * Simple Xml types are quite like primitive Java types. <br>
- * They occur as elements or attributes with a single body. And they can only
subclass primitive types. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class SimpleType extends Type {
-
- /** empty constructor */
- public SimpleType() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
-
- }
-
- /**
- * simple types can only inherit from simple types the supertype
- * @label superType
- * @clientCardinality *
- * @supplierCardinality 0..1
- * @directed
- */
-
- /*#SimpleType superType;*/
-
- final public void setSuperType(Type superType) throws
IllegalSuperTypeException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setSuperType(" +
superType + ")\n");
-
- if (superType instanceof SimpleType)
- setSuperType((SimpleType) superType);
- else
- throw new IllegalSuperTypeException();
-
- }
-
- final public void setSuperType(SimpleType superType) {
-
- try{
- super.setSuperType(superType);
- } catch(IllegalTypeException e) {
- // is not thrown in fact
- }
-
- }
-
-
- final public Attribute addAttribute(Attribute attribute) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addAttributes(" +
attribute + ")\n");
-
- throw new UnsupportedOperationException();
- }
-
- final public Attribute removeAttribute(Attribute attribute) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeAttribute(" +
attribute + ")\n");
-
- return null;
- }
-
- /** produce a collection of attributes belonging to that type - defaults to
null */
- final public Attribute[] getAttributes(Object object) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getAttributes(" + object
+ ")\n");
-
- return null;
- }
-
- final public Element addElement(Element element) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addElement(" + element +
")\n");
-
- throw new UnsupportedOperationException();
- }
-
- final public Element removeElement(Element element) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addElement(" + element +
")\n");
-
- throw new UnsupportedOperationException();
- }
-
-
- /** produce a collection of elements belonging to that type - defaults to null */
- final public Element[] getElements(Object object) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getElements(" + object +
")\n");
-
- return null;
- }
-
- /** accesses an attribute in that type indexed by its schema and name -
defaults to null */
- final public Attribute getAttribute(Schema schema, String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getAttribute(" + schema +
"," + name + ")\n");
-
- return null;
- }
-
- /** accesses a sub-element in that type indexed by its schema and name -
defaults to null */
- final public Element getElement(Schema schema, String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getElement(" + schema +
"," + name + ")\n");
-
- return null;
- }
-
- /** simple types cannot be referenced by ID attributes */
- final public boolean isReferencable() {
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".isReferencable()\n");
-
- return super.isReferencable();
- }
-
-
-}
-
-/*
+/*
+ * $Id: SimpleType.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * Simple Xml types are quite like primitive Java types. <br>
+ * They occur as elements or attributes with a single body. And they can only
subclass primitive types. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class SimpleType extends Type {
+
+ /** empty constructor */
+ public SimpleType() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "()\n");
+
+ }
+
+ /**
+ * simple types can only inherit from simple types the supertype
+ * @label superType
+ * @clientCardinality *
+ * @supplierCardinality 0..1
+ * @directed
+ */
+
+ /*#SimpleType superType;*/
+
+ final public void setSuperType(Type superType) throws
IllegalSuperTypeException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setSuperType(" +
superType + ")\n");
+
+ if (superType instanceof SimpleType)
+ setSuperType((SimpleType) superType);
+ else
+ throw new IllegalSuperTypeException();
+
+ }
+
+ final public void setSuperType(SimpleType superType) {
+
+ try{
+ super.setSuperType(superType);
+ } catch(IllegalTypeException e) {
+ // is not thrown in fact
+ }
+
+ }
+
+
+ final public Attribute addAttribute(Attribute attribute) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addAttributes(" +
attribute + ")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ final public Attribute removeAttribute(Attribute attribute) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeAttribute(" +
attribute + ")\n");
+
+ return null;
+ }
+
+ /** produce a collection of attributes belonging to that type - defaults to
null */
+ final public Attribute[] getAttributes(Object object) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getAttributes(" + object
+ ")\n");
+
+ return null;
+ }
+
+ final public Element addElement(Element element) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addElement(" + element +
")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ final public Element removeElement(Element element) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addElement(" + element +
")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+
+ /** produce a collection of elements belonging to that type - defaults to null */
+ final public Element[] getElements(Object object) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getElements(" + object +
")\n");
+
+ return null;
+ }
+
+ /** accesses an attribute in that type indexed by its schema and name -
defaults to null */
+ final public Attribute getAttribute(Schema schema, String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getAttribute(" + schema +
"," + name + ")\n");
+
+ return null;
+ }
+
+ /** accesses a sub-element in that type indexed by its schema and name -
defaults to null */
+ final public Element getElement(Schema schema, String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getElement(" + schema +
"," + name + ")\n");
+
+ return null;
+ }
+
+ /** simple types cannot be referenced by ID attributes */
+ final public boolean isReferencable() {
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".isReferencable()\n");
+
+ return super.isReferencable();
+ }
+
+
+
+
+}
+
+/*
* $Log: SimpleType.java,v $
- * Revision 1.1 2000/08/10 21:07:32 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.2 2000/07/20 14:35:28 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1.2.1 2000/07/11 08:08:34 jung
- * added functionality to store retrieve a part of a types elements
- * within "ignored" strings. Useful for writing generic handlers that
- * just process a part of the XML and transfer the rest.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:32 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.2 2000/07/20 14:35:28 jung
+ * some refactoring inside infor:xml
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1.2.1 2000/07/11 08:08:34 jung
+ * added functionality to store retrieve a part of a types elements
+ * within "ignored" strings. Useful for writing generic handlers that
+ * just process a part of the XML and transfer the rest.
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +627 -563 zoap/src/org/zoap/xml/Type.java
Index: Type.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/Type.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Type.java 2000/08/10 21:07:33 1.1
+++ Type.java 2000/12/04 12:36:21 1.2
@@ -1,566 +1,636 @@
-/*
- * $Id: Type.java,v 1.1 2000/08/10 21:07:33 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.Collection;
-import java.util.ArrayList;
-
-/**
- * The infor:XML interface to types. <br> XML types determine sub-structures inside
an XML document in terms of attribute,
- * element, and raw character appearances. XML types are arranged in inheritance
hierarchies quite as traditional classes are.
- * <br> XML types hence correspond quite naturally to Java classes. Thus, in
infor:X,
- * each XML type is associated with a compatible Java class from which any type
- * appearance can be derived in writing and whose instances the type can manipulate
in reading. <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-
-public class Type {
-
- /** empty constructor */
- public Type() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "()\n");
-
- }
-
- /** access the supertype @return Type of this type */
- public Type getSuperType() {
- return superType;
- }
-
-
- /** set the superType */
- public void setSuperType(Type type) throws IllegalSuperTypeException {
- superType = type;
- }
-
- /** method that decides whether this type is the supertype of the @arg type. */
-
- public boolean isSuperTypeOf(Type type) throws NullPointerException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".isSuperTypeOf(" + type +
")\n");
-
- if (equals(type.getSuperType()))
- return true;
- else if (type.getSuperType() != null)
- return isSuperTypeOf(type.getSuperType());
- else
- return false;
- }
-
- /**
- * this method decides whether the current type can be used to serialise @arg
object under the given @arg class.
- * The default uses equality to the associated class, but could be extended
- * or more special cases if needed. Note that once a type feels responsible
for a particular class, it could override
- * other types that could also utter different views onto such objects wrt. to
polymorphism.
- */
-
- public boolean isCompatibleTo(Object object, Class clazz) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".isCompatibleTo(" +
object+","+clazz + ")\n");
-
- if (associatedClass != null)
- return associatedClass.equals(clazz);
- else
- return false;
-
- }
-
- /** gets the class associated to that type */
- public Class getAssociatedClass() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getAssociatedClass()\n");
-
- return associatedClass;
- }
-
- /** sets the class associated to that type */
- public void setAssociatedClass(Class clazz) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "setAssociatedClass(" +
clazz + ")\n");
-
- this.associatedClass = clazz;
- }
-
- /**
- * produce a printable "body" representation @return Object apparent in the
given
- * java @arg object. May @throws TypeException if the object is not
- * compatible with the given type (which should not happen internally) or
- * refuses access to its internal structure. Is used for serialisation
purposes.
- */
-
- public String getContent(Object object) throws TypeException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + "getContent(" + object +
")\n");
-
- return null;
- }
-
- /**
- * produce a printable "verbose" representation @return Object of the elements
- * apparent in the given java @arg object. May @throws TypeException if the
object is not
- * compatible with the given type (which should not happen internally) or
- * refuses access to its internal structure. Is used for serialisation
purposes.
- */
- public String getVerboseElements(Object object) throws TypeException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getVerboseElements(" +
object + ")\n");
-
- return null;
- }
-
- /** per-default, types are not referenceable */
- public boolean isReferencable() {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".isReferencable()\n");
-
- return false;
- }
-
- /**
- * creates a new Java object @return Object of a class compatible to that type
- * under the given references and namespaces and incorporate the given
- * Map of attributes to it. The attributes map (which could be null to
indicate emptyness)
- * is cleared from any attributes
- * that have been successfully applied. This method makes use of an object
factory
- * to allow configurable mapping of interfaces to concrete implementations
- * and easy customisation.
- */
-
- public Object newInstance(Map attributes, Map references, Map nameSpaces)
throws TypeException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".newInstance(" +
attributes + "," + references +
- "," + nameSpaces + ")\n");
-
- if (associatedClass != null) {
- try {
- Object target = getAssociatedClass().newInstance();
-
- if (attributes != null) {
-
- Iterator iterator =
attributes.keySet().iterator();
-
- while (iterator.hasNext()) {
-
- Attribute attribute =
(Attribute)iterator.next();
-
- try {
-
- target = attribute.setAttributeContent(target,
- attributes.get(attribute),
references, nameSpaces);
-
- } catch (AttributeException e) {
-
- if ((Environment.DEBUG_XML &&
Environment.DEBUG_XML_META) ||
- (Environment.LOG_XML > 0 &&
Environment.LOG_XML_META > 0)) {
-
-
Environment.err.print(toString() + ".newInstance(" + attributes + "," +
- references + "," +
nameSpaces + "): encountered attribute exception " + e + "\n");
-
- }
-
- iterator.remove();
-
- }
-
- } // while
- }
-
- return target;
-
- } catch (IllegalAccessException e) {
- throw new TypeException();
- } catch (InstantiationException e) {
- throw new TypeException();
- } // try
- } else
- return null;
- }
-
- /**
- * incorporate the parsed appearance @arg body and non-validated @arg
verboseElements into the
- * state of the @arg target object under the given @arg references and @arg
nameSpaces. Produces a
- * new target @return Object.
- */
-
- public Object setContent(Object target, String body, String verboseElements,
- Map references, Map nameSpaces) throws TypeException {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setContent(" + target +
"," + body + "," +
- verboseElements + references+","+nameSpaces+")\n");
-
- return target;
- }
-
- /** returns the @return Schema that this part belongs to */
- public Schema getTypeSchema() {
- return typeSchema;
- }
-
- /** sets the @arg schema that this part belongs to */
- public void setTypeSchema(Schema typeSchema) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setTypeSchema(" +
typeSchema + ")\n");
-
- this.typeSchema = typeSchema;
- }
-
- /** get the @return String -based name of that part within the schema */
- public String getTypeName() {
- return typeName;
- }
-
- /** set the @arg name of that part within the schema */
- public void setTypeName(String typeName) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".setTypeName(" + typeName
+ ")\n");
-
- this.typeName = typeName;
- }
-
- /** overrides the default equals method to cater for schema and name-based
equality */
- public boolean equals(Object other) {
-
- try {
- return (this == other ||
(typeName.equals(((Type)other).typeName) &&
- typeSchema.equals(((Type)other).typeSchema)));
- } catch (ClassCastException e) {
- return false;
- } catch (NullPointerException e) {
- return false;
- }
-
- }
-
- /** overrides the default hashCode implementation to coincide with above
equality concept */
-
- public int hashCode() {
-
- // only if both schema and name are non-null
- try {
- return typeSchema.hashCode() + typeName.hashCode();
- } catch (NullPointerException e) {
- return super.hashCode();
- }
-
- }
-
-
- /** this method determines whether the type requires element information to be
uniquely referenceable */
-
- public boolean isStateless() { return false; }
-
- /**
- * produce an array of elements @return Element[] belonging just to that type
- * and apparent in the @arg object. may return null, if the type does not
- * support any elements or if the object does not have any elements apparant.
Is used when serializing the object.
- */
- public Element[] getElements(Object object) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getElements(" + object +
")\n");
-
- // we must first flatten the substructure
- if (elements != null) {
- Iterator schemaMapIterator = elements.values().iterator();
- Collection result = new ArrayList(5);
-
- while (schemaMapIterator.hasNext())
-
result.addAll(((Map)schemaMapIterator.next()).values());
-
- return (Element[]) result.toArray((Object[]) new
Element[result.size()]);
- }
-
- return null;
- }
-
- /**
- * produce an array of attributes @return Attribute[] belonging just to that
type and
- * apparent in the @arg object. may return null, if the type does not
- * support any attributes or if the object has no attributes apparent.
- * Is used to serialize the given object into XML. @throws TypeException
- * if the object is not compatible with this type (which should not happen
internally) or
- * refuses to give its iternal structure free.
- */
- public Attribute[] getAttributes(Object object) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getAttributes(" + object
+ ")\n");
-
- // first flatten that crazy two-level structure
- if (attributes != null) {
- Iterator schemaMapIterator = attributes.values().iterator();
- Collection result = new ArrayList(5);
-
- while (schemaMapIterator.hasNext())
-
result.addAll(((Map)schemaMapIterator.next()).values());
-
- return (Attribute[]) result.toArray((Object[]) new
Attribute[result.size()]);
- }
-
- return null;
- }
-
- /** registers an additional @arg element and returns the overwritten @return
Element. Uses a lazy initialization of elements */
- public Element addElement(Element element) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addElement(" + element +
")\n");
-
- if (elements == null)
- synchronized(this) {
- if (elements == null)
- elements = new HashMap();
- }
-
- Map schemaMap = (Map)elements.get(element.getAppearanceSchema());
-
- if (schemaMap == null)
- synchronized(elements) {
- schemaMap =
(Map)elements.get(element.getAppearanceSchema());
- if (schemaMap == null) {
- schemaMap = new HashMap();
- elements.put(element.getAppearanceSchema(),
schemaMap);
- }
- }
-
- return (Element)schemaMap.put(element.getAppearanceName(), element);
- }
-
- /** removes an @arg element and returns the removed @return Element, should
operate recursively */
- public Element removeElement(Element element) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeElement(" + element
+ ")\n");
-
- if (elements != null) {
- Map schemaMap =
(Map)elements.get(element.getAppearanceSchema());
- if (schemaMap != null)
- return
(Element)schemaMap.remove(element.getAppearanceName());
- else
- return null;
- } else
- return null;
- }
-
- /**
- * accesses a sub-element in that type (and possibly defined by its
supertypes) indexed by its schema and name
- * returns null if the specified element is not supported. Is used when
deserialising an element.
- */
- public Element getElement(Schema schema, String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getElement(" + schema +
"," + name + ")\n");
-
- if (schema != null) {
-
- if (elements != null) {
- Map schemaMap = (Map)elements.get(schema);
- if (schemaMap != null) {
- Element element = (Element)schemaMap.get(name);
- if (element != null)
- return element;
- }
- }
-
- if (getSuperType() != null)
- return getSuperType().getElement(schema, name);
- else
- return null;
-
- } else
- return null;
- }
-
- /**
- * registers an additional @arg attribute and returns the overwritten @return
Attribute. Uses
- * lazy initialization of attributes.
- */
- public Attribute addAttribute(Attribute attribute) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".addAttribute(" +
attribute + ")\n");
-
- if (attributes == null)
- synchronized(this) {
- if (attributes == null)
- attributes = new HashMap();
- }
-
- Map schemaMap = (Map)attributes.get(attribute.getAppearanceSchema());
-
- if (schemaMap == null)
- synchronized(attributes) {
- schemaMap =
(Map)attributes.get(attribute.getAppearanceSchema());
- if (schemaMap == null) {
- schemaMap = new HashMap();
-
-
attributes.put(attribute.getAppearanceSchema(), schemaMap);
- }
- }
-
- return (Attribute)schemaMap.put(attribute.getAppearanceName(),
attribute);
- }
-
- /** removes an @arg attribute and returns the removed @return Attribute */
- public Attribute removeAttribute(Attribute attribute) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".removeAttribute(" +
attribute + ")\n");
-
- if (attributes != null) {
- Map schemaMap =
(Map)attributes.get(attribute.getAppearanceSchema());
- if (schemaMap != null)
- return
(Attribute)schemaMap.remove(attribute.getAppearanceName());
- else
- return null;
- } else
- return null;
- }
-
- /**
- * accesses an attribute in that type (that is possibly defined in one of its
supertypes) indexed by its schema and name
- * returns null, if the specified attribute is not supported. This is use in
deserializing a given attribute.
- */
- public Attribute getAttribute(Schema schema, String name) {
-
- if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString() + ".getAttribute(" + schema +
"," + name + ")\n");
-
- if (schema != null) {
- if (attributes != null) {
- Map schemaMap = (Map)attributes.get(schema);
- if (schemaMap != null) {
- Attribute result =
(Attribute)schemaMap.get(name);
- if (result != null)
- return result;
- }
- } // if attributes
-
- if (getSuperType() != null)
- return getSuperType().getAttribute(schema, name);
- else
- return null;
-
- } else
- return null;
- }
-
- /** the schema this part is belonging to */
- private Schema typeSchema;
-
- /** the schema-wide unique name. */
- private String typeName;
-
- /**
- * the Java class that this type is compatible to. Could be null if this type
has no
- * imediate pendant in Java, but could result/be obtained from several
representations.
- */
-
- private Class associatedClass;
-
- /**
- * @label superType
- * @directed
- * @clientCardinality *
- * @supplierCardinality 0..1
- */
-
- private Type superType;
-
- /** each complex type explodes into parts each of which are uniquely indexed
via their name or their urn */
- private Map elements;
- private Map attributes;
-}
-
-/*
+/*
+ * $Id: Type.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * The infor:XML interface to types. <br> XML types determine sub-structures inside
an XML document in terms of attribute,
+ * element, and raw character appearances. XML types are arranged in inheritance
hierarchies quite as traditional classes are.
+ * <br> XML types hence correspond quite naturally to Java classes. Thus, in
infor:X,
+ * each XML type is associated with a compatible Java class from which any type
+ * appearance can be derived in writing and whose instances the type can manipulate
in reading. <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+
+public class Type implements Cloneable {
+
+ /** empty constructor */
+ public Type() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "()\n");
+
+ }
+
+ /** access the supertype @return Type of this type */
+ public Type getSuperType() {
+ return superType;
+ }
+
+
+ /** set the superType */
+ public void setSuperType(Type type) throws IllegalSuperTypeException {
+ superType = type;
+ }
+
+ /** method that decides whether this type is the supertype of the @arg type. */
+
+ public boolean isSuperTypeOf(Type type) throws NullPointerException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".isSuperTypeOf(" + type +
")\n");
+
+ if (equals(type.getSuperType()))
+ return true;
+ else if (type.getSuperType() != null)
+ return isSuperTypeOf(type.getSuperType());
+ else
+ return false;
+ }
+
+ /** description of the derivation relationship */
+
+ public int getDerivedBy() {
+ return derivedBy;
+ }
+
+ /** sets the derivation relationship */
+
+ public void setDerivedBy(int howDerivedBy) {
+ if(howDerivedBy==DERIVEDBY_EXTENSION || howDerivedBy==DERIVEDBY_RESTRICTION)
+ derivedBy=howDerivedBy;
+ }
+
+ /**
+ * this method decides whether the current type can be used to serialise @arg
object under the given @arg class.
+ * The default uses equality to the associated class, but could be extended
+ * or more special cases if needed. Note that once a type feels responsible
for a particular class, it could override
+ * other types that could also utter different views onto such objects wrt. to
polymorphism.
+ */
+
+ public boolean isCompatibleTo(Object object, Class clazz) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".isCompatibleTo(" +
object+","+clazz + ")\n");
+
+ if (associatedClass != null)
+ return associatedClass.equals(clazz);
+ else
+ return false;
+
+ }
+
+ /** gets the class associated to that type */
+ public Class getAssociatedClass() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getAssociatedClass()\n");
+
+ return associatedClass;
+ }
+
+ /** sets the class associated to that type */
+ public void setAssociatedClass(Class clazz) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "setAssociatedClass(" +
clazz + ")\n");
+
+ this.associatedClass = clazz;
+ }
+
+ /**
+ * produce a printable "body" representation @return Object apparent in the
given
+ * java @arg object. May @throws TypeException if the object is not
+ * compatible with the given type (which should not happen internally) or
+ * refuses access to its internal structure. Is used for serialisation
purposes.
+ */
+
+ public String getContent(Object object) throws TypeException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + "getContent(" + object +
")\n");
+
+ return null;
+ }
+
+ /**
+ * produce a printable "verbose" representation @return Object of the elements
+ * apparent in the given java @arg object. May @throws TypeException if the
object is not
+ * compatible with the given type (which should not happen internally) or
+ * refuses access to its internal structure. Is used for serialisation
purposes.
+ */
+ public String getVerboseElements(Object object) throws TypeException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getVerboseElements(" +
object + ")\n");
+
+ return null;
+ }
+
+ /** per-default, types are not referenceable */
+ public boolean isReferencable() {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".isReferencable()\n");
+
+ return false;
+ }
+
+ /**
+ * creates a new Java object @return Object of a class compatible to that type
+ * under the given references and namespaces and incorporate the given
+ * Map of attributes to it. The attributes map (which could be null to
indicate emptyness)
+ * is cleared from any attributes
+ * that have been successfully applied. This method makes use of an object
factory
+ * to allow configurable mapping of interfaces to concrete implementations
+ * and easy customisation.
+ */
+
+ public Object newInstance(Map attributes, Map references, Map nameSpaces)
throws TypeException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".newInstance(" +
attributes + "," + references +
+ "," + nameSpaces + ")\n");
+
+ if (associatedClass != null) {
+ try {
+
+ Object target = getAssociatedClass().newInstance();
+
+ if (attributes != null) {
+
+ Iterator iterator =
attributes.keySet().iterator();
+
+ while (iterator.hasNext()) {
+
+ Attribute attribute =
(Attribute)iterator.next();
+
+ try {
+
+ target =
attribute.setAttributeContent(target,
+
attributes.get(attribute), references, nameSpaces);
+
+ iterator.remove();
+
+ } catch (AttributeException e) {
+
+ if ((Environment.DEBUG_XML &&
Environment.DEBUG_XML_META) ||
+ (Environment.LOG_XML > 0 &&
Environment.LOG_XML_META > 0)) {
+
+
Environment.err.print(toString() + ".newInstance(" + attributes + "," +
+ references + "," +
nameSpaces + "): encountered attribute exception " + e + "\n");
+
+ }
+
+ iterator.remove();
+
+ }
+
+ } // while
+ }
+
+ return target;
+
+ } catch (IllegalAccessException e) {
+ throw new TypeException();
+ } catch (InstantiationException e) {
+ throw new TypeException();
+ } // try
+ } else
+ return null;
+ }
+
+ /**
+ * incorporate the parsed appearance @arg body and non-validated @arg
verboseElements into the
+ * state of the @arg target object under the given @arg references and @arg
nameSpaces. Produces a
+ * new target @return Object.
+ */
+
+ public Object setContent(Object target, String body, String verboseElements,
+ Map references, Map nameSpaces) throws TypeException {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setContent(" + target +
"," + body + "," +
+ verboseElements + references+","+nameSpaces+")\n");
+
+ return target;
+ }
+
+ /** returns the @return Schema that this part belongs to */
+ public Schema getTypeSchema() {
+ return typeSchema;
+ }
+
+ /** sets the @arg schema that this part belongs to */
+ public void setTypeSchema(Schema typeSchema) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setTypeSchema(" +
typeSchema + ")\n");
+
+ this.typeSchema = typeSchema;
+ }
+
+ /** get the @return String -based name of that part within the schema */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /** set the @arg name of that part within the schema */
+ public void setTypeName(String typeName) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".setTypeName(" + typeName
+ ")\n");
+
+ this.typeName = typeName;
+ }
+
+ /** overrides the default equals method to cater for schema and name-based
equality */
+ public boolean equals(Object other) {
+
+ try {
+ return (this == other ||
(typeName.equals(((Type)other).typeName) &&
+ typeSchema.equals(((Type)other).typeSchema)));
+ } catch (ClassCastException e) {
+ return false;
+ } catch (NullPointerException e) {
+ return false;
+ }
+
+ }
+
+ /** overrides the default hashCode implementation to coincide with above
equality concept */
+
+ public int hashCode() {
+
+ // only if both schema and name are non-null
+ try {
+ return typeSchema.hashCode() + typeName.hashCode();
+ } catch (NullPointerException e) {
+ return super.hashCode();
+ }
+
+ }
+
+
+ /** this method determines whether the type requires element information to be
uniquely referenceable */
+
+ public boolean isStateless() { return false; }
+
+ /**
+ * produce an array of elements @return Element[] belonging just to that type
+ * and apparent in the @arg object. may return null, if the type does not
+ * support any elements or if the object does not have any elements apparant.
Is used when serializing the object.
+ */
+ public Element[] getElements(Object object) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getElements(" + object +
")\n");
+
+ // we must first flatten the substructure
+ if (elements != null) {
+ Iterator schemaMapIterator = elements.values().iterator();
+ Collection result = new ArrayList(5);
+
+ while (schemaMapIterator.hasNext())
+
result.addAll(((Map)schemaMapIterator.next()).values());
+
+ return (Element[]) result.toArray((Object[]) new
Element[result.size()]);
+ }
+
+ return null;
+ }
+
+ /**
+ * produce an array of attributes @return Attribute[] belonging just to that
type and
+ * apparent in the @arg object. may return null, if the type does not
+ * support any attributes or if the object has no attributes apparent.
+ * Is used to serialize the given object into XML. @throws TypeException
+ * if the object is not compatible with this type (which should not happen
internally) or
+ * refuses to give its iternal structure free.
+ */
+ public Attribute[] getAttributes(Object object) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getAttributes(" + object
+ ")\n");
+
+ // first flatten that crazy two-level structure
+ if (attributes != null) {
+ Iterator schemaMapIterator = attributes.values().iterator();
+ Collection result = new ArrayList(5);
+
+ while (schemaMapIterator.hasNext())
+
result.addAll(((Map)schemaMapIterator.next()).values());
+
+ return (Attribute[]) result.toArray((Object[]) new
Attribute[result.size()]);
+ }
+
+ return null;
+ }
+
+ /** registers an additional @arg element and returns the overwritten @return
Element. Uses a lazy initialization of elements */
+ public Element addElement(Element element) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addElement(" + element +
")\n");
+
+ if (elements == null)
+ synchronized(this) {
+ if (elements == null)
+ elements = new HashMap();
+ }
+
+ Map schemaMap = (Map)elements.get(element.getAppearanceSchema());
+
+ if (schemaMap == null)
+ synchronized(elements) {
+ schemaMap =
(Map)elements.get(element.getAppearanceSchema());
+ if (schemaMap == null) {
+ schemaMap = new HashMap();
+ elements.put(element.getAppearanceSchema(),
schemaMap);
+ }
+ }
+
+ return (Element)schemaMap.put(element.getAppearanceName(), element);
+ }
+
+ /** removes an @arg element and returns the removed @return Element, should
operate recursively */
+ public Element removeElement(Element element) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeElement(" + element
+ ")\n");
+
+ if (elements != null) {
+ Map schemaMap =
(Map)elements.get(element.getAppearanceSchema());
+ if (schemaMap != null)
+ return
(Element)schemaMap.remove(element.getAppearanceName());
+ else
+ return null;
+ } else
+ return null;
+ }
+
+ /**
+ * accesses a sub-element in that type (and possibly defined by its
supertypes) indexed by its schema and name
+ * returns null if the specified element is not supported. Is used when
deserialising an element.
+ */
+ public Element getElement(Schema schema, String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getElement(" + schema +
"," + name + ")\n");
+
+ if (schema != null) {
+
+ if (elements != null) {
+ Map schemaMap = (Map)elements.get(schema);
+ if (schemaMap != null) {
+ Element element = (Element)schemaMap.get(name);
+ if (element != null)
+ return element;
+ }
+ }
+
+ if (getSuperType() != null &&
getDerivedBy()!=DERIVEDBY_RESTRICTION)
+ return getSuperType().getElement(schema, name);
+ else
+ return null;
+
+ } else
+ return null;
+ }
+
+ /**
+ * registers an additional @arg attribute and returns the overwritten @return
Attribute. Uses
+ * lazy initialization of attributes.
+ */
+ public Attribute addAttribute(Attribute attribute) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".addAttribute(" +
attribute + ")\n");
+
+ if (attributes == null)
+ synchronized(this) {
+ if (attributes == null)
+ attributes = new HashMap();
+ }
+
+ Map schemaMap = (Map)attributes.get(attribute.getAppearanceSchema());
+
+ if (schemaMap == null)
+ synchronized(attributes) {
+ schemaMap =
(Map)attributes.get(attribute.getAppearanceSchema());
+ if (schemaMap == null) {
+ schemaMap = new HashMap();
+
+
attributes.put(attribute.getAppearanceSchema(), schemaMap);
+ }
+ }
+
+ return (Attribute)schemaMap.put(attribute.getAppearanceName(),
attribute);
+ }
+
+ /** removes an @arg attribute and returns the removed @return Attribute */
+ public Attribute removeAttribute(Attribute attribute) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".removeAttribute(" +
attribute + ")\n");
+
+ if (attributes != null) {
+ Map schemaMap =
(Map)attributes.get(attribute.getAppearanceSchema());
+ if (schemaMap != null)
+ return
(Attribute)schemaMap.remove(attribute.getAppearanceName());
+ else
+ return null;
+ } else
+ return null;
+ }
+
+ /**
+ * accesses an attribute in that type (that is possibly defined in one of its
supertypes) indexed by its schema and name
+ * returns null, if the specified attribute is not supported. This is use in
deserializing a given attribute.
+ */
+ public Attribute getAttribute(Schema schema, String name) {
+
+ if (Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString() + ".getAttribute(" + schema +
"," + name + ")\n");
+
+ if (schema != null) {
+ if (attributes != null) {
+ Map schemaMap = (Map)attributes.get(schema);
+ if (schemaMap != null) {
+ Attribute result =
(Attribute)schemaMap.get(name);
+ if (result != null)
+ return result;
+ }
+ } // if attributes
+
+ if (getSuperType() != null &&
getDerivedBy()!=DERIVEDBY_RESTRICTION)
+ return getSuperType().getAttribute(schema, name);
+ else
+ return null;
+
+ } else
+ return null;
+ }
+
+ /**
+ * this method is to clone the actual type into some
+ * other type with the same appearance, but a
+ * possibly modified internal structure. It is used to
+ * implement the copy semantics of the element-type
+ * association in some parts of XML-Schema.
+ */
+
+ public Object clone() {
+
+ // first construct a clone
+ Type returnType=null;
+
+ try{
+ returnType=(Type) super.clone();
+ } catch(CloneNotSupportedException e) {
+ // not possible, we implement it!
+ }
+
+
+ if(elements!=null)
+ returnType.elements=(Map) ((HashMap) elements).clone();
+
+ if(attributes!=null)
+ returnType.attributes=(Map) ((HashMap) attributes).clone();
+
+ return returnType;
+
+ } // clone
+
+
+ /** the schema this part is belonging to */
+ private Schema typeSchema;
+
+ /** the schema-wide unique name. */
+ private String typeName;
+
+ /**
+ * the Java class that this type is compatible to. Could be null if this type
has no
+ * imediate pendant in Java, but could result/be obtained from several
representations.
+ */
+
+ private Class associatedClass;
+
+ /**
+ * @label superType
+ * @directed
+ * @clientCardinality *
+ * @supplierCardinality 0..1
+ */
+
+ private Type superType;
+
+ /**
+ * how the inheritance is derived
+ */
+
+ private int derivedBy;
+
+ /**
+ * the constants which determined the inheritance relationsship
+ */
+
+ public final static int DERIVEDBY_EXTENSION=0;
+ public final static int DERIVEDBY_RESTRICTION=1;
+
+ /** each complex type explodes into parts each of which are uniquely indexed
via their name or their urn */
+ private Map elements;
+ private Map attributes;
+}
+
+/*
* $Log: Type.java,v $
- * Revision 1.1 2000/08/10 21:07:33 jung
- * Initial revision
- *
- * Revision 1.1.2.4 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.2 2000/07/20 14:35:28 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.1 2000/07/17 12:46:21 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1.2.1 2000/07/11 08:08:34 jung
- * added functionality to store retrieve a part of a types elements
- * within "ignored" strings. Useful for writing generic handlers that
- * just process a part of the XML and transfer the rest.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:33 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.4 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.2 2000/07/20 14:35:28 jung
+ * some refactoring inside infor:xml
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:21 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1.2.1 2000/07/11 08:08:34 jung
+ * added functionality to store retrieve a part of a types elements
+ * within "ignored" strings. Useful for writing generic handlers that
+ * just process a part of the XML and transfer the rest.
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +75 -71 zoap/src/org/zoap/xml/TypeException.java
Index: TypeException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/TypeException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TypeException.java 2000/08/10 21:07:33 1.1
+++ TypeException.java 2000/12/04 12:36:21 1.2
@@ -1,74 +1,84 @@
-/*
- * $Id: TypeException.java,v 1.1 2000/08/10 21:07:33 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-/**
- * an exception that is thrown from methods of @see Type
- */
-
-public class TypeException extends XmlException {
-}
-
-/*
+/*
+ * $Id: TypeException.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+/**
+ * an exception that is thrown from methods of @see Type
+ */
+
+public class TypeException extends XmlException {
+}
+
+/*
* $Log: TypeException.java,v $
- * Revision 1.1 2000/08/10 21:07:33 jung
- * Initial revision
- *
- * Revision 1.1.2.2 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:27 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:33 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.2 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:27 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +111 -107 zoap/src/org/zoap/xml/URNResolver.java
Index: URNResolver.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/URNResolver.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URNResolver.java 2000/08/10 21:07:34 1.1
+++ URNResolver.java 2000/12/04 12:36:21 1.2
@@ -1,110 +1,120 @@
-/*
- * $Id: URNResolver.java,v 1.1 2000/08/10 21:07:34 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import de.infor.ce.util.URN;
-
-import java.io.Reader;
-import java.io.IOException;
-
-import java.util.Collection;
-
-/**
- * A URNResolver in infor:XML is an object that is able to build a new
XmlObjectReader
- * sitting upon a given URN and equipped with a collection of already visited urns.
- *
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public interface URNResolver {
-
- /**
- * creates a new @return XmlObjectReader that sits upon the @arg theUrn which is
- * evaluated in relation to the current absolute urn @arg currentLocation and
under
- * the context of already collected urns @arg visitedURNs. @throws IOException in
case
- * that the urn could not be openend as an xml stream.
- */
-
- public XmlObjectReader resolveURN(URN theUrn, Collection visitedURNs)
- throws IOException;
-
- /**
- * default implementation of URNResolver.
- */
-
- public static URNResolver defaultUrnResolver = new DefaultURNResolver();
-
- static class DefaultURNResolver implements URNResolver {
-
- public XmlObjectReader resolveURN(URN theUrn, Collection visitedURNs)
- throws IOException {
- return new XmlObjectReader(new java.io.InputStreamReader(theUrn.openStream()),
- theUrn,this,visitedURNs);
- }
-
- }
-
-}
-
-/*
+/*
+ * $Id: URNResolver.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import de.infor.ce.util.URN;
+
+import java.io.Reader;
+import java.io.IOException;
+
+import java.util.Collection;
+
+/**
+ * A URNResolver in infor:XML is an object that is able to build a new
XmlObjectReader
+ * sitting upon a given URN and equipped with a collection of already visited urns.
+ *
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public interface URNResolver {
+
+ /**
+ * creates a new @return XmlObjectReader that sits upon the @arg theUrn which is
+ * evaluated in relation to the current absolute urn @arg currentLocation and
under
+ * the context of already collected urns @arg visitedURNs. @throws IOException in
case
+ * that the urn could not be openend as an xml stream.
+ */
+
+ public XmlObjectReader resolveURN(URN theUrn, Collection visitedURNs)
+ throws IOException;
+
+ /**
+ * default implementation of URNResolver.
+ */
+
+ public static URNResolver defaultUrnResolver = new DefaultURNResolver();
+
+ static class DefaultURNResolver implements URNResolver {
+
+ public XmlObjectReader resolveURN(URN theUrn, Collection visitedURNs)
+ throws IOException {
+ return new XmlObjectReader(new java.io.InputStreamReader(theUrn.openStream()),
+ theUrn,this,visitedURNs);
+ }
+
+ }
+
+}
+
+/*
* $Log: URNResolver.java,v $
- * Revision 1.1 2000/08/10 21:07:34 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.2 2000/07/06 16:55:05 jung
- * moved the default binding caches in order to make apartments
- * with different versions of the same class possible.
- *
- * Revision 1.1.1.1 2000/07/06 14:11:25 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:34 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.2 2000/07/06 16:55:05 jung
+ * moved the default binding caches in order to make apartments
+ * with different versions of the same class possible.
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:25 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
No revision
No revision
No revision
1.2 +79 -75 zoap/src/org/zoap/xml/XmlException.java
Index: XmlException.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/XmlException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XmlException.java 2000/08/10 21:07:38 1.1
+++ XmlException.java 2000/12/04 12:36:21 1.2
@@ -1,78 +1,88 @@
-/*
- * $Id: XmlException.java,v 1.1 2000/08/10 21:07:38 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import java.io.IOException;
-
-/**
- * The most general exception that is thrown by this package
- * <br>
- * Since infor:XML is an IO package, this is an @see java.io.IOException.
- * <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class XmlException extends IOException {
-}
-
-/*
+/*
+ * $Id: XmlException.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import java.io.IOException;
+
+/**
+ * The most general exception that is thrown by this package
+ * <br>
+ * Since infor:XML is an IO package, this is an @see java.io.IOException.
+ * <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class XmlException extends IOException {
+}
+
+/*
* $Log: XmlException.java,v $
- * Revision 1.1 2000/08/10 21:07:38 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:28 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:38 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:28 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +1240 -1360zoap/src/org/zoap/xml/XmlObjectReader.java
Index: XmlObjectReader.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/XmlObjectReader.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XmlObjectReader.java 2000/08/10 21:07:41 1.1
+++ XmlObjectReader.java 2000/12/04 12:36:21 1.2
@@ -1,1363 +1,1249 @@
-/*
- * $Id: XmlObjectReader.java,v 1.1 2000/08/10 21:07:41 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import de.infor.ce.util.URN;
-
-import org.zoap.xml.meta.builtin.DefaultBinding;
-
-import com.sun.xml.parser.Parser;
-
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.AttributeList;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.net.URL;
-
-import java.io.Reader;
-import java.io.ObjectInput;
-import java.io.IOException;
-
-import java.util.Stack;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Properties;
-import java.util.Iterator;
-
-/**
- * XmlObjectReader is a deserialisation service that reconstructs
- * java objects from character streams using a given meta-model.
- * <br>
- * It currently builds on Suns Project-X SAX parser and registers there
- * as a document handler in order to build Java objects
- * and schema information on the fly. Means that no intermediate
- * DOM is built and traversed which should speed up performance.
- * <br>
- * Note that, because of XML-1.0 compliance reasons, the Sun parser
- * is currently bound to a single root-element per stream, otherwise gets angry.
Maybe
- * this can be circumvented by underlying it a special reader that is able
- * to mimique EOF after each root in order to realise a real streaming mode.
- * <br>
- * ToDo:
- * <ul>
- * <li> Try to find reasonable default sizes for collections and maps from the
parsing info </li>
- * <li> Implement the primitive types and connect them to the IO interface methods
</li>
- * </ul>
- *
- * @see <related>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class XmlObjectReader extends Reader implements ObjectInput {
-
- /**
- * uses an embedded reader for input purposes
- */
-
- private Reader reader;
-
- /**
- * this url is assigned to the reader
- */
-
- private URN associatedUrn;
-
- /**
- * these urls have already been memorized
- */
-
- private Collection visitedURNs;
-
- /**
- * the URNResolver
- */
-
- private URNResolver urnResolver;
-
- /**
- * the type that is currently deserialised
- */
-
- private Type type;
-
- /**
- * the stack of types we have encountered
- */
-
- private Stack typeStack=new Stack();
-
- /**
- * the target object currently under consideration
- */
-
- private Object target;
-
- /**
- * the stack of target objects
- */
-
- private Stack targetStack=new Stack();
-
- /**
- * the element that we are currently inspecting
- */
-
- private Element element;
-
- /**
- * the stack of elements that we are currently inspecting
- */
-
- private Stack elementStack=new Stack();
-
- /**
- * the string that collects the spread body characters of an element
- */
-
- private String body;
-
- /**
- * the stack of body fragments we have encountered so far
- */
-
- private Stack bodyStack=new Stack();
-
- /**
- * whether the current element has already been successfully added
- */
-
- private Boolean elementAdded;
-
- /**
- * which of the elements in the current path have already been successfully added
- */
-
- private Stack elementsAdded=new Stack();
-
- /**
- * the string that collects ignored elements into a verbose representation
- * we dont need a stack, because it just collects ignored and
- * coherent parts of a documnet
- */
-
- private String verboseElements="";
-
- /**
- * the sub-elements collected
- */
-
- private Collection elements=new ArrayList();
-
- /**
- * the stack of unprocessed elements
- */
-
- private Stack elementsStack=new Stack();
-
- /**
- * this mark is set if an xsi:null attribute has been seen lately
- */
-
- private boolean isNull=false;
-
- /**
- * the map that stores the relation of global ids to object references
- */
-
- private Map references=new HashMap();
-
- /**
- * the map that stores the namespace prefixes in relation to their schemas
- */
-
- private Map nameSpaces;
-
- /**
- * on this stack, the nested namespace environment is stored
- */
-
- private Stack nameSpaceStack=new Stack();
-
- /**
- * a corressponding SAX input-source bound to the reader
- */
-
- private InputSource inputSource;
-
- /**
- * the embedded SAX parser, Suns Project-X for the moment
- */
-
- private Parser parser=new Parser();
-
- /**
- * the level of ignorance we have cumulated
- */
-
- private int ignoranceLevel=0;
-
- /**
- * the databinding we apply
- */
-
- private Binding binding;
-
- /** accessor to binding */
- public Binding getBinding() {
- return binding;
- }
-
- /** accessor to binding */
- public void setBinding(Binding theBinding) {
- binding=theBinding;
- nameSpaces=binding.getDefaultNameSpaceEnvironment();
- }
-
- /** accessor to URNResolver */
- public URNResolver getURNResolver() {
- return urnResolver;
- }
-
- /** resolve a given urn with the given urnResolver */
- public XmlObjectReader resolveURN(URN theUrn) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".resolveURN("+theUrn+")"+urnResolver);
-
- URN newUrn=new URN(associatedUrn.getParent(),theUrn);
-
- if(visitedURNs.contains(newUrn))
- return null;
- else
- return urnResolver.resolveURN(newUrn,visitedURNs);
- }
-
- public Collection getVisitedURNs() {
- return visitedURNs;
- }
-
- public void setVisitedURNs(Collection vU) {
- visitedURNs=vU;
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader with no
- * particular URL assigned to this reader
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader) {
- this(theEmbeddedReader,(URN) null);
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URN associatedUrn) {
- this(theEmbeddedReader,associatedUrn,DefaultBinding.getDefaultBinding());
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URNResolver resolver) {
- this(theEmbeddedReader,(URN)
null,DefaultBinding.getDefaultBinding(),resolver,new ArrayList());
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, Binding theBinding) {
- this(theEmbeddedReader,(URN) null,theBinding);
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, Binding theBinding,
URNResolver resolver) {
- this(theEmbeddedReader,(URN) null,theBinding,resolver, new ArrayList());
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn, Binding
theBinding) {
- this(theEmbeddedReader,theUrn,theBinding,URNResolver.defaultUrnResolver, new
ArrayList());
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn, URNResolver
resolver) {
- this(theEmbeddedReader,theUrn,DefaultBinding.getDefaultBinding(),resolver, new
ArrayList());
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn, Binding
theBinding, URNResolver resolver) {
- this(theEmbeddedReader,theUrn,theBinding,resolver, new ArrayList());
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn, URNResolver
resolver, Collection visitedURNs) {
-
this(theEmbeddedReader,theUrn,DefaultBinding.getDefaultBinding(),resolver,visitedURNs);
- }
-
- /**
- * Constructor: create a new XmlObjectReader from a given reader,
- * @param theEmbeddedReader - a given character reader upon which the
- * XML document is transported
- */
-
- public XmlObjectReader(java.io.Reader theEmbeddedReader, URN associatedUrn,
- Binding theDataBinding, URNResolver resolver, Collection visitedURNs) {
-
- if(Environment.DEBUG_XML)
-
Environment.out.println("XmlObjectReader("+theEmbeddedReader+","+associatedUrn+
- ","+theDataBinding+","+resolver+","+visitedURNs+")");
-
- // set the embedded reader
- reader=theEmbeddedReader;
-
- // set the url
- this.associatedUrn=associatedUrn;
-
- // set the binding
- binding=theDataBinding;
-
- // construct an appropriate input source
- inputSource=
- new org.xml.sax.InputSource();
-
- // and use the given reader as the character stream in that input source
- inputSource.setCharacterStream(theEmbeddedReader);
-
- // construct an inner class with access to private fields
- // as the document handler for the parser
- parser.setDocumentHandler(new XmlDocumentHandler());
-
- // and register the default namespace environment of this binding
- nameSpaces=binding.getDefaultNameSpaceEnvironment();
-
- // and register the binding itself under a very special reference
- references.put("org.zoap.xml.XmlObjectReader",this);
-
- // the resolver is registered
- urnResolver=resolver;
-
- this.visitedURNs=visitedURNs;
- visitedURNs.add(associatedUrn);
- }
-
- /**
- * Read and return an @return Object.
- */
-
- public Object readObject() throws XmlException, IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.println(toString()+".readObject()");
-
- try {
-
- parser.parse(inputSource);
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".readObject(): ready with
parse"+elements+"\n");
-
- // we iterate over the new appearances we have collected
- java.util.Iterator iterator=elements.iterator();
- Object result=null;
-
- // and take exactly one object out of it
- if(iterator.hasNext()) {
- result=((ElementValue) iterator.next()).getValue();
- iterator.remove();
- }
-
- return result;
-
- } catch(SAXException e) {
-
- if(Environment.DEBUG_XML)
- Environment.err.println(toString()+".readObject(): produced parsing
exception."+e);
-
- throw new XmlException();
-
- }
-
- }
-
- /**
- * disabled, because the parser really closes the channel
- */
-
- public void close() throws XmlException, IOException {
- }
-
- /**
- * read a single Xml-ised character
- */
-
- public int read() throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * read a Xml-ised character buffer
- */
-
- public int read(char[] cbuf) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * read a portion of a character buffer
- */
-
- public int read(char[] cbuf, int off, int len) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Skip Xml-ised characters.
- */
-
- public long skip(long n) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Tell whether this stream is ready to be read.
- */
-
- public boolean ready() throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Tell whether this stream supports the mark() operation. The default
- * implementation always returns false.
- */
-
- public boolean markSupported() {
- return false;
- }
-
- /**
- * Mark the present position in the stream is not supported.
- */
-
- public void mark(int readAheadLimit) throws IOException {
- throw new IOException("mark() not supported");
- }
-
- /**
- * Reset the stream is currently not supported.
- */
-
- public void reset() throws IOException {
- throw new IOException("reset() not supported");
- }
-
- /**
- * Reads into an array of bytes.
- */
-
- public int read(byte[] b) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads into an array of bytes.
- */
-
- public int read(byte[] b, int off, int len) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the number of bytes that can be read
- * without blocking.
- */
-
- public int available() throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads some bytes from an input
- * stream and stores them into the buffer
- * array <code>b</code>. The number of bytes
- * read is equal
- * to the length of <code>b</code>.
- */
-
- public void readFully(byte[] b) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads <code>len</code>
- * bytes from
- * an input stream.
- */
-
- public void readFully(byte[] b, int off, int len) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Makes an attempt to skip over
- * <code>n</code> bytes
- * of data from the input
- * stream, discarding the skipped bytes.
- */
-
- public int skipBytes(int n) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads one input byte and returns
- * <code>true</code> if that byte is nonzero,
- * <code>false</code> if that byte is zero.
- */
-
- public boolean readBoolean() throws IOException {
- return ((Boolean) readObject()).booleanValue();
- }
-
- /**
- * Reads and returns one input byte.
- * The byte is treated as a signed value in
- * the range <code>-128</code> through <code>127</code>,
- * inclusive.
- */
-
- public byte readByte() throws IOException {
- return ((Byte) readObject()).byteValue();
- }
-
- /**
- * Reads one input byte, zero-extends
- * it to type <code>int</code>, and returns
- * the result, which is therefore in the range
- * <code>0</code>
- * through <code>255</code>.
- */
-
- public int readUnsignedByte() throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads two input bytes and returns
- * a <code>short</code> value.
- */
-
- public short readShort() throws IOException {
- return ((Short) readObject()).shortValue();
- }
-
- /**
- * Reads two input bytes and returns
- * an <code>int</code> value in the range <code>0</code>
- * through <code>65535</code>.
- */
-
- public int readUnsignedShort() throws IOException {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Reads an input <code>char</code> and returns the <code>char</code> value.
- */
-
- public char readChar() throws IOException {
- return ((Character) readObject()).charValue();
- };
-
- /**
- * Reads four input bytes and returns an
- * <code>int</code> value.
- */
-
- public int readInt() throws IOException {
- return ((Integer) readObject()).intValue();
- }
-
- /**
- * Reads eight input bytes and returns
- * a <code>long</code> value.
- */
-
- public long readLong() throws IOException {
- return ((Long) readObject()).longValue();
- }
-
- /**
- * Reads four input bytes and returns
- * a <code>float</code> value.
- */
-
- public float readFloat() throws IOException {
- return ((Float) readObject()).floatValue();
- }
-
- /**
- * Reads eight input bytes and returns
- * a <code>double</code> value.
- */
-
- public double readDouble() throws IOException {
- return ((Double) readObject()).doubleValue();
- }
-
- /**
- * Reads the next line of text from the input stream.
- */
-
- public String readLine() throws IOException {
- return (String) readObject();
- };
-
- /**
- * Reads in a string that has been encoded using a modified UTF-8 format.
- */
-
- public String readUTF() throws IOException {
- return (String) readObject();
- }
-
-
- /**
- * inner class that operates as the interface of the reader to the parser
- */
-
- class XmlDocumentHandler implements DocumentHandler {
-
- /**
- * what happens when an opening tag is found - this is going
- * to be verbose and interesting
- */
-
- public void startElement(String p0, AttributeList p1) throws SAXException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".startElement("+p0+","+p1+")\n");
-
- // look if the level of ignorance is greater than zero
- if(ignoranceLevel!=0) {
-
- // then we couldnt understand that part of the document anyway
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".startElement("+p0+","+p1+"):
ignorance mode.\n");
-
- // hence collect the tag information inside the verboseElements string
- // for bunch-processing afterwards
- verboseElements+="<"+p0+" ";
-
- // also the attribute stuff
- for(int count=0;count<p1.getLength();count++)
- verboseElements+=p1.getName(count)+"=\""+p1.getValue(count)+"\" ";
-
- // and close the tag also
- verboseElements+=">"+Environment.LINE_SEPERATOR;
-
- // increase the level to check when we are back in the processible part
- ignoranceLevel++;
-
- } else {
-
- // this is the real mode in which we try to understand everything
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".startElement("+p0+","+p1+"):
element mode.\n");
-
- //
- // PART 1: Initialise the environment
- //
-
- // push the namespace thingy to the stack
- nameSpaceStack.push(nameSpaces);
- // push the body to the stack
- bodyStack.push(body);
- // push the last type to the stack
- typeStack.push(type);
- // push the last target to the stack
- targetStack.push(target);
- // push the last element to the stack
- elementStack.push(element);
- // push the appearances to the stack
- elementsStack.push(elements);
- elementsAdded.push(elementAdded);
-
-
- // clone the namespace environment
- nameSpaces=new HashMap(nameSpaces);
-
- // initialise the body
- body=new String();
-
- // initialise sub-appearances
- elements=new ArrayList();
-
- // put the attributes into the variable
- Map preAttributes=new HashMap(p1.getLength());
-
- // initialise target
- target=null;
-
- // clear the verbose elements
- verboseElements=new String();
-
- // make a note abot whether we have already included this element
- // into its parent
- elementAdded=new Boolean(false);
-
- //
- // PART 2: Initialise the namespaces and preprocess/decode other
attributes
- //
-
- for(int count=0;count<p1.getLength();count++) {
-
- // if the attribute starts with xmlns, this is a namespace candidate
- if(p1.getName(count).startsWith("xmlns")) {
-
- // find out the right suffix
- String nameSpaceSuffix=p1.getName(count).substring(5);
- // test whether its a correct xmlns{:bla}= thingy
- if(nameSpaceSuffix.startsWith(":") || nameSpaceSuffix.equals("")) {
- // yes, remove the colon around to get the real suffix
- if(!nameSpaceSuffix.equals(""))
- nameSpaceSuffix=nameSpaceSuffix.substring(1);
-
- URN urn=new URN(new String[]
{Environment.decodeFromXml(p1.getValue(count))});
-
- // ok, we now found a proper prefix, now turn to the schema/urn
- Schema schema=binding.getSchema(urn);
-
- // if detectected unrecognized namespace, we fake a schema for it
- if(schema==null) {
- schema=new Schema();
- schema.setUrn(urn);
- binding.addSchema(schema);
- }
-
- // register the looked up namespace
- nameSpaces.put(nameSpaceSuffix,schema);
-
- } // if nameSpaceSuffix.startsWith(":") ||
nameSpaceSuffix.equals(""))
-
- } else {
-
- // this is a proper attribute now, store it for later processing
- preAttributes.put(p1.getName(count),
- Environment.decodeFromXml(p1.getValue(count)));
-
- }
-
- } // for(int count=0;count<p1.getLength();count++)
-
- //
- // PART 3: Determine the element's basic type
- //
-
- String elementNameSpacePrefix=Environment.getNameSpacePrefix(p0);
- String elementName=Environment.getProperName(p0);
- Schema schema=(Schema) nameSpaces.get(elementNameSpacePrefix);
-
- if(type==null && schema!=null) {
- // if this is a first-level element and its schema has been recognised
- element=schema.getElement(elementName);
- } else if(type!=null) {
- // if this is a second- or nth-level element
- element=type.getElement(schema,elementName);
- } else
- // if the schema has not been recognized
- element=null;
-
- // get the default type of that element
- if(element!=null)
- type=element.getType();
- else
- type=null;
-
- // if we could not look up the type, we ignore that crap
- if(type==null) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
- Environment.out.print(toString()+
- ".startElement("+p0+","+p1+"): no such element/type.\n");
-
- // but before, extend the verbose elements as in pure ignorance mode
- verboseElements+="<"+p0+" ";
-
- for(int count=0;count<p1.getLength();count++)
- verboseElements+=p1.getName(count)+"=\""+p1.getValue(count)+"\" ";
-
- verboseElements+=">"+Environment.LINE_SEPERATOR;
-
- // increase the ignoranceLevel and you are fine for this method
- ignoranceLevel++;
-
- } else {
-
- //
- // PART 4: Filter xsi:null and xsi:type attributes for
- // null-values and polymorphism
- //
-
- Iterator iterator=preAttributes.keySet().iterator();
-
- while(iterator.hasNext()) {
- String attributeName=(String) iterator.next();
- String prefix=Environment.getNameSpacePrefix(attributeName);
-
- // compare the namespace with XmlSchemaInstance (xsi)
-
if(XmlSchemaInstance.getXmlSchemaInstance().equals(nameSpaces.get(prefix))) {
-
- // we strip off the namespace prefix from the local part
- String suffix=Environment.getProperName(attributeName);
-
- // attributes have already been decoded, so just test string
equivalence
- // on null=true
- if("null".equals(suffix) &&
- "true".equals(preAttributes.get(attributeName))) {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".startElement("+p0+","+p1+
- "): found xsi:null.\n");
-
- isNull=true;
-
- // filter the attribute, it is not needed anymore
- iterator.remove();
-
- // test string equivalence type=""
- } else if("type".equals(suffix)) {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".startElement("+p0+","+p1+
- "): found xsi:type.\n");
-
- // the attribute contains a proper qname
- String typeName=(String) preAttributes.get(attributeName);
- String typePrefix=Environment.getNameSpacePrefix(typeName);
- Schema typeSchema=(Schema) nameSpaces.get(typePrefix);
-
- // consult the namespace-associated schema for
determining/overriding the type
- if(typeSchema!=null) {
- Type
newType=typeSchema.getType(Environment.getProperName(typeName));
- if(newType!=null && type.isSuperTypeOf(newType))
- type=newType;
- }
-
- // remove the attribute
- iterator.remove();
-
- } // if(suffix.equals("null")
-
- } // if XmlSchemaInstance.equals(namespaces.get()))
-
- } // while(iterator.hasNext())
-
- //
- // PART 5: switch to ignorance mode if type information is corrupt or
- // null has been detected
- //
-
- if(type==null || isNull ) {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+
- ".startElement("+p0+","+p1+"): encountered unknown type or
null.\n");
-
- // switch to ignorance mode and log the stuff you get
- verboseElements+="<"+p0+" ";
-
- for(int count=0;count<p1.getLength();count++)
- verboseElements+=p1.getName(count)+"=\""+p1.getValue(count)+"\" ";
-
- verboseElements+=">"+Environment.LINE_SEPERATOR;
-
- ignoranceLevel++;
-
-
- } else {
-
- //
- // PART 7: First try to apply/rearrange the collected attributes
maybe to
- // dereference the target
- //
-
- Map attributes=new HashMap(preAttributes.size());
- iterator=preAttributes.keySet().iterator();
-
- // loop over the attributes map
- while(iterator.hasNext()) {
-
- // get the current key
- String attributeFullName=(String) iterator.next();
- // find out its namespace
- String attributeNameSpacePrefix=Environment.
- getNameSpacePrefix(attributeFullName);
- // and local name
- String attributeName=Environment.getProperName(attributeFullName);
- // to reconstruct the real attribute structure
- Attribute attribute=type.getAttribute((Schema)
- nameSpaces.get(attributeNameSpacePrefix),
- attributeName);
-
- if(attribute!=null) {
-
- try{
-
- // get the type
- Type attributeType=attribute.getType();
-
- // create an object value for the attribute
- Object value=attributeType.
-
setContent(attributeType.newInstance(null,references,nameSpaces),(String)
-
preAttributes.get(attributeFullName),"",references,nameSpaces);
-
- // and try to set it in the target
- target=attribute.
- setAttributeContent(target,value,references,nameSpaces);
-
- // if the set has not been successful (target=null), we defer
the setting
- if(target==null)
- attributes.put(attribute,value);
-
- } catch(TypeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
- Environment.err.print(toString()+".startElement("+p0+","+p1+
- "): failed to create instance of attribute type "+e+"\n");
-
- } catch(AttributeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
- Environment.err.print(toString()+".endElement("+p0+
- "): could not set attribute "+e+"\n");
-
- }
-
- } // if
-
- } // while
-
- //
- // PART 9: Build an object
- //
-
- if(target==null) {
- try{
- target=type.newInstance(attributes,references,nameSpaces);
- } catch(TypeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
- Environment.err.print(toString()+".endElement("+p0+
- ") failed to create instance of type "+e+"\n");
-
- }
- }
-
- //
- // PART 11: Reapply remaining attributes
- //
-
- iterator=attributes.keySet().iterator();
-
- while(iterator.hasNext()) {
-
- Attribute attribute=(Attribute) iterator.next();
-
- try{
-
- // and try to set it in the target
-
target=attribute.setAttributeContent(target,attributes.get(attribute),
- references,nameSpaces);
-
- } catch(AttributeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
- Environment.err.print(toString()+".startElement("+p0+","+p1+
- "): could not set attribute "+e+"\n");
-
- } // try
-
- } //while(iterator.hasNext())
-
- if(target!=null && !type.isStateless()) {
- Object oldTarget=targetStack.pop();
- Object newTarget;
-
- try{
-
newTarget=element.addElementContent(oldTarget,target,references, nameSpaces);
- } catch(ElementException e) {
- newTarget=oldTarget;
- }
-
- if(newTarget!=null) {
- elementAdded=new Boolean(true);
- } else {
- if(newTarget==null) {
- ((Collection) elementsStack.peek()).
- add(new ElementValue(element,target));
- }
- }
-
- targetStack.push(newTarget);
- }
-
- } // if(type!=null)
-
- } // if(type==null)
-
- } // if(ignoranceMode==0)
-
- } // startElement
-
- /**
- * what happens if some characters are found inside the tag
- * build a real filter into this
- */
-
- public void characters(char[] p0, int p1, int p2) throws SAXException {
-
- if(Environment.DEBUG_XML)
- Environment.out.println(toString()+".characters("+p1+","+p2+")");
-
- if(ignoranceLevel==0) {
-
- //
- // PART 6: increase the body of the tag
- //
-
- // remember to filter newlines etc.
- if(p2>0 && p0[0]!='\n')
- body+=new String(p0,p1,p2);
- } else {
- verboseElements+=new String(p0,p1,p2);
- }
-
- }
-
- /**
- * what happens if a closing tag is found, note quite as verbose but not
- * less interesting ;-)
- */
-
- public void endElement(String p0) throws SAXException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".endElement("+p0+")\n");
-
- if(ignoranceLevel>0) {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".endElement("+p0+"): ignorance
mode.\n");
-
- ignoranceLevel--;
- isNull=false;
-
- verboseElements+="</"+p0+">"+Environment.LINE_SEPERATOR;
-
- if(ignoranceLevel==0)
- target=targetStack.pop();
-
- } else {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".endElement("+p0+"): element
mode.\n");
-
- //
- // PART 10: Insert the body and the verbose elements
- //
-
- try{
-
target=type.setContent(target,body,verboseElements,references,nameSpaces);
- } catch(TypeException e) {
-
- if(Environment.DEBUG_XML)
- Environment.err.print(toString()+".endElement("+p0+
- ") failed to set content into target"+e+"\n");
-
- }
-
- //
- // PART 12: reapply remaining elements
- //
-
- Iterator iterator=elements.iterator();
-
- while(iterator.hasNext()) {
- ElementValue av=(ElementValue) iterator.next();
-
- try{
-
- // and try to set it in the target
- target=(av.getElement()).
- addElementContent(target,av.getValue(),references, nameSpaces);
-
- } catch(ElementException e) {
-
- if(Environment.DEBUG_XML)
- Environment.err.print(toString()+".endElement("+p0+
- "): failed to set element "+e+"\n");
-
- } // try
-
- } //while(iterator.hasNext())
-
- Object oldTarget=targetStack.pop();
- Object newTarget=null;
-
- if(!elementAdded.booleanValue()) {
- try{
- newTarget=element.addElementContent(oldTarget,target,references,
nameSpaces);
- } catch(ElementException e) {
- newTarget=oldTarget;
- }
-
- if(newTarget==null)
- ((Collection) elementsStack.peek()).add(new
ElementValue(element,target));
-
- } else
- newTarget=oldTarget;
-
- target=newTarget;
-
- } // if(ignoranceLevel>0)
-
- //
- // PART 13: Reinstall the old environment
- //
-
- if(ignoranceLevel==0) {
- nameSpaces=(Map) nameSpaceStack.pop();
- body=(String) bodyStack.pop();
- elements=(Collection) elementsStack.pop();
- type=(Type) typeStack.pop();
- element=(Element) elementStack.pop();
- elementAdded=(Boolean) elementsAdded.pop();
- }
-
- } // endElement
-
- // cummon
- public void startDocument() throws SAXException {
-
- if(Environment.DEBUG_XML)
- Environment.out.println(toString()+".startDocument()");
-
- }
-
- // crap
- public void setDocumentLocator(Locator p0) {
- }
-
- // do not want to know such crap
- public void ignorableWhitespace(char[] p0, int p1, int p2) throws
SAXException {
- }
-
- // uh, no
- public void processingInstruction(String p0, String p1) throws SAXException {
- }
-
- // we do not want to end the document, anyway
- // but whats the deal ...
- public void endDocument() throws SAXException {
- }
-
- } // class
-
- /**
- * helper class that stores intermediate
- * associations between elements and deserialised values
- */
-
- private static class ElementValue {
-
- final Element element;
- final Object value;
-
- public ElementValue(Element element, Object value) {
- this.element=element;
- this.value=value;
- }
-
- public Object getValue() {
- return value;
- }
-
- public Element getElement() {
- return element;
- }
- }
-
-} // XmlObjectReader
-
-/*
+/*
+ * $Id: XmlObjectReader.java,v 1.2 2000/12/04 12:36:21 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import de.infor.ce.util.URN;
+
+import org.zoap.xml.meta.builtin.DefaultBinding;
+
+import com.sun.xml.parser.Parser;
+
+import org.xml.sax.DocumentHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.AttributeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import java.net.URL;
+
+import java.io.Reader;
+import java.io.ObjectInput;
+import java.io.IOException;
+
+import java.util.Stack;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.Iterator;
+
+/**
+ * XmlObjectReader is a deserialisation service that reconstructs
+ * java objects from character streams using a given meta-model. <br>
+ * It currently builds on Suns Project-X SAX parser and registers there as a
document handler in order to build Java objects
+ * and schema information on the fly. Means that no intermediate DOM is built and
traversed which should speed up performance.
+ * <br> Note that, because of XML-1.0 compliance reasons, the Sun parser
+ * is currently bound to a single root-element per stream, otherwise gets angry.
Maybe
+ * this can be circumvented by underlying it a special reader that is able
+ * to mimique EOF after each root in order to realise a real streaming mode. <br>
ToDo: <ul>
+ * <li> Try to find reasonable default sizes for collections and maps from the
parsing info </li>
+ * <li> Implement the primitive types and connect them to the IO interface methods
</li> </ul>
+ * @see <related>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class XmlObjectReader extends Reader implements ObjectInput {
+
+ /** uses an embedded reader for input purposes */
+
+ private Reader reader;
+
+ /** this url is assigned to the reader */
+
+ private URN associatedUrn;
+
+ /** these urls have already been memorized */
+
+ private Collection visitedURNs;
+
+ /** the URNResolver */
+
+ private URNResolver urnResolver;
+
+ /** the type that is currently deserialised */
+
+ private Type type;
+
+ /** the stack of types we have encountered */
+
+ private Stack typeStack = new Stack();
+
+ /** the target object currently under consideration */
+
+ private Object target;
+
+ /** the stack of target objects */
+
+ private Stack targetStack = new Stack();
+
+ /** the element that we are currently inspecting */
+
+ private Element element;
+
+ /** the stack of elements that we are currently inspecting */
+
+ private Stack elementStack = new Stack();
+
+ /** the string that collects the spread body characters of an element */
+
+ private String body;
+
+ /** the stack of body fragments we have encountered so far */
+
+ private Stack bodyStack = new Stack();
+
+ /** whether the current element has already been successfully added */
+
+ private Boolean elementAdded;
+
+ /** which of the elements in the current path have already been successfully
added */
+
+ private Stack elementsAdded = new Stack();
+
+ /**
+ * the string that collects ignored elements into a verbose representation
+ * we dont need a stack, because it just collects ignored and coherent parts
of a documnet
+ */
+
+ private String verboseElements = "";
+
+ /** the sub-elements collected */
+
+ private Collection elements = new ArrayList();
+
+ /** the stack of unprocessed elements */
+
+ private Stack elementsStack = new Stack();
+
+ /** this mark is set if an xsi:null attribute has been seen lately */
+
+ private boolean isNull = false;
+
+ /** the map that stores the relation of global ids to object references */
+
+ private Map references = new HashMap();
+
+ /** the map that stores the namespace prefixes in relation to their schemas */
+
+ private Map nameSpaces;
+
+ /** on this stack, the nested namespace environment is stored */
+
+ private Stack nameSpaceStack = new Stack();
+
+ /** a corressponding SAX input-source bound to the reader */
+
+ private InputSource inputSource;
+
+ /** the embedded SAX parser, Suns Project-X for the moment */
+
+ private Parser parser = new Parser();
+
+ /** the level of ignorance we have cumulated */
+
+ private int ignoranceLevel = 0;
+
+ /** the databinding we apply */
+
+ private Binding binding;
+
+ /** accessor to binding */
+ public Binding getBinding() {
+ return binding;
+ }
+
+ /** accessor to binding */
+ public void setBinding(Binding theBinding) {
+ binding = theBinding;
+ nameSpaces = binding.getDefaultNameSpaceEnvironment();
+ }
+
+ /** accessor to URNResolver */
+ public URNResolver getURNResolver() {
+ return urnResolver;
+ }
+
+ /** resolve a given urn with the given urnResolver */
+ public XmlObjectReader resolveURN(URN theUrn) throws IOException {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() + ".resolveURN(" + theUrn +
")" + urnResolver);
+
+ URN newUrn = new URN(associatedUrn.getParent(), theUrn);
+
+ if (visitedURNs.contains(newUrn))
+ return null;
+ else
+ return urnResolver.resolveURN(newUrn, visitedURNs);
+ }
+
+ public Collection getVisitedURNs() {
+ return visitedURNs;
+ }
+
+ public void setVisitedURNs(Collection vU) {
+ visitedURNs = vU;
+ }
+
+ public Stack getTargetStack() {
+ return targetStack;
+ }
+
+ /** Constructor: create a new XmlObjectReader from a given reader with no
particular URL assigned to this reader */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader) {
+ this(theEmbeddedReader, (URN)null);
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URN associatedUrn) {
+ this(theEmbeddedReader, associatedUrn,
DefaultBinding.getDefaultBinding());
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URNResolver resolver)
{
+ this(theEmbeddedReader, (URN)null, DefaultBinding.getDefaultBinding(),
resolver,
+ new ArrayList());
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, Binding theBinding) {
+ this(theEmbeddedReader, (URN)null, theBinding);
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, Binding theBinding,
URNResolver resolver) {
+ this(theEmbeddedReader, (URN)null, theBinding, resolver,
+ new ArrayList());
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn, Binding
theBinding) {
+ this(theEmbeddedReader, theUrn, theBinding,
URNResolver.defaultUrnResolver,
+ new ArrayList());
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn,
URNResolver resolver) {
+ this(theEmbeddedReader, theUrn, DefaultBinding.getDefaultBinding(),
resolver,
+ new ArrayList());
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn, Binding
theBinding, URNResolver resolver) {
+ this(theEmbeddedReader, theUrn, theBinding, resolver,
+ new ArrayList());
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URN theUrn,
URNResolver resolver, Collection visitedURNs) {
+ this(theEmbeddedReader, theUrn, DefaultBinding.getDefaultBinding(),
resolver, visitedURNs);
+ }
+
+ /**
+ * Constructor: create a new XmlObjectReader from a given reader,
+ * @param theEmbeddedReader - a given character reader upon which the XML
document is transported
+ */
+
+ public XmlObjectReader(java.io.Reader theEmbeddedReader, URN associatedUrn,
+ Binding theDataBinding, URNResolver resolver, Collection visitedURNs) {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.println("XmlObjectReader(" + theEmbeddedReader
+ "," + associatedUrn +
+ "," + theDataBinding + "," + resolver + "," + visitedURNs +
")");
+
+ // set the embedded reader
+ reader = theEmbeddedReader;
+
+ // set the url
+ this.associatedUrn = associatedUrn;
+
+ // set the binding
+ binding = theDataBinding;
+
+ // construct an appropriate input source
+ inputSource =
+ new org.xml.sax.InputSource();
+
+ // and use the given reader as the character stream in that input
source
+ inputSource.setCharacterStream(theEmbeddedReader);
+
+ //inputSource.setEncoding("UTF-8");
+
+ // construct an inner class with access to private fields
+ // as the document handler for the parser
+ parser.setDocumentHandler(
+ new XmlDocumentHandler());
+
+ // and register the default namespace environment of this binding
+ nameSpaces = binding.getDefaultNameSpaceEnvironment();
+
+ // and register the binding itself under a very special reference
+ references.put("org.zoap.xml.XmlObjectReader", this);
+
+ // the resolver is registered
+ urnResolver = resolver;
+
+ this.visitedURNs = visitedURNs;
+ visitedURNs.add(associatedUrn);
+ }
+
+ /** Read and return an @return Object. */
+
+ public Object readObject() throws XmlException, IOException {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.println(toString() + ".readObject()");
+
+ try {
+
+ parser.parse(inputSource);
+
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() + ".readObject():
ready with parse" + elements + "\n");
+
+ // we iterate over the new appearances we have collected
+ java.util.Iterator iterator = elements.iterator();
+ Object result = null;
+
+ // and take exactly one object out of it
+ if (iterator.hasNext()) {
+ result = ((ElementValue)iterator.next()).getValue();
+ iterator.remove();
+ }
+
+ return result;
+
+ } catch (SAXException e) {
+
+ if (Environment.DEBUG_XML || Environment.LOG_XML > 0)
+ Environment.err.println(toString() + ".readObject():
produced parsing exception." + e);
+
+ throw new XmlException();
+
+ }
+
+ }
+
+ /** disabled, because the parser really closes the channel */
+
+ public void close() throws XmlException, IOException {
+ }
+
+ /** read a single Xml-ised character */
+
+ public int read() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** read a Xml-ised character buffer */
+
+ public int read(char[] cbuf) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** read a portion of a character buffer */
+
+ public int read(char[] cbuf, int off, int len) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Skip Xml-ised characters. */
+
+ public long skip(long n) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Tell whether this stream is ready to be read. */
+
+ public boolean ready() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Tell whether this stream supports the mark() operation. The default
implementation always returns false. */
+
+ public boolean markSupported() {
+ return false;
+ }
+
+ /** Mark the present position in the stream is not supported. */
+
+ public void mark(int readAheadLimit) throws IOException {
+ throw new IOException("mark() not supported");
+ }
+
+ /** Reset the stream is currently not supported. */
+
+ public void reset() throws IOException {
+ throw new IOException("reset() not supported");
+ }
+
+ /** Reads into an array of bytes. */
+
+ public int read(byte[] b) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Reads into an array of bytes. */
+
+ public int read(byte[] b, int off, int len) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Returns the number of bytes that can be read without blocking. */
+
+ public int available() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Reads some bytes from an input stream and stores them into the buffer array
<code>b</code>. The number of bytes
+ * read is equal to the length of <code>b</code>.
+ */
+
+ public void readFully(byte[] b) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Reads <code>len</code> bytes from an input stream. */
+
+ public void readFully(byte[] b, int off, int len) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Makes an attempt to skip over <code>n</code> bytes of data from the input
stream, discarding the skipped bytes. */
+
+ public int skipBytes(int n) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Reads one input byte and returns <code>true</code> if that byte is
nonzero, <code>false</code> if that byte is zero. */
+
+ public boolean readBoolean() throws IOException {
+ return ((Boolean)readObject()).booleanValue();
+ }
+
+ /**
+ * Reads and returns one input byte. The byte is treated as a signed value in
+ * the range <code>-128</code> through <code>127</code>, inclusive.
+ */
+
+ public byte readByte() throws IOException {
+ return ((Byte)readObject()).byteValue();
+ }
+
+ /**
+ * Reads one input byte, zero-extends it to type <code>int</code>, and returns
the result, which is therefore in the range
+ * <code>0</code> through <code>255</code>.
+ */
+
+ public int readUnsignedByte() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Reads two input bytes and returns a <code>short</code> value. */
+
+ public short readShort() throws IOException {
+ return ((Short)readObject()).shortValue();
+ }
+
+ /** Reads two input bytes and returns an <code>int</code> value in the range
<code>0</code> through <code>65535</code>. */
+
+ public int readUnsignedShort() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Reads an input <code>char</code> and returns the <code>char</code> value.
*/
+
+ public char readChar() throws IOException {
+ return ((Character)readObject()).charValue();
+ };
+
+ /** Reads four input bytes and returns an <code>int</code> value. */
+
+ public int readInt() throws IOException {
+ return ((Integer)readObject()).intValue();
+ }
+
+ /** Reads eight input bytes and returns a <code>long</code> value. */
+
+ public long readLong() throws IOException {
+ return ((Long)readObject()).longValue();
+ }
+
+ /** Reads four input bytes and returns a <code>float</code> value. */
+
+ public float readFloat() throws IOException {
+ return ((Float)readObject()).floatValue();
+ }
+
+ /** Reads eight input bytes and returns a <code>double</code> value. */
+
+ public double readDouble() throws IOException {
+ return ((Double)readObject()).doubleValue();
+ }
+
+ /** Reads the next line of text from the input stream. */
+
+ public String readLine() throws IOException {
+ return (String)readObject();
+ };
+
+ /** Reads in a string that has been encoded using a modified UTF-8 format. */
+
+ public String readUTF() throws IOException {
+ return (String)readObject();
+ }
+
+
+ /** inner class that operates as the interface of the reader to the parser */
+
+ class XmlDocumentHandler implements DocumentHandler {
+
+ /** what happens when an opening tag is found - this is going to be
verbose and interesting */
+
+ public void startElement(String p0, AttributeList p1) throws
SAXException {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() + ".startElement(" +
p0 + "," + p1 + ")\n");
+
+ // look if the level of ignorance is greater than zero
+ if (ignoranceLevel != 0) {
+
+ // then we couldnt understand that part of the
document anyway
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() +
".startElement(" + p0 + "," + p1 + "): ignorance mode.\n");
+
+ // hence collect the tag information inside the
verboseElements string
+ // for bunch-processing afterwards
+ verboseElements += "<" + p0 + " ";
+
+ // also the attribute stuff
+ for (int count = 0; count < p1.getLength(); count++)
+ verboseElements += p1.getName(count) + "=\"" +
p1.getValue(count) + "\" ";
+
+ // and close the tag also
+ verboseElements += ">" + Environment.LINE_SEPERATOR;
+
+ // increase the level to check when we are back in the
processible part
+ ignoranceLevel++;
+
+ } else {
+
+ // this is the real mode in which we try to understand
everything
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() +
".startElement(" + p0 + "," + p1 + "): element mode.\n");
+
+ //
+ // PART 1: Initialise the environment
+ //
+
+ // push the namespace thingy to the stack
+ nameSpaceStack.push(nameSpaces);
+ // push the body to the stack
+ bodyStack.push(body);
+ // push the last type to the stack
+ typeStack.push(type);
+ // push the last target to the stack
+ targetStack.push(target);
+ // push the last element to the stack
+ elementStack.push(element);
+ // push the appearances to the stack
+ elementsStack.push(elements);
+ elementsAdded.push(elementAdded);
+
+
+ // clone the namespace environment
+ nameSpaces = new HashMap(nameSpaces);
+
+ // initialise the body
+ body = new String();
+
+ // initialise sub-appearances
+ elements = new ArrayList();
+
+ // put the attributes into the variable
+ Map preAttributes = new HashMap(p1.getLength());
+
+ // initialise target
+ target = null;
+
+ // clear the verbose elements
+ verboseElements = new String();
+
+ // make a note abot whether we have already included
this element
+ // into its parent
+ elementAdded = new Boolean(false);
+
+ //
+ // PART 2: Initialise the namespaces and
preprocess/decode other attributes
+ //
+
+ for (int count = 0; count < p1.getLength(); count++) {
+
+ // if the attribute starts with xmlns, this is
a namespace candidate
+ if (p1.getName(count).startsWith("xmlns")) {
+
+ // find out the right suffix
+ String nameSpaceSuffix =
p1.getName(count).substring(5);
+ // test whether its a correct
xmlns{:bla}= thingy
+ if (nameSpaceSuffix.startsWith(":") ||
nameSpaceSuffix.equals("")) {
+ // yes, remove the colon
around to get the real suffix
+ if
(!nameSpaceSuffix.equals(""))
+ nameSpaceSuffix =
nameSpaceSuffix.substring(1);
+
+ URN urn = new URN(
+ new String[] {
Environment.decodeFromXml(p1.getValue(count)) });
+
+ // ok, we now found a proper
prefix, now turn to the schema/urn
+ Schema schema =
binding.getSchema(urn);
+
+ // if detectected unrecognized
namespace, we fake a schema for it
+ if (schema == null) {
+ schema = new Schema();
+ schema.setUrn(urn);
+
binding.addSchema(schema);
+ }
+
+ // register the looked up
namespace
+
nameSpaces.put(nameSpaceSuffix, schema);
+
+ } // if
nameSpaceSuffix.startsWith(":") || nameSpaceSuffix.equals(""))
+
+ } else {
+
+ // this is a proper attribute now,
store it for later processing
+ preAttributes.put(p1.getName(count),
p1.getValue(count));
+ // decoding of attributes is seemingly
done by the parser?
+ //
Environment.decodeFromXml(p1.getValue(count)));
+
+ }
+
+ } // for(int count=0;count<p1.getLength();count++)
+
+ //
+ // PART 3: Determine the element's basic type
+ //
+
+ String elementNameSpacePrefix =
Environment.getNameSpacePrefix(p0);
+ String elementName = Environment.getProperName(p0);
+ Schema schema =
(Schema)nameSpaces.get(elementNameSpacePrefix);
+
+ if (type == null && schema != null) {
+ // if this is a first-level element and its
schema has been recognised
+ element = schema.getElement(elementName);
+ } else if (type != null) {
+ // if this is a second- or nth-level element
+ element = type.getElement(schema, elementName);
+ } else
+ // if the schema has not been recognized
+ element = null;
+
+ // get the default type of that element
+ if (element != null)
+ type = element.getType();
+ else
+ type = null;
+
+ // if we could not look up the type, we ignore that
crap
+ if (type == null) {
+
+ if (Environment.DEBUG_XML ||
Environment.LOG_XML > 0)
+ Environment.out.print(toString() +
+ ".startElement(" + p0 + "," + p1 + "):
no such element/type.\n");
+
+ // but before, extend the verbose elements as
in pure ignorance mode
+ verboseElements += "<" + p0 + " ";
+
+ for (int count = 0; count < p1.getLength();
count++)
+ verboseElements += p1.getName(count) +
"=\"" + p1.getValue(count) + "\" ";
+
+ verboseElements += ">" +
Environment.LINE_SEPERATOR;
+
+ // increase the ignoranceLevel and you are
fine for this method
+ ignoranceLevel++;
+
+ } else {
+
+ //
+ // PART 4: Filter xsi:null and xsi:type
attributes for
+ // null-values and polymorphism
+ //
+
+ Iterator iterator =
preAttributes.keySet().iterator();
+
+ while (iterator.hasNext()) {
+ String attributeName =
(String)iterator.next();
+ String prefix =
Environment.getNameSpacePrefix(attributeName);
+
+ // compare the namespace with
XmlSchemaInstance (xsi)
+ if
(XmlSchemaInstance.getXmlSchemaInstance().equals(nameSpaces.get(prefix))) {
+
+ // we strip off the namespace
prefix from the local part
+ String suffix =
Environment.getProperName(attributeName);
+
+ // attributes have already
been decoded, so just test string equivalence
+ // on null=true
+ if ("null".equals(suffix) &&
+
"true".equals(preAttributes.get(attributeName))) {
+
+ if
(Environment.DEBUG_XML)
+
Environment.out.print(toString() + ".startElement(" + p0 + "," + p1 +
+ "): found
xsi:null.\n");
+
+ isNull = true;
+
+ // filter the
attribute, it is not needed anymore
+ iterator.remove();
+
+ // test string
equivalence type=""
+ } else if
("type".equals(suffix)) {
+
+ if
(Environment.DEBUG_XML)
+
Environment.out.print(toString() + ".startElement(" + p0 + "," + p1 +
+ "): found
xsi:type.\n");
+
+ // the attribute
contains a proper qname
+ String typeName =
(String)preAttributes.get(attributeName);
+ String typePrefix =
Environment.getNameSpacePrefix(typeName);
+ Schema typeSchema =
(Schema)nameSpaces.get(typePrefix);
+
+ // consult the
namespace-associated schema for determining/overriding the type
+ if (typeSchema !=
null) {
+ Type newType =
typeSchema.getType(Environment.getProperName(typeName));
+ if (newType !=
null && type.isSuperTypeOf(newType))
+ type =
newType;
+ }
+
+ // remove the attribute
+ iterator.remove();
+
+ } // if(suffix.equals("null")
+
+ } // if
XmlSchemaInstance.equals(namespaces.get()))
+
+ } // while(iterator.hasNext())
+
+ //
+ // PART 5: switch to ignorance mode if type
information is corrupt or
+ // null has been detected
+ //
+
+ if (type == null || isNull) {
+
+ if (Environment.DEBUG_XML &&
Environment.DEBUG_XML_META)
+
Environment.out.print(toString() +
+ ".startElement(" + p0 + "," +
p1 + "): encountered unknown type or null.\n");
+
+ // switch to ignorance mode and log
the stuff you get
+ verboseElements += "<" + p0 + " ";
+
+ for (int count = 0; count <
p1.getLength(); count++)
+ verboseElements +=
p1.getName(count) + "=\"" + p1.getValue(count) + "\" ";
+
+ verboseElements += ">" +
Environment.LINE_SEPERATOR;
+
+ ignoranceLevel++;
+
+
+ } else {
+
+ //
+ // PART 7: First try to
apply/rearrange the collected attributes maybe to
+ // dereference the target
+ //
+
+ Map attributes = new
HashMap(preAttributes.size());
+ iterator =
preAttributes.keySet().iterator();
+
+ // loop over the attributes map
+ while (iterator.hasNext()) {
+
+ // get the current key
+ String attributeFullName =
(String)iterator.next();
+ // find out its namespace
+ String
attributeNameSpacePrefix = Environment.
+
getNameSpacePrefix(attributeFullName);
+ // and local name
+ String attributeName =
Environment.getProperName(attributeFullName);
+ // to reconstruct the real
attribute structure
+ Attribute attribute =
type.getAttribute((Schema)
+
nameSpaces.get(attributeNameSpacePrefix),
+ attributeName);
+
+ if (attribute != null) {
+
+ try {
+
+ // get the type
+ Type
attributeType = attribute.getType();
+
+ // create an
object value for the attribute
+ Object value =
attributeType.
+
setContent(attributeType.newInstance(null, references, nameSpaces), (String)
+
preAttributes.get(attributeFullName), "", references, nameSpaces);
+
+ // and try to
set it in the target
+ target =
attribute.
+
setAttributeContent(target, value, references, nameSpaces);
+
+ // if the set
has not been successful (target=null), we defer the setting
+ if (target ==
null)
+
attributes.put(attribute, value);
+
+ } catch (TypeException
e) {
+
+ if
(Environment.DEBUG_XML || Environment.LOG_XML > 0)
+
Environment.err.print(toString() + ".startElement(" + p0 + "," + p1 +
+ "):
failed to create instance of attribute type " + e + "\n");
+
+ } catch
(AttributeException e) {
+
+ if
(Environment.DEBUG_XML || Environment.LOG_XML > 0)
+
Environment.err.print(toString() + ".endElement(" + p0 +
+ "):
could not set attribute " + e + "\n");
+
+ }
+
+ } // if
+
+ } // while
+
+ //
+ // PART 9: Build an object
+ //
+
+ if (target == null) {
+ try {
+ target =
type.newInstance(attributes, references, nameSpaces);
+ } catch (TypeException e) {
+
+ if
(Environment.DEBUG_XML || Environment.LOG_XML > 0)
+
Environment.err.print(toString() + ".endElement(" + p0 +
+ ") failed to
create instance of type " + e + "\n");
+
+ }
+ }
+
+ //
+ // PART 11: Reapply remaining
attributes
+ //
+
+ iterator =
attributes.keySet().iterator();
+
+ while (iterator.hasNext()) {
+
+ Attribute attribute =
(Attribute)iterator.next();
+
+ try {
+
+ // and try to set it
in the target
+ target =
attribute.setAttributeContent(target, attributes.get(attribute),
+ references,
nameSpaces);
+
+ } catch (AttributeException e)
{
+
+ if
(Environment.DEBUG_XML || Environment.LOG_XML > 0)
+
Environment.err.print(toString() + ".startElement(" + p0 + "," + p1 +
+ "): could not
set attribute " + e + "\n");
+
+ } // try
+
+ } //while(iterator.hasNext())
+
+ if (target != null &&
!type.isStateless()) {
+ Object oldTarget =
targetStack.pop();
+ Object newTarget;
+
+ try {
+ newTarget =
element.addElementContent(oldTarget, target, references, nameSpaces);
+ } catch (ElementException e) {
+ newTarget = oldTarget;
+ }
+
+ if (newTarget != null) {
+ elementAdded = new
Boolean(true);
+ } else {
+ if (newTarget == null)
{
+
((Collection)elementsStack.peek()).
+ add(
+ new
ElementValue(element, target));
+ }
+ }
+
+ targetStack.push(newTarget);
+ }
+
+ } // if(type!=null)
+
+ } // if(type==null)
+
+ } // if(ignoranceMode==0)
+
+ } // startElement
+
+ /** what happens if some characters are found inside the tag build a
real filter into this */
+
+ public void characters(char[] p0, int p1, int p2) throws SAXException {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.println(toString() + ".characters(" +
p1 + "," + p2 + ")");
+
+ if (ignoranceLevel == 0) {
+
+ //
+ // PART 6: increase the body of the tag
+ //
+
+ // remember to filter newlines etc.
+ if (p2 > 0 && p0[0] != '\n')
+ body += new String(p0, p1, p2);
+ } else {
+ verboseElements += new String(p0, p1, p2);
+ }
+
+ }
+
+ /** what happens if a closing tag is found, note quite as verbose but
not less interesting ;-) */
+
+ public void endElement(String p0) throws SAXException {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() + ".endElement(" + p0
+ ")\n");
+
+ if (ignoranceLevel > 0) {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() +
".endElement(" + p0 + "): ignorance mode.\n");
+
+ ignoranceLevel--;
+ isNull = false;
+
+ verboseElements += "</" + p0 + ">" +
Environment.LINE_SEPERATOR;
+
+ if (ignoranceLevel == 0) {
+ Object oldtarget = targetStack.pop();
+
+ if (!elementAdded.booleanValue() && element !=
null) {
+
+ try {
+ target =
+
element.addElementContent(oldtarget, null, references, nameSpaces);
+ } catch (ElementException e) {
+ target = oldtarget;
+ }
+
+ if (target == null)
+
((Collection)elementsStack.peek()).add(
+ new ElementValue(element,
null));
+ } else {
+ target = oldtarget;
+ }
+ }
+
+ } else {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.print(toString() +
".endElement(" + p0 + "): element mode.\n");
+
+ //
+ // PART 10: Insert the body and the verbose elements
+ //
+
+ try {
+ target = type.setContent(target, body,
verboseElements, references, nameSpaces);
+ } catch (TypeException e) {
+
+ if (Environment.DEBUG_XML)
+ Environment.err.print(toString() +
".endElement(" + p0 +
+ ") failed to set content into target"
+ e + "\n");
+
+ }
+
+ //
+ // PART 12: reapply remaining elements
+ //
+
+ Iterator iterator = elements.iterator();
+
+ while (iterator.hasNext()) {
+ ElementValue av =
(ElementValue)iterator.next();
+
+ try {
+
+ // and try to set it in the target
+ target = (av.getElement()).
+ addElementContent(target,
av.getValue(), references, nameSpaces);
+
+ } catch (ElementException e) {
+
+ if (Environment.DEBUG_XML)
+
Environment.err.print(toString() + ".endElement(" + p0 +
+ "): failed to set element " +
e + "\n");
+
+ } // try
+
+ } //while(iterator.hasNext())
+
+ Object oldTarget = targetStack.pop();
+ Object newTarget = null;
+
+ if (!elementAdded.booleanValue()) {
+ try {
+ newTarget =
element.addElementContent(oldTarget, target, references, nameSpaces);
+ } catch (ElementException e) {
+ newTarget = oldTarget;
+ }
+
+ if (newTarget == null)
+ ((Collection)elementsStack.peek()).add(
+ new ElementValue(element, target));
+
+ } else
+ newTarget = oldTarget;
+
+ target = newTarget;
+
+ } // if(ignoranceLevel>0)
+
+ //
+ // PART 13: Reinstall the old environment
+ //
+
+ if (ignoranceLevel == 0) {
+ nameSpaces = (Map)nameSpaceStack.pop();
+ body = (String)bodyStack.pop();
+ elements = (Collection)elementsStack.pop();
+ type = (Type)typeStack.pop();
+ element = (Element)elementStack.pop();
+ elementAdded = (Boolean)elementsAdded.pop();
+ }
+
+ } // endElement
+
+ // cummon
+ public void startDocument() throws SAXException {
+
+ if (Environment.DEBUG_XML)
+ Environment.out.println(toString() +
".startDocument()");
+
+ }
+
+ // crap
+ public void setDocumentLocator(Locator p0) {
+ }
+
+ // do not want to know such crap
+ public void ignorableWhitespace(char[] p0, int p1, int p2) throws
SAXException {
+ }
+
+ // uh, no
+ public void processingInstruction(String p0, String p1) throws
SAXException {
+ }
+
+ // we do not want to end the document, anyway
+ // but whats the deal ...
+ public void endDocument() throws SAXException {
+ }
+
+ } // class
+
+
+ /** helper class that stores intermediate associations between elements and
deserialised values */
+
+ private static class ElementValue {
+
+ final Element element;
+ final Object value;
+
+ public ElementValue(Element element, Object value) {
+ this.element = element;
+ this.value = value;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public Element getElement() {
+ return element;
+ }
+ }
+
+} // XmlObjectReader
+
+/*
* $Log: XmlObjectReader.java,v $
- * Revision 1.1 2000/08/10 21:07:41 jung
- * Initial revision
- *
- * Revision 1.1.2.4 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.3 2000/07/20 14:35:27 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.2 2000/07/17 12:46:18 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1.2.4 2000/07/11 16:40:12 jung
- * SOAP invocation handler that is able to dispatch methods with xml-string based
access.
- *
- * Revision 1.1.1.1.2.3 2000/07/11 08:08:34 jung
- * added functionality to store retrieve a part of a types elements
- * within "ignored" strings. Useful for writing generic handlers that
- * just process a part of the XML and transfer the rest.
- *
- * Revision 1.1.1.1.2.2 2000/07/07 15:50:03 jung
- * Request-Response Structure close to MS-SOAP
- *
- * removed a mega-bug in return element
- *
- * Revision 1.1.1.1.2.1 2000/07/07 13:29:39 jung
- * removed a bug in the element detection routine related to
- * non-existant namespaces/schemas
- *
- * Revision 1.1.1.1 2000/07/06 14:11:28 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- * Revision 1.1.1.1 2000/06/19 12:04:13 jung
- * imported ZOAPackage that should
- * go into a seperate Open Source project
- *
- * Revision 1.2.2.3 2000/06/15 14:50:07 jung
- * first SOAP-enabled container runs
- *
- * Revision 1.2.2.2 2000/06/14 12:38:17 jung
- * removed the NEWLINE bug: since infor:X was just using
- * \n to mark the end of a line in serialisation, any subsequent
- * stream processing that relies on a proper newline (and any
- * subsequent derserialisation that tries to grab characters out of a tag)
- * must be confused.
- *
- * When going to \r\n and appropriately adjusting the readCharacters
- * methods in the basic types and the DocumentHandler of
- * XmlObjectReader, this symptom has now vanished.
- *
- * Looks like resolved ...
- *
- * Revision 1.2.2.1 2000/06/08 17:15:47 jung
- * added initial soap service that uses the infor:X framework.
- *
- * Revision 1.2 2000/06/06 19:42:31 jung
- * added transaction support.
- *
- * redesigned the dataAccess package to provide BSF database
- * sessions as transactional resources under any TXManager.
- *
- * DataAccess now manages the mappingData associations to apartments
- * and threads.
- *
- * test component runs.
- *
- * Revision 1.1 2000/06/05 09:16:55 jung
- * added an initial revision of infor:X, the
- * XML (de-)serialisation service of infor:CE.
- *
- * supports meta-data structures, namespaces, schemas.
- *
- * lacks collection support, forward-references, multiple roots
- * and external resolution.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:21 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:41 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.4 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.3 2000/07/20 14:35:27 jung
+ * some refactoring inside infor:xml
+ *
+ * Revision 1.1.2.2 2000/07/17 12:46:18 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1.2.4 2000/07/11 16:40:12 jung
+ * SOAP invocation handler that is able to dispatch methods with xml-string based
access.
+ *
+ * Revision 1.1.1.1.2.3 2000/07/11 08:08:34 jung
+ * added functionality to store retrieve a part of a types elements
+ * within "ignored" strings. Useful for writing generic handlers that
+ * just process a part of the XML and transfer the rest.
+ *
+ * Revision 1.1.1.1.2.2 2000/07/07 15:50:03 jung
+ * Request-Response Structure close to MS-SOAP
+ *
+ * removed a mega-bug in return element
+ *
+ * Revision 1.1.1.1.2.1 2000/07/07 13:29:39 jung
+ * removed a bug in the element detection routine related to
+ * non-existant namespaces/schemas
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:28 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ * Revision 1.1.1.1 2000/06/19 12:04:13 jung
+ * imported ZOAPackage that should
+ * go into a seperate Open Source project
+ *
+ * Revision 1.2.2.3 2000/06/15 14:50:07 jung
+ * first SOAP-enabled container runs
+ *
+ * Revision 1.2.2.2 2000/06/14 12:38:17 jung
+ * removed the NEWLINE bug: since infor:X was just using
+ * \n to mark the end of a line in serialisation, any subsequent
+ * stream processing that relies on a proper newline (and any
+ * subsequent derserialisation that tries to grab characters out of a tag)
+ * must be confused.
+ *
+ * When going to \r\n and appropriately adjusting the readCharacters
+ * methods in the basic types and the DocumentHandler of
+ * XmlObjectReader, this symptom has now vanished.
+ *
+ * Looks like resolved ...
+ *
+ * Revision 1.2.2.1 2000/06/08 17:15:47 jung
+ * added initial soap service that uses the infor:X framework.
+ *
+ * Revision 1.2 2000/06/06 19:42:31 jung
+ * added transaction support.
+ *
+ * redesigned the dataAccess package to provide BSF database
+ * sessions as transactional resources under any TXManager.
+ *
+ * DataAccess now manages the mappingData associations to apartments
+ * and threads.
+ *
+ * test component runs.
+ *
+ * Revision 1.1 2000/06/05 09:16:55 jung
+ * added an initial revision of infor:X, the
+ * XML (de-)serialisation service of infor:CE.
+ *
+ * supports meta-data structures, namespaces, schemas.
+ *
+ * lacks collection support, forward-references, multiple roots
+ * and external resolution.
+ *
+ */
1.2 +813 -784 zoap/src/org/zoap/xml/XmlObjectWriter.java
Index: XmlObjectWriter.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/XmlObjectWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XmlObjectWriter.java 2000/08/10 21:07:43 1.1
+++ XmlObjectWriter.java 2000/12/04 12:36:22 1.2
@@ -1,787 +1,822 @@
-/*
- * $Id: XmlObjectWriter.java,v 1.1 2000/08/10 21:07:43 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-import org.zoap.xml.meta.builtin.DefaultBinding;
-
-import java.io.Writer;
-import java.io.ObjectOutput;
-import java.io.IOException;
-
-import java.util.ArrayList;
-import java.util.Stack;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * XmlObjectWriter is a serialisation writer that persists
- * java objects into character streams via an extendible
- * meta-model @see Binding (where it relies on
- * @see org.zoap.soap.builtin.DefaultBinding if no particular
- * meta-model is requested)
- * <br>
- * XmlObjectWriter provides support for dealing with nested namespace definitions
- * ("xmlns:<prefix>="<urn>") that are tight to particular @see Schema descriptions.
- * It includes native methods to treat nullable values
("<xsi-prefix>:null=\"true\"") and polymorhism
- * ("<xsi-prefix>:type=\"<typeTag>\""). And it provides the basic infrastructure to
- * define various ID and IDREF structures as defined in the XML1.0 and the
- * Xml-Schema specification.
- * <br>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class XmlObjectWriter extends Writer implements ObjectOutput {
-
- /**
- * uses an embedded writer for output
- */
-
- private Writer writer;
-
- /**
- * has a related binding
- */
-
- private Binding binding;
-
- /**
- * the reference structure builds up a map from objects to properties which carry
- * the globally unique ids of the objects under particular perspectives.
- */
-
- private Map references=new HashMap();
-
- /**
- * Contructor: Create an XmlObjectWriter from an embedded writer and a given
- * data-binding. Note that the embeddedWriter better been synchronised on itself
- * as the lock, as otherwise multi-threaded access from several levels
- * could corrupt the underlying representation, at least at the XML level. The
constructor
- * will furthermore utter an <?xml version="1.0"?> line to the writer in order to
- * markup the stream as being now XML1.0 compatible.
- */
-
- public XmlObjectWriter(Writer theEmbeddedWriter, Binding theDataBinding) {
-
- if(Environment.DEBUG_XML)
-
Environment.out.print(toString()+"("+theEmbeddedWriter+","+theDataBinding+")\n");
-
- writer=theEmbeddedWriter;
- binding=theDataBinding;
-
- try{
- writer.write("<?xml version=\"1.0\"?>\r\n");
- } catch(java.io.IOException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0) {
- Environment.err.print(toString()+"("+theEmbeddedWriter+","+theDataBinding+
- "): encountered "+e+" while writing XML header. \n");
- }
-
- }
-
- }
-
- /**
- * Contructor: Create an XmlObjectWriter from an embedded writer, uses the
- * default data-binding
- */
-
- public XmlObjectWriter(Writer theEmbeddedWriter) {
- this(theEmbeddedWriter,DefaultBinding.getDefaultBinding());
- }
-
-
- /**
- * Serialise an object @param obj to the underlying writer. @throws
java.io.IOException if
- * some output error occurred due to some obscure reasons (real output problem)
or more
- * straightforward reasons (XML serialisation problem).
- */
-
- public void writeObject(Object obj) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeObject("+obj+")\n");
-
- // lookup a dedicated element in the binding that is willing to treat the object
- Element element=binding.findElementCompatibleTo(obj,null);
-
- // prepare environment information
- Stack nameSpaceStack=new Stack();
-
- // initial name spaces set to the ones that are proposed by the binding
- nameSpaceStack.push(binding.getDefaultNameSpaceEnvironment());
-
- // write the object as an element must be synchronized not to mess up the
caches and the stream
- synchronized(writer) {
- writeElement(element,obj,nameSpaceStack);
- }
- }
-
- /**
- * writes the object @arg obj as an XML element @element under the given namespace
- * environment @arg nameSpaceStack (we expect the stack to contain a map of
- * currently available namespaces outside the scope of the element to print). If
@arg element is
- * null, an @throws NoCompatibleElementException is thrown.
- */
-
- protected void writeElement(Element element, Object obj, Stack nameSpaceStack)
- throws IOException, NoCompatibleElementException {
-
- if(Environment.DEBUG_XML)
-
Environment.out.println(toString()+".writeElement("+element+","+obj+","+nameSpaceStack+")");
-
- // element must be non-null, otherwise we throw an exception
- if(element==null)
- throw new NoCompatibleElementException();
-
- // we extend the current nameSpaceStack by a new scope that is cloned
- HashMap nameSpaces=new HashMap((Map) nameSpaceStack.peek());
- nameSpaceStack.push(nameSpaces);
-
- // here, we collect the namespaces that we still need to define
- ArrayList lackingNameSpaces=new ArrayList();
-
- // we find out what would be the right prefix for this element
- String nameSpacePrefixForElement=(String) nameSpaces.
- get(element.getAppearanceSchema());
-
- // if the prefix is yet null, we have to utter the namespace to get some prefix
- if(nameSpacePrefixForElement==null) {
- lackingNameSpaces.add(element.getAppearanceSchema());
- nameSpacePrefixForElement="n"+(nameSpaces.size()+1)+":";
- nameSpaces.put(element.getAppearanceSchema(),nameSpacePrefixForElement);
- }
-
- // output the element global and local name
- writer.write("<"+nameSpacePrefixForElement+element.getAppearanceName());
-
- // this is the type which we use to utter the object
- Type type=element.getType(obj);
-
- // this is the property sheet that we annotate the object with
- // the meta-model is allowd to put arbitrary information into there
- // in order to keep state that is hidden from us
- Properties objectIds=null;
-
- // whether we have already seen that object
- boolean isNew=true;
-
- // is the object non-empty?
- if(obj==null) {
- // we use the xsi:null attribute for indicating "null"
- // first check whether the xsi-namespace is here
- String nameSpacePrefixForNullAttribute=(String) nameSpaces.
- get(XmlSchemaInstance.getXmlSchemaInstance());
-
- // no, we have to utter it
- if(nameSpacePrefixForNullAttribute==null) {
- lackingNameSpaces.add(XmlSchemaInstance.getXmlSchemaInstance());
- nameSpacePrefixForNullAttribute="n"+(nameSpaces.size()+1)+":";
-
nameSpaces.put(XmlSchemaInstance.getXmlSchemaInstance(),nameSpacePrefixForNullAttribute);
- }
-
- // then simply write the attribute
- writer.write(" "+nameSpacePrefixForNullAttribute+"null=\"true\"");
-
- } else {
-
- // polymorhpism support, get the most specific type of this element for the
given object
- Type specificType=binding.findTypeCompatibleTo(obj,null);
-
- // see whether default and specific type differ and are compatible
- if(specificType!=null && !type.equals(specificType) &&
type.isSuperTypeOf(specificType)) {
-
- // yes, we use the more specific one
- type=specificType;
-
- // and add an xsi:type attribute as markup
- String nameSpacePrefixForTypeAttribute=(String) nameSpaces.
- get(XmlSchemaInstance.getXmlSchemaInstance());
-
- if(nameSpacePrefixForTypeAttribute==null) {
- lackingNameSpaces.add(XmlSchemaInstance.getXmlSchemaInstance());
- nameSpacePrefixForTypeAttribute="n"+(nameSpaces.size()+1)+":";
-
nameSpaces.put(XmlSchemaInstance.getXmlSchemaInstance(),nameSpacePrefixForTypeAttribute);
- }
-
- String typeNamePrefix=(String) nameSpaces.get(type.getTypeSchema());
-
- if(typeNamePrefix==null) {
- lackingNameSpaces.add(type.getTypeSchema());
- typeNamePrefix="n"+(nameSpaces.size()+1)+":";
- nameSpaces.put(type.getTypeSchema(),typeNamePrefix);
- }
-
- writer.write(" "+nameSpacePrefixForTypeAttribute+"type=\""+
- typeNamePrefix+type.getTypeName()+"\"");
- } // if(!type.equals(specificType)
-
- // determine whether this object has already been seen
- // by getting its objectid map
- objectIds=(Properties) references.get(obj);
- isNew=objectIds==null;
-
- // if not present, then we initialise the id properties
- if(isNew && type.isReferencable()) {
- objectIds=new Properties();
- // the default property used by this class
- objectIds.put("XmlObjectWriter",new Integer(references.size()));
- references.put(obj,objectIds);
- }
-
- } // if (obj==null)
-
- // build the inheritance structure in a collection
- Collection inheritanceCollection=
- buildInheritanceChain(type,new ArrayList());
-
- // and iterate over it
- Iterator inheritanceIterator=inheritanceCollection.iterator();
-
- while(inheritanceIterator.hasNext()) {
-
- // now we utter the attributes for a particular supertype
- Attribute[] attributes=((Type) inheritanceIterator.next()).
- getAttributes(obj);
-
- // if there are some
- if(attributes!=null) {
- for(int count=0;count<attributes.length;count++) {
- try{
-
- // ask the attribute to produce a value for the obj under the property
objectIds
- // and grab out its string-based content depending on its type
- String output=attributes[count].getType(obj).
-
getContent(attributes[count].getAttributeContent(obj,isNew,objectIds));
-
- if(output!=null) {
-
- // try to obtain a namespace for the schema of this attribute
- Object nameSpacePrefixForAttribute=
- nameSpaces.get(attributes[count].getAppearanceSchema());
-
- // if its not visible in this scope, introduce it
- if(nameSpacePrefixForAttribute==null) {
- lackingNameSpaces.add(attributes[count].getAppearanceSchema());
- nameSpacePrefixForAttribute="n"+(nameSpaces.size()+1)+":";
- nameSpaces.put(attributes[count].getAppearanceSchema(),
- nameSpacePrefixForAttribute);
- }
-
- //next utter the attribute
- writer.write(" "+nameSpacePrefixForAttribute+attributes[count].
- getAppearanceName()+"=\""+output+"\"");
-
- } // if(output!=null)
-
- } catch(AttributeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
-
Environment.err.print(toString()+".writeElement("+element+","+obj+","+
- nameSpaceStack+") encountered "+e+". Ignoring attribute
"+attributes[count].getAppearanceName()+".\n");
-
- } catch(TypeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
-
Environment.err.print(toString()+".writeElement("+element+","+obj+","+
- nameSpaceStack+") encountered "+e+". Ignoring attribute
"+attributes[count].getAppearanceName()+" .\n");
-
- }
-
- } // for
-
- } //if(attributes!=null)
-
- } // while (inheritanceIterator.hasNext())
-
- // next we have to issue the lacking namespaces
- Iterator lackingNameSpacesIterator=lackingNameSpaces.iterator();
-
- // loop through them
- while(lackingNameSpacesIterator.hasNext()) {
-
- Schema currentSchema=(Schema) lackingNameSpacesIterator.next();
-
- // find the right prefix
- String prefix=(String) nameSpaces.get(currentSchema);
-
- // this should never happen
- if(prefix==null)
- throw new RuntimeException(toString()+".writeElement(): namespace handling
fucked up.");
-
- // turn the colon around, if present
- if(prefix.endsWith(":"))
- prefix=":"+prefix.substring(0,prefix.length()-1);
-
- writer.write(" xmlns"+prefix+"=\""+
- currentSchema.getUrn().toString()+"\"");
-
- } // while (lackingNameSpaceIterator.hasNext())
-
- // ready, we close this opening tag and insert a line seperator
- writer.write(">"+Environment.LINE_SEPERATOR);
-
- // utter the verbose elements apparent in this element
- if(type.getVerboseElements(obj)!=null)
- writer.write(type.getVerboseElements(obj).toString());
-
- // refresh the iterator to begin from above
- inheritanceIterator=inheritanceCollection.iterator();
-
- while(inheritanceIterator.hasNext()) {
-
- // next the element part
- Element[] elements=((Type) inheritanceIterator.next()).getElements(obj);
-
- if(elements!=null) {
- for(int count=0;count<elements.length;count++) {
- try{
- Object[] output=elements[count].
- getElementContents(obj,isNew,objectIds);
-
- if(output!=null)
- for(int count2=0;count2<output.length;count2++) {
- writeElement(elements[count],output[count2],nameSpaceStack);
- }
-
- } catch(ElementException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
-
Environment.err.print(toString()+".writeElement("+element+","+obj+","+
- nameSpaceStack+") encountered "+e+" Ignoring element.\n");
-
- } catch(TypeException e) {
-
- if(Environment.DEBUG_XML || Environment.LOG_XML>0)
-
Environment.err.println(toString()+".writeElement("+element+","+obj+","+
- nameSpaceStack+") encountered "+e+" Ignoring element.\n");
-
- }
-
- } // for
-
- } // if
-
- } // while
-
- // this is for the string-based body of the type
- String output=type.getContent(obj);
-
- // its non-null, so utter it
- if(output!=null)
- writer.write(output.toString()+Environment.LINE_SEPERATOR);
-
- // utter the closing tag
- writer.write("</"+nameSpacePrefixForElement+element.getAppearanceName()+">"+
- Environment.LINE_SEPERATOR);
-
- // and finally reinstall the namespaces
- nameSpaceStack.pop();
-
- } // writeElement
-
- /**
- * traces an inheritance chain in a collection
- */
-
- private Collection buildInheritanceChain(Type type, Collection inCollection) {
-
- if(Environment.DEBUG_XML)
-
Environment.out.print(toString()+".buildInheritanceChain("+type+","+inCollection+")\n");
-
- if(type==null)
- return inCollection;
-
- Collection result=buildInheritanceChain(type.getSuperType(),inCollection);
- result.add(type);
- return result;
- }
-
- /**
- * Writes an array of bytes. This method will block until the bytes
- * are actually written.
- */
-
- public void write(byte[] b) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+b+")\n");
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * Writes a sub array of bytes.
- */
-
- public void write(byte[] b, int off, int len) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+b+","+off+","+len+")\n");
-
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * Writes a <code>boolean</code> value to this output stream.
- */
-
- public void writeBoolean(boolean v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeBoolean("+v+")\n");
-
- writeObject(new Boolean(v));
- }
-
- /**
- * Writes to the output stream the eight low-
- * order bits of the argument <code>v</code>.
- */
-
- public void writeByte(int v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeByte("+v+")\n");
-
- writeObject(new Byte((byte) v));
- }
-
- /**
- * Writes two bytes to the output
- * stream to represent the value of the argument.
- */
-
- public void writeShort(int v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeShort("+v+")\n");
-
- writeObject(new Short((short) v));
- }
-
- /**
- * Writes a <code>char</code> value, wich
- * is comprised of two bytes, to the
- * output stream.
- */
-
- public void writeChar(int v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeChar("+v+")\n");
-
- writeObject(new Character((char) v));
- }
-
- /**
- * Writes an <code>int</code> value, which is
- * comprised of four bytes, to the output stream.
- */
-
- public void writeInt(int v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+v+")\n");
-
- writeObject(new Integer(v));
- }
-
- /**
- * Writes an <code>long</code> value, which is
- * comprised of four bytes, to the output stream.
- */
-
- public void writeLong(long v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeLong("+v+")\n");
-
- writeObject(new Long(v));
- }
-
- /**
- * Writes a <code>float</code> value,
- * which is comprised of four bytes, to the output stream.
- */
- public void writeFloat(float v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeFloat("+v+")\n");
-
- writeObject(new Float(v));
- }
-
- /**
- * Writes a <code>double</code> value,
- * which is comprised of eight bytes, to the output stream.
- */
- public void writeDouble(double v) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeDouble("+v+")\n");
-
- writeObject(new Double(v));
- }
-
- /**
- * Writes a string to the output stream.
- */
-
- public void writeBytes(String s) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeBytes("+s+")\n");
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * Writes every character in the string <code>s</code>,
- * to the output stream, in order,
- * two bytes per character.
- */
-
- public void writeChars(String s) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeChars("+s+")\n");
-
- throw new UnsupportedOperationException();
-
- }
-
- /**
- * Writes two bytes of length information
- * to the output stream, followed
- * by the Java modified UTF representation
- * of every character in the string <code>s</code>.
- */
-
- public void writeUTF(String str) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".writeUTF("+str+")\n");
-
- writeObject(str);
- }
-
- /**
- * write buffer of characters into XML, uses default data-binding
- */
-
- public void write(char[] cbuf) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+cbuf+")\n");
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * write portion of buffer of characters is XMLised
- */
-
- public void write(char[] cbuf, int off, int len) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+cbuf+","+off+","+len+")\n");
-
- throw new UnsupportedOperationException();
- }
-
-
- /**
- * write character is XMLised
- */
-
- public void write(int aAhar) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+aAhar+")\n");
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * write string is XMLised
- */
-
- public void write(String string) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+string+")\n");
-
- writeObject(string);
- }
-
- /**
- * write string is XMLised
- */
-
- public void write(String string,int off,int len) throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".write("+string+","+off+","+len+")\n");
-
- throw new UnsupportedOperationException();
- }
-
- /**
- * the close method is simply redirected to the writer
- */
-
- public void close() throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".close()\n");
-
- writer.close();
- }
-
- /**
- * the flush method is simply redirected to the writer
- */
-
- public void flush() throws IOException {
-
- if(Environment.DEBUG_XML)
- Environment.out.print(toString()+".flush()\n");
-
- writer.flush();
- }
-}
-
-/**
+/*
+ * $Id: XmlObjectWriter.java,v 1.2 2000/12/04 12:36:22 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+import org.zoap.xml.meta.builtin.DefaultBinding;
+
+import java.io.Writer;
+import java.io.ObjectOutput;
+import java.io.IOException;
+
+import java.util.ArrayList;
+import java.util.Stack;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * XmlObjectWriter is a serialisation writer that persists
+ * java objects into character streams via an extendible
+ * meta-model @see Binding (where it relies on
+ * @see org.zoap.soap.builtin.DefaultBinding if no particular
+ * meta-model is requested)
+ * <br>
+ * XmlObjectWriter provides support for dealing with nested namespace definitions
+ * ("xmlns:<prefix>="<urn>") that are tight to particular @see Schema descriptions.
+ * It includes native methods to treat nullable values
("<xsi-prefix>:null=\"true\"") and polymorhism
+ * ("<xsi-prefix>:type=\"<typeTag>\""). And it provides the basic infrastructure to
+ * define various ID and IDREF structures as defined in the XML1.0 and the
+ * Xml-Schema specification.
+ * <br>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class XmlObjectWriter extends Writer implements ObjectOutput {
+
+ /**
+ * uses an embedded writer for output
+ */
+
+ private Writer writer;
+
+ /**
+ * has a related binding
+ */
+
+ private Binding binding;
+
+ /**
+ * and a serialisation policy
+ */
+
+ private SerialisationPolicy policy;
+
+ /**
+ * the reference structure builds up a map from objects to properties which carry
+ * the globally unique ids of the objects under particular perspectives.
+ */
+
+ private Map references=new HashMap();
+
+ /**
+ * Contructor: Create an XmlObjectWriter from an embedded writer and a given
+ * data-binding. Note that the embeddedWriter better been synchronised on itself
+ * as the lock, as otherwise multi-threaded access from several levels
+ * could corrupt the underlying representation, at least at the XML level. The
constructor
+ * will furthermore utter an <?xml version="1.0"?> line to the writer in order to
+ * markup the stream as being now XML1.0 compatible.
+ */
+
+ public XmlObjectWriter(Writer theEmbeddedWriter, Binding theDataBinding,
SerialisationPolicy policy) {
+
+ if(Environment.DEBUG_XML)
+
Environment.out.print(toString()+"("+theEmbeddedWriter+","+theDataBinding+")\n");
+
+ writer=theEmbeddedWriter;
+ binding=theDataBinding;
+ this.policy=policy;
+
+ try{
+// writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
+ writer.write("<?xml version=\"1.0\"?>\r\n");
+ } catch(java.io.IOException e) {
+
+ if(Environment.DEBUG_XML || Environment.LOG_XML>0) {
+ Environment.err.print(toString()+"("+theEmbeddedWriter+","+theDataBinding+
+ "): encountered "+e+" while writing XML header. \n");
+ }
+
+ }
+
+ }
+
+ /**
+ * Contructor: Create an XmlObjectWriter from an embedded writer, uses the
+ * default data-binding
+ */
+
+ public XmlObjectWriter(Writer theEmbeddedWriter) {
+ this(theEmbeddedWriter,DefaultBinding.getDefaultBinding());
+ }
+
+ /**
+ * Contructor: Create an XmlObjectWriter from an embedded writer, uses the
+ * default data-binding
+ */
+
+ public XmlObjectWriter(Writer theEmbeddedWriter, Binding binding) {
+ this(theEmbeddedWriter,binding,SerialisationPolicy.defaultSerialisationPolicy);
+ }
+
+ /**
+ * Serialise an object @param obj to the underlying writer. @throws
java.io.IOException if
+ * some output error occurred due to some obscure reasons (real output problem)
or more
+ * straightforward reasons (XML serialisation problem).
+ */
+
+ public void writeObject(Object obj) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeObject("+obj+")\n");
+
+ // lookup a dedicated element in the binding that is willing to treat the object
+ Element element=binding.findElementCompatibleTo(obj,null);
+
+ // prepare environment information
+ Stack nameSpaceStack=new Stack();
+
+ // initial name spaces set to the ones that are proposed by the binding
+ nameSpaceStack.push(binding.getDefaultNameSpaceEnvironment());
+
+ // write the object as an element must be synchronized not to mess up the
caches and the stream
+ synchronized(writer) {
+ writeElement(element,obj,nameSpaceStack,0);
+ }
+ }
+
+ /**
+ * writes the object @arg obj as an XML element @element under the given namespace
+ * environment @arg nameSpaceStack (we expect the stack to contain a map of
+ * currently available namespaces outside the scope of the element to print). If
@arg element is
+ * null, an @throws NoCompatibleElementException is thrown.
+ */
+
+ protected void writeElement(Element element, Object obj, Stack nameSpaceStack,
int depth)
+ throws IOException, NoCompatibleElementException {
+
+ if(Environment.DEBUG_XML)
+
Environment.out.println(toString()+".writeElement("+element+","+obj+","+nameSpaceStack+","+depth+")");
+
+ // element must be non-null, otherwise we throw an exception
+ if(element==null)
+ throw new NoCompatibleElementException();
+
+ // we extend the current nameSpaceStack by a new scope that is cloned
+ HashMap nameSpaces=new HashMap((Map) nameSpaceStack.peek());
+ nameSpaceStack.push(nameSpaces);
+
+ // here, we collect the namespaces that we still need to define
+ ArrayList lackingNameSpaces=new ArrayList();
+
+ // we find out what would be the right prefix for this element
+ String nameSpacePrefixForElement=(String) nameSpaces.
+ get(element.getAppearanceSchema());
+
+ // if the prefix is yet null, we have to utter the namespace to get some prefix
+ if(nameSpacePrefixForElement==null) {
+ lackingNameSpaces.add(element.getAppearanceSchema());
+ nameSpacePrefixForElement="n"+(nameSpaces.size()+1)+":";
+ nameSpaces.put(element.getAppearanceSchema(),nameSpacePrefixForElement);
+ }
+
+ // output the element global and local name
+ writer.write("<"+nameSpacePrefixForElement+element.getAppearanceName());
+
+ // this is the type which we use to utter the object
+ Type type=element.getType(obj);
+
+ // this is the property sheet that we annotate the object with
+ // the meta-model is allowd to put arbitrary information into there
+ // in order to keep state that is hidden from us
+ Properties objectIds=null;
+
+ // whether we have already seen that object
+ boolean isNew=true;
+
+ // is the object non-empty?
+ if(obj==null) {
+ // we use the xsi:null attribute for indicating "null"
+ // first check whether the xsi-namespace is here
+ String nameSpacePrefixForNullAttribute=(String) nameSpaces.
+ get(XmlSchemaInstance.getXmlSchemaInstance());
+
+ // no, we have to utter it
+ if(nameSpacePrefixForNullAttribute==null) {
+ lackingNameSpaces.add(XmlSchemaInstance.getXmlSchemaInstance());
+ nameSpacePrefixForNullAttribute="n"+(nameSpaces.size()+1)+":";
+
nameSpaces.put(XmlSchemaInstance.getXmlSchemaInstance(),nameSpacePrefixForNullAttribute);
+ }
+
+ // then simply write the attribute
+ writer.write(" "+nameSpacePrefixForNullAttribute+"null=\"true\"");
+
+ } else {
+
+ // polymorhpism support, get the most specific type of this element for the
given object
+ Type specificType=binding.findTypeCompatibleTo(obj,null);
+
+ // see whether default and specific type differ and are compatible
+ if(specificType!=null && !type.equals(specificType) &&
type.isSuperTypeOf(specificType)) {
+
+ // yes, we use the more specific one
+ type=specificType;
+
+ // and add an xsi:type attribute as markup
+ String nameSpacePrefixForTypeAttribute=(String) nameSpaces.
+ get(XmlSchemaInstance.getXmlSchemaInstance());
+
+ if(nameSpacePrefixForTypeAttribute==null) {
+ lackingNameSpaces.add(XmlSchemaInstance.getXmlSchemaInstance());
+ nameSpacePrefixForTypeAttribute="n"+(nameSpaces.size()+1)+":";
+
nameSpaces.put(XmlSchemaInstance.getXmlSchemaInstance(),nameSpacePrefixForTypeAttribute);
+ }
+
+ String typeNamePrefix=(String) nameSpaces.get(type.getTypeSchema());
+
+ if(typeNamePrefix==null) {
+ lackingNameSpaces.add(type.getTypeSchema());
+ typeNamePrefix="n"+(nameSpaces.size()+1)+":";
+ nameSpaces.put(type.getTypeSchema(),typeNamePrefix);
+ }
+
+ writer.write(" "+nameSpacePrefixForTypeAttribute+"type=\""+
+ typeNamePrefix+type.getTypeName()+"\"");
+ } // if(!type.equals(specificType)
+
+ // determine whether this object has already been seen
+ // by getting its objectid map
+ objectIds=(Properties) references.get(obj);
+ isNew=objectIds==null;
+
+ // if not present, then we initialise the id properties
+ if(isNew && type.isReferencable()) {
+ objectIds=new Properties();
+ // the default property used by this class
+ objectIds.put("XmlObjectWriter",new Integer(references.size()));
+ references.put(obj,objectIds);
+ }
+
+ } // if (obj==null)
+
+ // build the inheritance structure in a collection
+ Collection inheritanceCollection=
+ buildInheritanceChain(type,new ArrayList());
+
+ // and iterate over it
+ Iterator inheritanceIterator=inheritanceCollection.iterator();
+
+ while(inheritanceIterator.hasNext()) {
+
+ // now we utter the attributes for a particular supertype
+ Attribute[] attributes=((Type) inheritanceIterator.next()).
+ getAttributes(obj);
+
+ // if there are some
+ if(attributes!=null) {
+ for(int count=0;count<attributes.length;count++) {
+ try{
+
+ if(policy.isToBeSerialised(obj,attributes[count],depth)) {
+ // ask the attribute to produce a value for the obj under the property
objectIds
+ // and grab out its string-based content depending on its type
+ String output=attributes[count].getType(obj).
+
getContent(attributes[count].getAttributeContent(obj,isNew,objectIds));
+
+ if(output!=null) {
+
+ // try to obtain a namespace for the schema of this attribute
+ Object nameSpacePrefixForAttribute=
+ nameSpaces.get(attributes[count].getAppearanceSchema());
+
+ // if its not visible in this scope, introduce it
+ if(nameSpacePrefixForAttribute==null) {
+ lackingNameSpaces.add(attributes[count].getAppearanceSchema());
+ nameSpacePrefixForAttribute="n"+(nameSpaces.size()+1)+":";
+ nameSpaces.put(attributes[count].getAppearanceSchema(),
+ nameSpacePrefixForAttribute);
+ }
+
+ //next utter the attribute
+ writer.write(" "+nameSpacePrefixForAttribute+attributes[count].
+ getAppearanceName()+"=\""+Environment.encodeIntoXml(output)+"\"");
+
+ } // if(output!=null)
+ } // if isToBeSerialised
+ } catch(AttributeException e) {
+
+ if(Environment.DEBUG_XML || Environment.LOG_XML>0)
+
Environment.err.print(toString()+".writeElement("+element+","+obj+","+
+ nameSpaceStack+") encountered "+e+". Ignoring attribute
"+attributes[count].getAppearanceName()+".\n");
+
+ } catch(TypeException e) {
+
+ if(Environment.DEBUG_XML || Environment.LOG_XML>0)
+
Environment.err.print(toString()+".writeElement("+element+","+obj+","+
+ nameSpaceStack+") encountered "+e+". Ignoring attribute
"+attributes[count].getAppearanceName()+" .\n");
+
+ }
+
+ } // for
+
+ } //if(attributes!=null)
+
+ } // while (inheritanceIterator.hasNext())
+
+ // next we have to issue the lacking namespaces
+ Iterator lackingNameSpacesIterator=lackingNameSpaces.iterator();
+
+ // loop through them
+ while(lackingNameSpacesIterator.hasNext()) {
+
+ Schema currentSchema=(Schema) lackingNameSpacesIterator.next();
+
+ // find the right prefix
+ String prefix=(String) nameSpaces.get(currentSchema);
+
+ // this should never happen
+ if(prefix==null)
+ throw new RuntimeException(toString()+".writeElement(): namespace handling
fucked up.");
+
+ // turn the colon around, if present
+ if(prefix.endsWith(":"))
+ prefix=":"+prefix.substring(0,prefix.length()-1);
+
+ writer.write(" xmlns"+prefix+"=\""+
+ currentSchema.getUrn().toString()+"\"");
+
+ } // while (lackingNameSpaceIterator.hasNext())
+
+ // ready, we close this opening tag and insert a line seperator
+ writer.write(">"+Environment.LINE_SEPERATOR);
+
+ // utter the verbose elements apparent in this element
+ if(type.getVerboseElements(obj)!=null)
+ writer.write(type.getVerboseElements(obj).toString());
+
+ // refresh the iterator to begin from above
+ inheritanceIterator=inheritanceCollection.iterator();
+
+ while(inheritanceIterator.hasNext()) {
+
+ // next the element part
+ Element[] elements=((Type) inheritanceIterator.next()).getElements(obj);
+
+ if(elements!=null) {
+ for(int count=0;count<elements.length;count++) {
+ try{
+
+ if(policy.isToBeSerialised(obj,elements[count],depth)) {
+
+ Object[] output=elements[count].
+ getElementContents(obj,isNew,objectIds);
+
+ if(output!=null)
+ for(int count2=0;count2<output.length;count2++) {
+
writeElement(elements[count],output[count2],nameSpaceStack,depth+1);
+ }
+
+ } // if isToBeSerialised
+ } catch(ElementException e) {
+
+ if(Environment.DEBUG_XML || Environment.LOG_XML>0)
+
Environment.err.print(toString()+".writeElement("+element+","+obj+","+
+ nameSpaceStack+") encountered "+e+" Ignoring element.\n");
+
+ } catch(TypeException e) {
+
+ if(Environment.DEBUG_XML || Environment.LOG_XML>0)
+
Environment.err.println(toString()+".writeElement("+element+","+obj+","+
+ nameSpaceStack+") encountered "+e+" Ignoring element.\n");
+
+ }
+
+ } // for
+
+ } // if
+
+ } // while
+
+ // this is for the string-based body of the type
+ String output=type.getContent(obj);
+
+ // its non-null, so utter it
+ if(output!=null)
+
writer.write(Environment.encodeIntoXml(output.toString())+Environment.LINE_SEPERATOR);
+
+ // utter the closing tag
+ writer.write("</"+nameSpacePrefixForElement+element.getAppearanceName()+">"+
+ Environment.LINE_SEPERATOR);
+
+ // and finally reinstall the namespaces
+ nameSpaceStack.pop();
+
+ } // writeElement
+
+ /**
+ * traces an inheritance chain in a collection
+ */
+
+ private Collection buildInheritanceChain(Type type, Collection inCollection) {
+
+ if(Environment.DEBUG_XML)
+
Environment.out.print(toString()+".buildInheritanceChain("+type+","+inCollection+")\n");
+
+ Collection result=inCollection;
+
+ if(type!=null) {
+ if(type.getDerivedBy()!=Type.DERIVEDBY_RESTRICTION)
+ result=buildInheritanceChain(type.getSuperType(),result);
+
+ result.add(type);
+ }
+
+ return result;
+ }
+
+ /**
+ * Writes an array of bytes. This method will block until the bytes
+ * are actually written.
+ */
+
+ public void write(byte[] b) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+b+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Writes a sub array of bytes.
+ */
+
+ public void write(byte[] b, int off, int len) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+b+","+off+","+len+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+
+ /**
+ * Writes a <code>boolean</code> value to this output stream.
+ */
+
+ public void writeBoolean(boolean v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeBoolean("+v+")\n");
+
+ writeObject(new Boolean(v));
+ }
+
+ /**
+ * Writes to the output stream the eight low-
+ * order bits of the argument <code>v</code>.
+ */
+
+ public void writeByte(int v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeByte("+v+")\n");
+
+ writeObject(new Byte((byte) v));
+ }
+
+ /**
+ * Writes two bytes to the output
+ * stream to represent the value of the argument.
+ */
+
+ public void writeShort(int v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeShort("+v+")\n");
+
+ writeObject(new Short((short) v));
+ }
+
+ /**
+ * Writes a <code>char</code> value, wich
+ * is comprised of two bytes, to the
+ * output stream.
+ */
+
+ public void writeChar(int v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeChar("+v+")\n");
+
+ writeObject(new Character((char) v));
+ }
+
+ /**
+ * Writes an <code>int</code> value, which is
+ * comprised of four bytes, to the output stream.
+ */
+
+ public void writeInt(int v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+v+")\n");
+
+ writeObject(new Integer(v));
+ }
+
+ /**
+ * Writes an <code>long</code> value, which is
+ * comprised of four bytes, to the output stream.
+ */
+
+ public void writeLong(long v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeLong("+v+")\n");
+
+ writeObject(new Long(v));
+ }
+
+ /**
+ * Writes a <code>float</code> value,
+ * which is comprised of four bytes, to the output stream.
+ */
+ public void writeFloat(float v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeFloat("+v+")\n");
+
+ writeObject(new Float(v));
+ }
+
+ /**
+ * Writes a <code>double</code> value,
+ * which is comprised of eight bytes, to the output stream.
+ */
+ public void writeDouble(double v) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeDouble("+v+")\n");
+
+ writeObject(new Double(v));
+ }
+
+ /**
+ * Writes a string to the output stream.
+ */
+
+ public void writeBytes(String s) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeBytes("+s+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Writes every character in the string <code>s</code>,
+ * to the output stream, in order,
+ * two bytes per character.
+ */
+
+ public void writeChars(String s) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeChars("+s+")\n");
+
+ throw new UnsupportedOperationException();
+
+ }
+
+ /**
+ * Writes two bytes of length information
+ * to the output stream, followed
+ * by the Java modified UTF representation
+ * of every character in the string <code>s</code>.
+ */
+
+ public void writeUTF(String str) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".writeUTF("+str+")\n");
+
+ writeObject(str);
+ }
+
+ /**
+ * write buffer of characters into XML, uses default data-binding
+ */
+
+ public void write(char[] cbuf) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+cbuf+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * write portion of buffer of characters is XMLised
+ */
+
+ public void write(char[] cbuf, int off, int len) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+cbuf+","+off+","+len+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+
+ /**
+ * write character is XMLised
+ */
+
+ public void write(int aAhar) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+aAhar+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * write string is XMLised
+ */
+
+ public void write(String string) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+string+")\n");
+
+ writeObject(string);
+ }
+
+ /**
+ * write string is XMLised
+ */
+
+ public void write(String string,int off,int len) throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".write("+string+","+off+","+len+")\n");
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * the close method is simply redirected to the writer
+ */
+
+ public void close() throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".close()\n");
+
+ writer.close();
+ }
+
+ /**
+ * the flush method is simply redirected to the writer
+ */
+
+ public void flush() throws IOException {
+
+ if(Environment.DEBUG_XML)
+ Environment.out.print(toString()+".flush()\n");
+
+ writer.flush();
+ }
+}
+
+/**
* $Log: XmlObjectWriter.java,v $
- * Revision 1.1 2000/08/10 21:07:43 jung
- * Initial revision
- *
- * Revision 1.1.2.4 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.3 2000/07/20 14:35:27 jung
- * some refactoring inside infor:xml
- *
- * Revision 1.1.2.2 2000/07/17 12:46:19 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:24 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1.2.3 2000/07/11 08:08:35 jung
- * added functionality to store retrieve a part of a types elements
- * within "ignored" strings. Useful for writing generic handlers that
- * just process a part of the XML and transfer the rest.
- *
- * Revision 1.1.1.1.2.2 2000/07/10 14:57:02 jung
- * made exceptions more MS-compliant.
- *
- * included <?xml version?> annotation when writing.
- *
- * http-server now closes the channel as its default action.
- *
- * first testcall worked!
- *
- * Revision 1.1.1.1.2.1 2000/07/07 15:50:03 jung
- * Request-Response Structure close to MS-SOAP
- *
- * removed a mega-bug in return element
- *
- * Revision 1.1.1.1 2000/07/06 14:11:28 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- * Revision 1.1.1.1 2000/06/19 12:04:13 jung
- * imported ZOAPackage that should
- * go into a seperate Open Source project
- *
- * Revision 1.2.2.2 2000/06/14 12:38:18 jung
- * removed the NEWLINE bug: since infor:X was just using
- * \n to mark the end of a line in serialisation, any subsequent
- * stream processing that relies on a proper newline (and any
- * subsequent derserialisation that tries to grab characters out of a tag)
- * must be confused.
- *
- * When going to \r\n and appropriately adjusting the readCharacters
- * methods in the basic types and the DocumentHandler of
- * XmlObjectReader, this symptom has now vanished.
- *
- * Looks like resolved ...
- *
- * Revision 1.2.2.1 2000/06/08 17:15:48 jung
- * added initial soap service that uses the infor:X framework.
- *
- * Revision 1.2 2000/06/06 19:42:31 jung
- * added transaction support.
- *
- * redesigned the dataAccess package to provide BSF database
- * sessions as transactional resources under any TXManager.
- *
- * DataAccess now manages the mappingData associations to apartments
- * and threads.
- *
- * test component runs.
- *
- * Revision 1.1 2000/06/05 09:16:55 jung
- * added an initial revision of infor:X, the
- * XML (de-)serialisation service of infor:CE.
- *
- * supports meta-data structures, namespaces, schemas.
- *
- * lacks collection support, forward-references, multiple roots
- * and external resolution.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:22 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:43 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.4 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.3 2000/07/20 14:35:27 jung
+ * some refactoring inside infor:xml
+ *
+ * Revision 1.1.2.2 2000/07/17 12:46:19 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:24 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1.2.3 2000/07/11 08:08:35 jung
+ * added functionality to store retrieve a part of a types elements
+ * within "ignored" strings. Useful for writing generic handlers that
+ * just process a part of the XML and transfer the rest.
+ *
+ * Revision 1.1.1.1.2.2 2000/07/10 14:57:02 jung
+ * made exceptions more MS-compliant.
+ *
+ * included <?xml version?> annotation when writing.
+ *
+ * http-server now closes the channel as its default action.
+ *
+ * first testcall worked!
+ *
+ * Revision 1.1.1.1.2.1 2000/07/07 15:50:03 jung
+ * Request-Response Structure close to MS-SOAP
+ *
+ * removed a mega-bug in return element
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:28 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ * Revision 1.1.1.1 2000/06/19 12:04:13 jung
+ * imported ZOAPackage that should
+ * go into a seperate Open Source project
+ *
+ * Revision 1.2.2.2 2000/06/14 12:38:18 jung
+ * removed the NEWLINE bug: since infor:X was just using
+ * \n to mark the end of a line in serialisation, any subsequent
+ * stream processing that relies on a proper newline (and any
+ * subsequent derserialisation that tries to grab characters out of a tag)
+ * must be confused.
+ *
+ * When going to \r\n and appropriately adjusting the readCharacters
+ * methods in the basic types and the DocumentHandler of
+ * XmlObjectReader, this symptom has now vanished.
+ *
+ * Looks like resolved ...
+ *
+ * Revision 1.2.2.1 2000/06/08 17:15:48 jung
+ * added initial soap service that uses the infor:X framework.
+ *
+ * Revision 1.2 2000/06/06 19:42:31 jung
+ * added transaction support.
+ *
+ * redesigned the dataAccess package to provide BSF database
+ * sessions as transactional resources under any TXManager.
+ *
+ * DataAccess now manages the mappingData associations to apartments
+ * and threads.
+ *
+ * test component runs.
+ *
+ * Revision 1.1 2000/06/05 09:16:55 jung
+ * added an initial revision of infor:X, the
+ * XML (de-)serialisation service of infor:CE.
+ *
+ * supports meta-data structures, namespaces, schemas.
+ *
+ * lacks collection support, forward-references, multiple roots
+ * and external resolution.
+ *
+ */
1.2 +112 -108 zoap/src/org/zoap/xml/XmlSchemaInstance.java
Index: XmlSchemaInstance.java
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/XmlSchemaInstance.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XmlSchemaInstance.java 2000/08/10 21:07:44 1.1
+++ XmlSchemaInstance.java 2000/12/04 12:36:23 1.2
@@ -1,111 +1,121 @@
-/*
- * $Id: XmlSchemaInstance.java,v 1.1 2000/08/10 21:07:44 jung Exp $
- * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
- * D-66299 Friedrichsthal, Germany. All Rights Reserved.
- *
- * License Statement
- *
- * Redistribution and use of this software and associated documentation
("Software"), with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright statements and
notices.
- * Redistributions must also contain a copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
- * conditions and the following disclaimer in the documentation and/or
other materials provided
- * with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any,
must include the following
- * acknowledgment: "This product includes software developed by infor:
business solutions AG
- * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The name "infor" must not be used to endorse or promote products
derived from this
- * Software without prior written permission of infor: business solutions
AG.
- * For written permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
- * in their names without prior written permission of infor: business
solutions AG. infor
- * is a registered trademark of infor:business solutions AG.
- *
- * Disclaimer
- *
- * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- *
- * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.zoap.xml;
-
-
-import de.infor.ce.util.URN;
-
-/**
- * This is the schema representations for
"http://www.w3.org/1999/XmlSchema-Instance".
- * Since it just carries two important attributes (type and null) which we evaluate
internally,
- * there is not much work to do here. It is mainly to define the urn for these
attributes.
- */
-
-public class XmlSchemaInstance extends Schema {
-
- /**
- * private constructor sets the urn, thats it
- */
-
- private XmlSchemaInstance() {
-
- if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
- Environment.out.print(toString()+".XmlSchemaInstance()\n");
-
- setUrn(new URN(new String[] {"http://www.w3.org/1999/XMLSchema-Instance"}));
- }
-
- /**
- * private singleton reference, is not lazy since needed in each case!
- * If the class is loaded dynamically, the need is already there.
- * @label singleton
- */
-
- private static XmlSchemaInstance xmlSchemaInstance=new XmlSchemaInstance();
-
- /**
- * public accessor to singleton
- */
-
- public static XmlSchemaInstance getXmlSchemaInstance() {
- return xmlSchemaInstance;
- }
-
-}
-
-/*
+/*
+ * $Id: XmlSchemaInstance.java,v 1.2 2000/12/04 12:36:23 jung Exp $
+ * Copyright 2000 (C) infor:business solutions AG, Hauerstrasse 12,
+ * D-66299 Friedrichsthal, Germany. All Rights Reserved.
+ *
+ * License Statement
+ *
+ * Redistribution and use of this software and associated documentation
("Software"), with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain copyright statements and
notices.
+ * Redistributions must also contain a copy of this document.
+ *
+ * 2. Redistributions in binary form must reproduce the attached copyright
notice, this list of
+ * conditions and the following disclaimer in the documentation and/or
other materials provided
+ * with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any,
must include the following
+ * acknowledgment: "This product includes software developed by infor:
business solutions AG
+ * (http://www.infor.de/)." Alternately, this acknowledgment may appear
in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The name "infor" must not be used to endorse or promote products
derived from this
+ * Software without prior written permission of infor: business solutions
AG.
+ * For written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this Software may not be called "infor" nor may
"infor" appear
+ * in their names without prior written permission of infor: business
solutions AG. infor
+ * is a registered trademark of infor:business solutions AG.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED BY INFOR: BUSINESS SOLUTIONS AG AND CONTRIBUTORS "AS
IS" AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ *
+ * IN NO EVENT SHALL INFOR: BUSINESS SOLUTIONS AG OR ITS CONTRIBUTORS BE LIABLE
FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.zoap.xml;
+
+
+import de.infor.ce.util.URN;
+
+/**
+ * This is the schema representations for
"http://www.w3.org/1999/XmlSchema-Instance".
+ * Since it just carries two important attributes (type and null) which we evaluate
internally,
+ * there is not much work to do here. It is mainly to define the urn for these
attributes.
+ */
+
+public class XmlSchemaInstance extends Schema {
+
+ /**
+ * private constructor sets the urn, thats it
+ */
+
+ private XmlSchemaInstance() {
+
+ if(Environment.DEBUG_XML && Environment.DEBUG_XML_META)
+ Environment.out.print(toString()+".XmlSchemaInstance()\n");
+
+ setUrn(new URN(new String[] {"http://www.w3.org/1999/XMLSchema-Instance"}));
+ }
+
+ /**
+ * private singleton reference, is not lazy since needed in each case!
+ * If the class is loaded dynamically, the need is already there.
+ * @label singleton
+ */
+
+ private static XmlSchemaInstance xmlSchemaInstance=new XmlSchemaInstance();
+
+ /**
+ * public accessor to singleton
+ */
+
+ public static XmlSchemaInstance getXmlSchemaInstance() {
+ return xmlSchemaInstance;
+ }
+
+}
+
+/*
* $Log: XmlSchemaInstance.java,v $
- * Revision 1.1 2000/08/10 21:07:44 jung
- * Initial revision
- *
- * Revision 1.1.2.1 2000/08/04 17:20:19 jung
- * close to beta stadium. Meta-Data import now works.
- *
- * Revision 1.1.2.1 2000/07/17 12:46:19 jung
- * refactored package and meta-model
- *
- * Revision 1.1.2.1 2000/07/13 12:46:25 jung
- * package renaming, most of the zoap stuff now under org.zoap
- * util and http stay infor.ce, containerInvoker etc move to org.jboss
- *
- * changed the makefile, adopted most of the licenses
- *
- * Revision 1.1.1.1 2000/07/06 14:11:29 jung
- * Import of a pre beta version of ZOAP source with a new directory structure,
- * ant-based make, apache-kind of license, etc.
- *
- * jars are coming later because of cvs-history reasons.
- *
- */
+ * Revision 1.2 2000/12/04 12:36:23 jung
+ * adopted to latest jboss container,
+ *
+ * added decimal and date
+ *
+ * removed some problems due to forward-referencing in meta-data
+ *
+ * added serialisation policy
+ *
+ * Revision 1.1.1.1 2000/08/10 21:07:44 jung
+ * Initial import.
+ *
+ *
+ * Revision 1.1.2.1 2000/08/04 17:20:19 jung
+ * close to beta stadium. Meta-Data import now works.
+ *
+ * Revision 1.1.2.1 2000/07/17 12:46:19 jung
+ * refactored package and meta-model
+ *
+ * Revision 1.1.2.1 2000/07/13 12:46:25 jung
+ * package renaming, most of the zoap stuff now under org.zoap
+ * util and http stay infor.ce, containerInvoker etc move to org.jboss
+ *
+ * changed the makefile, adopted most of the licenses
+ *
+ * Revision 1.1.1.1 2000/07/06 14:11:29 jung
+ * Import of a pre beta version of ZOAP source with a new directory structure,
+ * ant-based make, apache-kind of license, etc.
+ *
+ * jars are coming later because of cvs-history reasons.
+ *
+ */
1.2 +523 -529 zoap/src/org/zoap/xml/xml.dfPackage
Index: xml.dfPackage
===================================================================
RCS file: /products/cvs/ejboss/zoap/src/org/zoap/xml/xml.dfPackage,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xml.dfPackage 2000/08/10 21:07:38 1.1
+++ xml.dfPackage 2000/12/04 12:36:23 1.2
@@ -1,529 +1,523 @@
-package id1k4jdc8v9c1p6c8v9hgrr;
-
-/**
-@version 2.0
-@physicalPackage
-@__modelType diagram
-*/
-class diagram {
-/**
-@__ref <oiref:design#Class#id2nzq3c8wpmexoc8wpnwj4.diagram:oiref><oihard>
-@__modelType reference
-*/
-class reference24 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Environment:oiref><oihard>
-@__modelType reference
-*/
-class reference7 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Schema:oiref><oihard>
-@__modelType reference
-*/
-class reference {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Type:oiref><oihard>
-@__modelType reference
-*/
-class reference3 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Element:oiref><oihard>
-@__modelType reference
-*/
-class reference12 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Attribute:oiref><oihard>
-@__modelType reference
-*/
-class reference14 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Binding:oiref><oihard>
-@__modelType reference
-*/
-class reference16 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.XmlObjectWriter:oiref><oihard>
-@__modelType reference
-*/
-class reference21 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.XmlException:oiref><oihard>
-@__modelType reference
-*/
-class reference28 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.ElementException:oiref><oihard>
-@__modelType reference
-*/
-class reference29 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.TypeException:oiref><oihard>
-@__modelType reference
-*/
-class reference31 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.IllegalSuperTypeException:oiref><oihard>
-@__modelType reference
-*/
-class reference32 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.XmlObjectReader:oiref><oihard>
-@__modelType reference
-*/
-class reference75 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.Appearance:oiref><oihard>
-@__modelType reference
-*/
-class reference9 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.IllegalTypeException:oiref><oihard>
-@__modelType reference
-*/
-class reference19 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.AppearanceException:oiref><oihard>
-@__modelType reference
-*/
-class reference1 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.AttributeException:oiref><oihard>
-@__modelType reference
-*/
-class reference36 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.NoCompatibleElementException:oiref><oihard>
-@__modelType reference
-*/
-class reference38 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.SchemaException:oiref><oihard>
-@__modelType reference
-*/
-class reference23 {
-}/**
-@shapeType NoteLink
-@__modelType link
-@__ref <oiref:design#Class#id2e2vrc9pgodo2c9pgqtl6.node:oiref><oihard>
-*/
-class link {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.ComplexType:oiref><oihard>
-@__modelType reference
-*/
-class reference35 {
-}/**
-@__ref <oiref:design#Class#id38blncb1vpvpgcb2e7dhd.diagram:oiref><oihard>
-@__modelType reference
-*/
-class reference37 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.XmlSchemaInstance:oiref><oihard>
-@__modelType reference
-*/
-class reference41 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.URNResolver:oiref><oihard>
-@__modelType reference
-*/
-class reference42 {
-}/**
-@__ref <oiref:java#Class#org.zoap.xml.SimpleType:oiref><oihard>
-@__modelType reference
-*/
-class reference43 {
-}/**
-@__ref <oiref:design#Class#id2l8krcbiw4w22cbiw698e.diagram:oiref><oihard>
-@__modelType reference
-*/
-class reference2 {
-}/**
-@__ref <oiref:design#Class#id4kj0kcbiw4w22cbiw69am.diagram:oiref><oihard>
-@__modelType reference
-*/
-class reference4 {
-}}/**
-<h2>infor:X</h2>
-<p>
-infor:X is a (de-)serialisation service for XML-encoded character streams
-written in Java.
-</p>
-<p>
-It provides an extensible and XML-Schema-based meta-model (called a binding) that
connects the
-structure of XML documents to Java classes. Building upon that meta-model, there is
-a set of IO abstractions to
-parse/generate XML document instances
-into/from
-Java objects.
-</p>
-<p>
-The applications of infor:X are manyfold:
-<ul>
-<li> (De-)serialization module for modern, XML-based messaging middleware.
-</li>
-<li> Comfortable processing of XML documents.</li>
-<li> Schema-based validation procedures.</li>
-<li> Data-Engine for Generic GUIs </li>
-</ul>
-</p>
-<p>
-
-SOX is a part of the Zero-Effort Object Access Package (ZOAP) and subject to the
-<a href="../../../../../license.html">License Agreement</a> you entered
-into with infor AG.
-</p>
-<p>
-The outstanding features of infor:X are:
-<ul>
-<li> Fast and memory consuming deserialization process (compatible with
-any SAX-compliant XML parser)
-</li>
-<li>Extensible and Flexible Meta-Model.
-</li>
-<li>XML-Schema and XML-NameSpaces support.</li>
-<li>Builtin infrastructure for handling ID/IDREF types.</li>
-<li>Powerful default binding that covers XML-Schema definitions and
-any serializable Java classes including null and polymorphic structures.</li>
-<li>Inline mode for embedding meta-data into object-data to drive generic
components.
-</ul>
-</p>
-<p>
-The ToDo list for infor:X covers:
-<UL>
-<li> Improve performance by more efficient data-structures and avoidance of
-redundant processing (namespace-tagging, attribute processing).
-</li>
-<li> Find a lot of bugs.
-</li>
-<li>Inline mode for receiving schema-data
-within a given object data-document.</li>
-<li> Extensions to the Meta-Model to cover more XML-Schema features, such as
-nullable constraints, minimal and maximal numbers of appearance, value patterns,
etc.
-</li>
-</ul>
-</p>
-<p>
-<hr>
-<small> Last change of $RCSfile: xml.dfPackage,v $ by $Author: jung $ on $Date:
2000/08/10 21:07:38 $; See source for logging information. </small>
-</p>
-@see java.io.ObjectInput and @see java.io.ObjectOutput. On the XML side, up-to-date
tagging including namespaces and schemas are supported. On the Java side,
security-related reflection is used.
-
-The applications of infor:X range from persistance of runtime data up-to live
data-exchange upon different transports, such as http and smtp, e.g., through SOAP.
-
-To meet this broad range of applications, infor:X is held very flexible in terms of
an extensible @see DataBinding meta-data structure that preserves the mapping between
the XML and the Java side. A data-binding consists of a bunch of @see XmlSchema each
of which defined its own, but maybe dependent set of @see XmlType. There is a default
DataBinding installed in infor:X, but this can be overridden and manipulated in a wide
range.
-@__tags
-@shapeType ClassDiagram
-*/
-class __tags {
-}/**
-@__options
-*/
-class __options {
-}/**
-@__positions
-<oigroup:<oiref:java#Class#org.zoap.xml.AppearanceException:oiref>=1828,162,134,59,1:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1467,770,107,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.CharacterType#org.zoap.xml.SimpleTypeImpl:oiref>=77,2787,1429,1761,1429,860:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaType#schemaType:oiref>=2800,2953,2800,2996,2876,2996,2876,2920,2833,2920:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1403,1059,7,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1149,1035,1149,437:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=313,1259,20,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#urn:oiref>=955,156,955,414,735,414,735,672:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicShortType#org.zoap.xml.Type:oiref>=1743,1227,2013,943:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.IllegalSuperTypeException:oiref>=1978,430,159,59,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#classElement:oiref>=3377,937,3920,937,4059,832:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.IllegalTypeException#org.zoap.xml.TypeException:oiref>=2030,296,2030,261,2056,261,2056,221:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.DefaultAccessControl#org.zoap.xml.XmlObjectAccessControl:oiref>=3392,239,3392,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ClassSchema#org.zoap.xml.Schema:oiref>=3309,782,3046,577:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDRefType#idType:oiref>=2561,2896,2561,2927,2613,2927,2613,2875,2582,2875:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.CreationException#org.zoap.xml.XmlException:oiref>=2511,174,2778,87:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DefaultOutputLevel#defaultOutputLevel:oiref>=3683,192,3683,109:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Type#org.zoap.xml.PartOfSchema:oiref>=693,1062,806,109:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ObjectType#lnkObjectSchema:oiref>=776,1228,917,949:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.Type:oiref>=1051,617,821,409:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchema#lnkBinding:oiref>=1526,1797,1654,1797:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.IllegalSuperTypeException#org.zoap.xml.TypeException:oiref>=1752,312,1752,229:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#elements:oiref>=1457,308,1457,490,1804,490,1804,672:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=740,189,89,17,0:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=1520,164,5,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#attributeType:oiref>=2129,102,2224,102:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.NameAttribute:oiref>=3515,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ByteType#org.zoap.xml.SimpleTypeImpl:oiref>=792,2787,1457,1832,1457,860:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ElementImpl#appearanceSchema:oiref>=1112,1714,1112,935,999,935,999,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.RefAttribute#org.zoap.xml.Attribute:oiref>=3942,2787,3942,863:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.IDRefType#org.zoap.xml.SimpleTypeImpl:oiref>=2432,2787,1525,896,1525,860:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.AppearanceException#org.zoap.xml.XmlException:oiref>=1895,162,1895,127,2029,127,2029,87:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1140,1014,5,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.LongType#longType:oiref>=1390,2896,1390,2927,1442,2927,1442,2875,1411,2875:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.IllegalTypeException:oiref>=1968,296,125,59,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkClassElement:oiref>=3336,986,4505,2787:oigroup>
-<oigroup:<oiref:design#Class#id2l8krcbiw4w22cbiw698e.diagram:oiref>=249,34,43,63,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ComplexType#org.zoap.xml.Type:oiref>=60,1035,60,835,349,835,349,570:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicSchema#org.zoap.xml.Schema:oiref>=683,1227,683,715:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.AttributeContainer:oiref>=607,260,445,166:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#lnkAttribute:oiref>=1473,308,1473,490,2030,490,2030,672:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Element#org.zoap.xml.Appearance:oiref>=894,1035,894,681,1634,681,1634,238:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.FieldAttribute:oiref>=4091,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.StringType:oiref>=297,2796,203,109,1:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.AttributeImpl#org.zoap.xml.Attribute:oiref>=1590,1714,1590,1233,2087,1233,2087,752:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=470,570,470,618,542,618,542,532,501,532:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SimpleTypeImpl#org.zoap.xml.Type:oiref>=549,604,809,409:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassType#lnkFieldAttribute:oiref>=3126,2840,3241,2960,4010,2960,4091,2875:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicBooleanType#basicBooleanType:oiref>=1072,1227,1957,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.StringType#stringType:oiref>=479,2905,479,2936,531,2936,531,2884,500,2884:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Element#org.zoap.xml.Appearance:oiref>=1510,840,1510,376:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1140,437,5,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchema:oiref>=229,964,285,1164,520,1164,575,928:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ObjectSchema#org.zoap.xml.Schema:oiref>=927,840,704,730:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=1740,1153,1685,1153,1685,2419,394,2419,394,1245,309,1245:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1290,129,7,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicByteType#org.zoap.xml.Type:oiref>=1551,1227,1997,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.URNResolver#defaultUrnResolver:oiref>=603,2637,603,2664,647,2664,647,2620,620,2620:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DoubleType#doubleType:oiref>=1141,2896,1141,2927,1193,2927,1193,2875,1162,2875:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ShortType:oiref>=1433,2787,203,109,1:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1234,1059,5,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicIntegerType#org.zoap.xml.Type:oiref>=2313,1227,2045,1074,2045,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleTypeImpl#superType:oiref>=1533,1028,1533,1075,1587,1075,1587,991,1555,991:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.FloatType#org.zoap.xml.SimpleTypeImpl:oiref>=571,2787,1448,1783,1448,860:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=1097,437,7,17,0:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Binding:oiref>=1011,1035,219,185,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ObjectType#objectType:oiref>=809,1337,809,1368,861,1368,861,1316,830,1316:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1281,1059,82,17,0:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ElementException:oiref>=1837,296,111,59,1:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Attribute#org.zoap.xml.Appearance:oiref>=1627,840,1527,376:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicIntegerType#basicIntegerType:oiref>=2374,1227,2053,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader.ElementValue#element:oiref>=2182,110,2182,391,1877,391,1877,672:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.XmlSchema#org.zoap.xml.Schema:oiref>=856,2346,856,2325,479,2294,479,2010:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.FloatType:oiref>=521,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Element#org.zoap.xml.PartOfSchema:oiref>=1310,191,1058,147:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.DuplicateReferenceAttributeException#org.zoap.xml.XmlException:oiref>=3608,170,3608,87:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.IDRefType:oiref>=2379,2787,203,109,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ElementImpl#type:oiref>=1212,1714,1212,1011,1409,1011,1409,308:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ClassSchema:oiref>=3174,782,203,204,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader.ElementValue#appearance:oiref>=2116,60,2055,60:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.AttributeContainer:oiref>=411,840,411,166:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.DefaultOutputLevel#org.zoap.xml.XmlObjectOutputLevel:oiref>=3615,192,3615,109:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Element#elementType:oiref>=2775,1227,2093,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeImpl#type:oiref>=1523,1714,1523,1028:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BooleanType#booleanType:oiref>=1842,2896,1842,2927,1894,2927,1894,2875,1863,2875:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1240,437,1240,791,1800,791,1800,1035:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=962,164,87,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#container:oiref>=1929,871,1572,871:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ComplexType:oiref>=10,1035,125,81,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#typeSchema:oiref>=501,323,1067,323:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassElement#lnkClassType:oiref>=4473,2852,4346,3026,3270,3026,3126,2890:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1036,725,109,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDRefType#lnkSchemaType:oiref>=2485,2787,1774,922,1774,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DoubleType#lnkXmlSchema:oiref>=1077,2787,1703,1824,1703,872:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.SimpleTypeImpl#org.zoap.xml.Type:oiref>=1429,672,1429,338,1441,338,1441,308:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicStringType#org.zoap.xml.Type:oiref>=2514,1227,2061,1069,2061,943:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.SchemaImpl#org.zoap.xml.Schema:oiref>=977,672,977,156:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicShortType#basicShortType:oiref>=1685,1227,2005,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassType#lnkFieldElement:oiref>=3126,2865,3230,2970,4161,2970,4282,2875:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicSchema#basicSchema:oiref>=707,1227,707,696:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ObjectSchema:oiref>=826,840,203,109,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkFieldAttribute:oiref>=3254,986,4138,2787:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.IDType:oiref>=2166,2787,203,109,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ByteType#byteType:oiref>=926,2896,926,2927,978,2927,978,2875,947,2875:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.IntegerType#org.zoap.xml.SimpleTypeImpl:oiref>=1979,2787,1505,1063,1505,860:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.PartOfSchema#schema:oiref>=1395,69,534,69:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchema#xmlSchema:oiref>=955,2493,955,2532,1023,2532,1023,2464,984,2464:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#classType:oiref>=3241,782,2488,542,2488,492:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaImpl#urn:oiref>=889,741,799,741:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.URNResolver:oiref>=417,2548,203,89,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=1067,210,501,210:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Element:oiref>=736,1035,199,157,1:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=505,511,20,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.IllegalSuperTypeException#org.zoap.xml.IllegalTypeException:oiref>=2035,430,2035,355:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BindingImpl#schemas:oiref>=541,672,541,414,934,414,934,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicDoubleType#org.zoap.xml.Type:oiref>=3152,1227,2127,943:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.BasicObjectType#org.zoap.xml.Type:oiref>=471,1005,471,938:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ClassType#org.zoap.xml.ComplexTypeImpl:oiref>=3025,2787,3025,1005:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaElement#org.zoap.xml.Element:oiref>=3342,2787,4085,863:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ClassElement#org.zoap.xml.Element:oiref>=4538,2787,4137,863:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.TypeException:oiref>=1990,162,92,59,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ComplexTypeImpl#superType:oiref>=1259,672,1259,490,1428,490,1428,308:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.SchemaException:oiref>=2102,162,112,59,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicSchema#basicTypes:oiref>=746,1227,1941,943:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.XmlSchema#org.zoap.xml.Schema:oiref>=1436,1752,1174,1019,1152,667:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.NameAttribute#lnkIDType:oiref>=3515,2875,3424,3006,2325,3006,2325,2896:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=313,1224,7,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#schema:oiref>=1509,828,487,309:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1529,150,1286,150:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchElementException#org.zoap.xml.ElementException:oiref>=2643,316,2643,233:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#urnResolver:oiref>=518,2378,518,2548:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ShortType#lnkXmlSchema:oiref>=1537,2787,1726,1908,1726,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#lnkType:oiref>=1529,97,1473,97,1473,31,662,31,662,100,501,100:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Element#schema:oiref>=1747,962,492,309:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ClassType.ArrayType:oiref>=2947,2788,98,81,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SerializableSchema#org.zoap.xml.Schema:oiref>=2840,782,3010,577:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Appearance:oiref>=1529,62,199,176,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ComplexTypeImpl#typeSchema:oiref>=1170,672,1170,414,1021,414,1021,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.IDType#org.zoap.xml.SimpleTypeImpl:oiref>=2206,2787,1515,907,1515,860:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#lnkXmlType:oiref>=806,96,1828,96:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeImpl#lnkSimpleType:oiref>=1513,1069,1437,1069:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.NoCompatibleElementException:oiref>=1768,430,190,59,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Appearance#org.zoap.xml.PartOfSchema:oiref>=973,1062,852,109:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.LongType#org.zoap.xml.SimpleTypeImpl:oiref>=1259,2787,1475,1816,1475,860:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaType#org.zoap.xml.ComplexTypeImpl:oiref>=2756,2787,3000,1005:oigroup>
-<oigroup:<oiref:design#Class#id4kj0kcbiw4w22cbiw69am.diagram:oiref>=188,153,104,63,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ElementException#org.zoap.xml.AppearanceException:oiref>=1892,296,1892,261,1860,261,1860,221:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.NoCompatibleElementException#org.zoap.xml.ElementException:oiref>=1892,430,1892,355:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BooleanType#lnkXmlSchema:oiref>=1738,2787,1738,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicDoubleType#basicDoubleType:oiref>=3090,1227,2118,943:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ElementImpl#org.zoap.xml.Appearance:oiref>=1974,961,1750,499:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.TypeException#org.zoap.xml.XmlException:oiref>=2036,162,2036,127,2029,127,2029,87:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.SimpleType:oiref>=131,1035,178,280,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#referenceAttribute:oiref>=2038,398,2038,299:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleTypeImpl#typeSchema:oiref>=1397,672,1397,414,1044,414,1044,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ClassType.ArrayType#org.zoap.xml.ClassType:oiref>=2996,2788,2996,2787:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SerializableSchema#serializableSchema:oiref>=2890,872,2890,900,2936,900,2936,854,2908,854:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.FloatType#lnkXmlSchema:oiref>=622,2787,1681,1744,1681,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.CharacterType#charType:oiref>=188,2915,188,2950,248,2950,248,2890,213,2890:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicObjectType#basicObjectType:oiref>=2149,1342,2020,1067,2020,920:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicLongType#basicLongType:oiref>=2893,1227,2101,943:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.XmlSchemaInstance#org.zoap.xml.Schema:oiref>=1515,1035,1515,901,1194,901,1194,437:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#arrayElement:oiref>=3377,822,4059,822:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=1108,437,1108,571,841,571,841,1035:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IntegerType#integerType:oiref>=2103,2896,2103,2927,2155,2927,2155,2875,2124,2875:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.CharacterType#lnkXmlSchema:oiref>=145,2787,1659,1664,1659,872:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ShortType#org.zoap.xml.SimpleTypeImpl:oiref>=1485,2787,1485,860:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.meta.builtin:oiref>=90,623,203,81,1:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.Type:oiref>=1192,672,1192,338,1441,338,1441,308:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaSchema#schemaSchema:oiref>=851,1227,740,696:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.FieldElement:oiref>=4282,2787,203,147,1:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=546,564,58,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#lnkXmlSchema:oiref>=1828,141,794,141:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.SchemaElement:oiref>=3207,2787,203,128,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ShortType#shortType:oiref>=1615,2896,1615,2927,1667,2927,1667,2875,1636,2875:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.meta.builtin#org.zoap.xml.Binding:oiref>=293,639,737,583:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.StringType#lnkXmlSchema:oiref>=405,2796,1670,1704,1670,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#defaultDataBinding:oiref>=484,1006,484,1041,544,1041,544,981,509,981:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.ElementImpl#org.zoap.xml.Element:oiref>=1137,1714,1137,782,1804,782,1804,752:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleTypeImpl#lnkSimpleType:oiref>=574,941,574,986,654,986,654,906,609,906:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicByteType#basicByteType:oiref>=1495,1227,1989,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaElement#schemaElement:oiref>=3385,2915,3385,2950,3445,2950,3445,2890,3410,2890:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=996,2398,87,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SimpleType#org.zoap.xml.Type:oiref>=220,1035,220,835,349,835,349,570:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Appearance#org.zoap.xml.PartOfSchema:oiref>=1465,260,1266,107:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Type:oiref>=308,62,193,508,1:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.Schema:oiref>=759,290,759,335,839,335,839,255,794,255:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicCharacterType#basicCharacterType:oiref>=1286,1227,1973,943:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=265,1315,5,17,0:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.XmlObjectReader:oiref>=414,1035,209,1343,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.NameAttribute#nameAttribute:oiref>=3697,2896,3697,2927,3749,2927,3749,2875,3718,2875:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=285,1339,58,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.RefAttribute#refAttribute:oiref>=4000,2896,4000,2927,4052,2927,4052,2875,4021,2875:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeType#IDREF:oiref>=2345,194,2345,234,2415,234,2415,164,2375,164:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.ElementContainer:oiref>=634,260,634,166:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ObjectSchema#objectSchema:oiref>=1008,949,1008,980,1060,980,1060,928,1029,928:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectWriter#dataBinding:oiref>=114,864,529,409:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicLongType#org.zoap.xml.Type:oiref>=2951,1227,2109,943:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchemaInstance#xmlSchemaInstance:oiref>=1596,1153,51,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#schemas:oiref>=465,1227,649,998,649,715:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.XmlSchemaInstance:oiref>=1414,1035,203,90,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ObjectType:oiref>=668,1228,162,109,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaNotFoundException#org.zoap.xml.XmlException:oiref>=2810,174,2810,87:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.XmlObjectWriter:oiref>=1019,2548,202,602,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.DuplicateReferenceAttributeException#org.zoap.xml.AttributeException:oiref>=3098,316,3098,233:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#attributes:oiref>=2083,398,2083,299:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Binding#org.zoap.xml.SchemaContainer:oiref>=92,840,92,416:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.TypeContainer:oiref>=761,260,943,166:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDType#lnkSchemaType:oiref>=2247,2787,1762,926,1762,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#binding:oiref>=623,1210,1011,1210:oigroup>
-<oigroup:Composite#clientRole#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1520,150,5,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.StringType#org.zoap.xml.SimpleTypeImpl:oiref>=351,2796,1439,1772,1439,860:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1791,1014,5,17,0:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.PartOfSchemaContainer:oiref>=722,260,722,166:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ElementType#org.zoap.xml.Element:oiref>=1851,1714,1851,782,1804,782,1804,752:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ClassType.ArrayType#org.zoap.xml.ComplexTypeImpl:oiref>=198,310,3020,782:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#lnkXmlType:oiref>=475,878,1836,414:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#type:oiref>=433,1035,433,570:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.FieldAttribute#org.zoap.xml.Attribute:oiref>=4185,2787,3967,863:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.AttributeException:oiref>=1703,296,114,59,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.AttributeException#org.zoap.xml.XmlException:oiref>=3126,174,2842,87:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=505,189,5,17,0:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.CharacterType:oiref>=10,2787,203,128,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkClassType:oiref>=3214,986,3056,2787:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.RefAttribute#lnkIDRefType:oiref>=3818,2875,3683,3016,2578,3016,2470,2896:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchemaInstance#xmlSchemaInstance:oiref>=1599,1125,1599,1153,1645,1153,1645,1107,1617,1107:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ByteType#lnkXmlSchema:oiref>=840,2787,1692,1784,1692,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IntegerType#lnkXmlSchema:oiref>=2037,2787,1750,925,1750,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaElement#lnkXmlSchema:oiref>=3274,2787,1798,909,1798,872:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.NameAttribute#org.zoap.xml.Attribute:oiref>=3649,2787,3918,863:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=832,1014,5,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#dataBinding:oiref>=227,1347,322,1347:oigroup>
-<oigroup:<oiref:design#Class#id2nzq3c8wpmexoc8wpnwj4.diagram:oiref>=1880,530,92,148,1:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Attribute#org.zoap.xml.Appearance:oiref>=1860,1035,1860,681,1634,681,1634,238:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ObjectType#org.zoap.xml.ComplexTypeImpl:oiref>=722,1228,472,1139:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicBooleanType#org.zoap.xml.Type:oiref>=1136,1227,1965,943:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.ElementContainer:oiref>=446,840,567,166:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDType#idType:oiref>=2348,2896,2348,2927,2400,2927,2400,2875,2369,2875:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ClassElement:oiref>=4473,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.RefAttribute:oiref>=3818,2787,203,109,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicStringType#basicStringType:oiref>=2573,1227,2069,1101,2069,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1230,1080,1414,1080:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.TypeNotFoundException#org.zoap.xml.XmlException:oiref>=2976,174,2826,87:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaSchema#basicTypes:oiref>=943,1227,1949,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicFloatType#basicFloatType:oiref>=1878,1227,2021,943:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Schema:oiref>=1067,62,219,375,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectWriter#binding:oiref>=1120,2548,1120,1220:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicFloatType#org.zoap.xml.Type:oiref>=1935,1227,2029,943:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaType#lnkXmlSchema:oiref>=2693,2787,1786,916,1786,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeImpl#appearanceSchema:oiref>=1491,1714,1491,935,1067,935,1067,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.AttributeException#org.zoap.xml.AppearanceException:oiref>=1760,296,1760,261,1860,261,1860,221:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Attribute:oiref>=1740,1035,168,147,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.FloatType#floatType:oiref>=703,2896,703,2927,755,2927,755,2875,724,2875:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.SerializableSchema:oiref>=2705,782,203,90,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Element#type:oiref>=788,1035,788,843,453,843,453,570:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchAttributeException#org.zoap.xml.AttributeException:oiref>=3165,316,3165,233:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#element:oiref>=623,1113,736,1113:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Schema#org.zoap.xml.Type:oiref>=794,198,1828,198:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.LongType:oiref>=1208,2787,203,109,1:oigroup>
-<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=505,164,7,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaSchema#org.zoap.xml.Schema:oiref>=897,1227,774,696:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.BooleanType:oiref>=1660,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ClassType:oiref>=2923,2787,203,128,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#lnkSimpleType:oiref>=1476,930,1437,930:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=461,570,5,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SerializableSchema#lnkBinding:oiref>=2772,782,1776,560,1776,501:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.ByteType:oiref>=744,2787,203,109,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=274,1315,274,1360,354,1360,354,1280,309,1280:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1362,129,90,17,0:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.IntegerType:oiref>=1921,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.XmlException:oiref>=1986,10,87,77,1:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaElement#lnkSchemaType:oiref>=3207,2812,3088,2767,2933,2767,2833,2820:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkFieldElement:oiref>=3295,986,4330,2787:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#defaultBinding:oiref>=916,623,916,673,1006,673,1006,583,956,583:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DefaultAccessControl#defaultAccessControl:oiref>=3460,239,3460,156:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicCharacterType#org.zoap.xml.Type:oiref>=1352,1227,1981,943:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.DoubleType:oiref>=959,2787,203,109,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.SchemaType:oiref>=2630,2787,203,166,1:oigroup>
-<oigroup:<oiref:java#Class#org.zoap.xml.Environment:oiref>=1992,530,198,432,1:oigroup>
-<oigroup:<oiref:design#Class#id38blncb1vpvpgcb2e7dhd.diagram:oiref>=1940,1030,173,718,1:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=1731,1132,5,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BasicObjectType#org.zoap.xml.Type:oiref>=2037,1227,2037,943:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchAttributeException#org.zoap.xml.XmlException:oiref>=2940,173,2822,87:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1229,437,7,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.DoubleType#org.zoap.xml.SimpleTypeImpl:oiref>=1018,2787,1466,1784,1466,860:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#lnkXmlSchema:oiref>=441,878,636,687,636,186:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.LongType#lnkXmlSchema:oiref>=1310,2787,1714,1864,1714,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#dataBinding:oiref>=475,1468,475,1516,561,1516,561,1430,513,1430:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.Attribute#org.zoap.xml.PartOfSchema:oiref>=796,214,968,145:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.AttributeImpl#org.zoap.xml.Appearance:oiref>=1730,974,1730,499:oigroup>
-<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=845,792,109,17,0:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaException#org.zoap.xml.XmlException:oiref>=2158,162,2158,127,2029,127,2029,87:oigroup>
-<oigroup:<oiref:java#Implements#org.zoap.xml.Type#org.zoap.xml.PartOfSchema:oiref>=1009,260,1233,107:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.FieldElement#org.zoap.xml.Element:oiref>=4378,2787,4111,863:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.BooleanType#org.zoap.xml.SimpleTypeImpl:oiref>=1699,2787,1495,1074,1495,860:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.RefAttribute#lnkSerializableSchema:oiref>=3880,2787,2828,872:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchElementException#org.zoap.xml.AttributeException:oiref>=280,63,2763,173:oigroup>
-<oigroup:<oiref:java#Extends#org.zoap.xml.ElementType#org.zoap.xml.Type:oiref>=1879,1714,1879,338,1441,338,1441,308:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.NameAttribute#lnkSerializableSchema:oiref>=3582,2787,2766,872:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchema#urn:oiref>=920,2346,1306,2242,1306,2011:oigroup>
-<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=1056,189,7,17,0:oigroup>
-<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=1529,185,501,185:oigroup>
-
-*/
-class __positions {
-}
\ No newline at end of file
+package id1k4jdc8v9c1p6c8v9hgrr;
+
+/**
+@version 2.0
+@physicalPackage
+@__modelType diagram
+*/
+class diagram {
+/**
+@__ref <oiref:design#Class#id2nzq3c8wpmexoc8wpnwj4.diagram:oiref><oihard>
+@__modelType reference
+*/
+class reference24 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Environment:oiref><oihard>
+@__modelType reference
+*/
+class reference7 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Schema:oiref><oihard>
+@__modelType reference
+*/
+class reference {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Type:oiref><oihard>
+@__modelType reference
+*/
+class reference3 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Element:oiref><oihard>
+@__modelType reference
+*/
+class reference12 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Attribute:oiref><oihard>
+@__modelType reference
+*/
+class reference14 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Binding:oiref><oihard>
+@__modelType reference
+*/
+class reference16 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.XmlObjectWriter:oiref><oihard>
+@__modelType reference
+*/
+class reference21 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.XmlException:oiref><oihard>
+@__modelType reference
+*/
+class reference28 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.ElementException:oiref><oihard>
+@__modelType reference
+*/
+class reference29 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.TypeException:oiref><oihard>
+@__modelType reference
+*/
+class reference31 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.IllegalSuperTypeException:oiref><oihard>
+@__modelType reference
+*/
+class reference32 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.XmlObjectReader:oiref><oihard>
+@__modelType reference
+*/
+class reference75 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.Appearance:oiref><oihard>
+@__modelType reference
+*/
+class reference9 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.IllegalTypeException:oiref><oihard>
+@__modelType reference
+*/
+class reference19 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.AppearanceException:oiref><oihard>
+@__modelType reference
+*/
+class reference1 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.AttributeException:oiref><oihard>
+@__modelType reference
+*/
+class reference36 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.NoCompatibleElementException:oiref><oihard>
+@__modelType reference
+*/
+class reference38 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.SchemaException:oiref><oihard>
+@__modelType reference
+*/
+class reference23 {
+}/**
+@shapeType NoteLink
+@__modelType link
+@__ref <oiref:design#Class#id2e2vrc9pgodo2c9pgqtl6.node:oiref><oihard>
+*/
+class link {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.ComplexType:oiref><oihard>
+@__modelType reference
+*/
+class reference35 {
+}/**
+@__ref <oiref:design#Class#id38blncb1vpvpgcb2e7dhd.diagram:oiref><oihard>
+@__modelType reference
+*/
+class reference37 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.XmlSchemaInstance:oiref><oihard>
+@__modelType reference
+*/
+class reference41 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.URNResolver:oiref><oihard>
+@__modelType reference
+*/
+class reference42 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.SimpleType:oiref><oihard>
+@__modelType reference
+*/
+class reference43 {
+}/**
+@__ref <oiref:java#Class#org.zoap.xml.SerialisationPolicy:oiref><oihard>
+@__modelType reference
+*/
+class reference17 {
+}}/**
+<h2>infor:X</h2>
+<p>
+infor:X is a (de-)serialisation service for XML-encoded character streams
+written in Java.
+</p>
+<p>
+It provides an extensible and XML-Schema-based meta-model (called a binding) that
connects the
+structure of XML documents to Java classes. Building upon that meta-model, there is
+a set of IO abstractions to
+parse/generate XML document instances
+into/from
+Java objects.
+</p>
+<p>
+The applications of infor:X are manyfold:
+<ul>
+<li> (De-)serialization module for modern, XML-based messaging middleware.
+</li>
+<li> Comfortable processing of XML documents.</li>
+<li> Schema-based validation procedures.</li>
+<li> Data-Engine for Generic GUIs </li>
+</ul>
+</p>
+<p>
+
+SOX is a part of the Zero-Effort Object Access Package (ZOAP) and subject to the
+<a href="../../../../../license.html">License Agreement</a> you entered
+into with infor AG.
+</p>
+<p>
+The outstanding features of infor:X are:
+<ul>
+<li> Fast and memory consuming deserialization process (compatible with
+any SAX-compliant XML parser)
+</li>
+<li>Extensible and Flexible Meta-Model.
+</li>
+<li>XML-Schema and XML-NameSpaces support.</li>
+<li>Builtin infrastructure for handling ID/IDREF types.</li>
+<li>Powerful default binding that covers XML-Schema definitions and
+any serializable Java classes including null and polymorphic structures.</li>
+<li>Inline mode for embedding meta-data into object-data to drive generic
components.
+</ul>
+</p>
+<p>
+The ToDo list for infor:X covers:
+<UL>
+<li> Improve performance by more efficient data-structures and avoidance of
+redundant processing (namespace-tagging, attribute processing).
+</li>
+<li> Find a lot of bugs.
+</li>
+<li>Inline mode for receiving schema-data
+within a given object data-document.</li>
+<li> Extensions to the Meta-Model to cover more XML-Schema features, such as
+nullable constraints, minimal and maximal numbers of appearance, value patterns,
etc.
+</li>
+</ul>
+</p>
+<p>
+<hr>
+<small> Last change of $RCSfile: xml.dfPackage,v $ by $Author: jung $ on $Date:
2000/12/04 12:36:23 $; See source for logging information. </small>
+</p>
+@see java.io.ObjectInput and @see java.io.ObjectOutput. On the XML side, up-to-date
tagging including namespaces and schemas are supported. On the Java side,
security-related reflection is used.
+
+The applications of infor:X range from persistance of runtime data up-to live
data-exchange upon different transports, such as http and smtp, e.g., through SOAP.
+
+To meet this broad range of applications, infor:X is held very flexible in terms of
an extensible @see DataBinding meta-data structure that preserves the mapping between
the XML and the Java side. A data-binding consists of a bunch of @see XmlSchema each
of which defined its own, but maybe dependent set of @see XmlType. There is a default
DataBinding installed in infor:X, but this can be overridden and manipulated in a wide
range.
+@__tags
+@shapeType ClassDiagram
+@number txmiid4
+*/
+class __tags {
+}/**
+@__options
+*/
+class __options {
+}/**
+@__positions
+<oigroup:<oiref:java#Class#org.zoap.xml.AppearanceException:oiref>=1828,162,134,59,1:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1467,770,107,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.CharacterType#org.zoap.xml.SimpleTypeImpl:oiref>=77,2787,1429,1761,1429,860:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaType#schemaType:oiref>=2800,2953,2800,2996,2876,2996,2876,2920,2833,2920:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1403,1059,7,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1149,1035,1149,437:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=313,1259,20,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#urn:oiref>=955,156,955,414,735,414,735,672:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicShortType#org.zoap.xml.Type:oiref>=1743,1227,2013,943:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.IllegalSuperTypeException:oiref>=1978,430,159,59,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#classElement:oiref>=3377,937,3920,937,4059,832:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.IllegalTypeException#org.zoap.xml.TypeException:oiref>=2030,296,2030,261,2056,261,2056,221:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.DefaultAccessControl#org.zoap.xml.XmlObjectAccessControl:oiref>=3392,239,3392,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ClassSchema#org.zoap.xml.Schema:oiref>=3309,782,3046,577:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDRefType#idType:oiref>=2561,2896,2561,2927,2613,2927,2613,2875,2582,2875:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.CreationException#org.zoap.xml.XmlException:oiref>=2511,174,2778,87:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DefaultOutputLevel#defaultOutputLevel:oiref>=3683,192,3683,109:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Type#org.zoap.xml.PartOfSchema:oiref>=693,1062,806,109:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ObjectType#lnkObjectSchema:oiref>=776,1228,917,949:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.Type:oiref>=1051,617,821,409:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchema#lnkBinding:oiref>=1526,1797,1654,1797:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.IllegalSuperTypeException#org.zoap.xml.TypeException:oiref>=1752,312,1752,229:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#elements:oiref>=1457,308,1457,490,1804,490,1804,672:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=740,189,89,17,0:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=1520,164,5,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#attributeType:oiref>=2129,102,2224,102:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.NameAttribute:oiref>=3515,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ByteType#org.zoap.xml.SimpleTypeImpl:oiref>=792,2787,1457,1832,1457,860:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ElementImpl#appearanceSchema:oiref>=1112,1714,1112,935,999,935,999,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.RefAttribute#org.zoap.xml.Attribute:oiref>=3942,2787,3942,863:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.IDRefType#org.zoap.xml.SimpleTypeImpl:oiref>=2432,2787,1525,896,1525,860:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.AppearanceException#org.zoap.xml.XmlException:oiref>=1895,162,1895,127,2029,127,2029,87:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1140,1014,5,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.LongType#longType:oiref>=1390,2896,1390,2927,1442,2927,1442,2875,1411,2875:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.IllegalTypeException:oiref>=1968,296,125,59,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkClassElement:oiref>=3336,986,4505,2787:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ComplexType#org.zoap.xml.Type:oiref>=60,1035,60,835,349,835,349,570:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicSchema#org.zoap.xml.Schema:oiref>=683,1227,683,715:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.AttributeContainer:oiref>=607,260,445,166:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#lnkAttribute:oiref>=1473,308,1473,490,2030,490,2030,672:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Element#org.zoap.xml.Appearance:oiref>=894,1035,894,681,1634,681,1634,238:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.FieldAttribute:oiref>=4091,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.StringType:oiref>=297,2796,203,109,1:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.AttributeImpl#org.zoap.xml.Attribute:oiref>=1590,1714,1590,1233,2087,1233,2087,752:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=470,570,470,618,542,618,542,532,501,532:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SimpleTypeImpl#org.zoap.xml.Type:oiref>=549,604,809,409:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassType#lnkFieldAttribute:oiref>=3126,2840,3241,2960,4010,2960,4091,2875:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicBooleanType#basicBooleanType:oiref>=1072,1227,1957,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.StringType#stringType:oiref>=479,2905,479,2936,531,2936,531,2884,500,2884:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Element#org.zoap.xml.Appearance:oiref>=1510,840,1510,376:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1140,437,5,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchema:oiref>=229,964,285,1164,520,1164,575,928:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ObjectSchema#org.zoap.xml.Schema:oiref>=927,840,704,730:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=1740,1153,1685,1153,1685,2419,394,2419,394,1245,309,1245:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1290,129,7,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicByteType#org.zoap.xml.Type:oiref>=1551,1227,1997,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.URNResolver#defaultUrnResolver:oiref>=603,2637,603,2664,647,2664,647,2620,620,2620:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DoubleType#doubleType:oiref>=1141,2896,1141,2927,1193,2927,1193,2875,1162,2875:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ShortType:oiref>=1433,2787,203,109,1:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1234,1059,5,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicIntegerType#org.zoap.xml.Type:oiref>=2313,1227,2045,1074,2045,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleTypeImpl#superType:oiref>=1533,1028,1533,1075,1587,1075,1587,991,1555,991:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.FloatType#org.zoap.xml.SimpleTypeImpl:oiref>=571,2787,1448,1783,1448,860:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=1097,437,7,17,0:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Binding:oiref>=1011,1035,219,185,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ObjectType#objectType:oiref>=809,1337,809,1368,861,1368,861,1316,830,1316:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1281,1059,82,17,0:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ElementException:oiref>=1837,296,111,59,1:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Attribute#org.zoap.xml.Appearance:oiref>=1627,840,1527,376:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicIntegerType#basicIntegerType:oiref>=2374,1227,2053,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader.ElementValue#element:oiref>=2182,110,2182,391,1877,391,1877,672:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.XmlSchema#org.zoap.xml.Schema:oiref>=856,2346,856,2325,479,2294,479,2010:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.FloatType:oiref>=521,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Element#org.zoap.xml.PartOfSchema:oiref>=1310,191,1058,147:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.DuplicateReferenceAttributeException#org.zoap.xml.XmlException:oiref>=3608,170,3608,87:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.IDRefType:oiref>=2379,2787,203,109,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ElementImpl#type:oiref>=1212,1714,1212,1011,1409,1011,1409,308:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ClassSchema:oiref>=3174,782,203,204,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader.ElementValue#appearance:oiref>=2116,60,2055,60:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.AttributeContainer:oiref>=411,840,411,166:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.DefaultOutputLevel#org.zoap.xml.XmlObjectOutputLevel:oiref>=3615,192,3615,109:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Element#elementType:oiref>=2775,1227,2093,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeImpl#type:oiref>=1523,1714,1523,1028:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BooleanType#booleanType:oiref>=1842,2896,1842,2927,1894,2927,1894,2875,1863,2875:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1240,437,1240,791,1800,791,1800,1035:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=962,164,87,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#container:oiref>=1929,871,1572,871:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ComplexType:oiref>=10,1035,125,81,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#typeSchema:oiref>=501,323,1067,323:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassElement#lnkClassType:oiref>=4473,2852,4346,3026,3270,3026,3126,2890:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Binding#schemas:oiref>=1036,725,109,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDRefType#lnkSchemaType:oiref>=2485,2787,1774,922,1774,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DoubleType#lnkXmlSchema:oiref>=1077,2787,1703,1824,1703,872:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.SimpleTypeImpl#org.zoap.xml.Type:oiref>=1429,672,1429,338,1441,338,1441,308:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicStringType#org.zoap.xml.Type:oiref>=2514,1227,2061,1069,2061,943:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.SchemaImpl#org.zoap.xml.Schema:oiref>=977,672,977,156:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicShortType#basicShortType:oiref>=1685,1227,2005,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassType#lnkFieldElement:oiref>=3126,2865,3230,2970,4161,2970,4282,2875:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicSchema#basicSchema:oiref>=707,1227,707,696:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ObjectSchema:oiref>=826,840,203,109,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkFieldAttribute:oiref>=3254,986,4138,2787:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.IDType:oiref>=2166,2787,203,109,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ByteType#byteType:oiref>=926,2896,926,2927,978,2927,978,2875,947,2875:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.IntegerType#org.zoap.xml.SimpleTypeImpl:oiref>=1979,2787,1505,1063,1505,860:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.PartOfSchema#schema:oiref>=1395,69,534,69:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchema#xmlSchema:oiref>=955,2493,955,2532,1023,2532,1023,2464,984,2464:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#classType:oiref>=3241,782,2488,542,2488,492:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaImpl#urn:oiref>=889,741,799,741:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.URNResolver:oiref>=417,2548,203,89,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=1067,210,501,210:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Element:oiref>=736,1035,199,157,1:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=505,511,20,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.IllegalSuperTypeException#org.zoap.xml.IllegalTypeException:oiref>=2035,430,2035,355:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BindingImpl#schemas:oiref>=541,672,541,414,934,414,934,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicDoubleType#org.zoap.xml.Type:oiref>=3152,1227,2127,943:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.BasicObjectType#org.zoap.xml.Type:oiref>=471,1005,471,938:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ClassType#org.zoap.xml.ComplexTypeImpl:oiref>=3025,2787,3025,1005:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaElement#org.zoap.xml.Element:oiref>=3342,2787,4085,863:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ClassElement#org.zoap.xml.Element:oiref>=4538,2787,4137,863:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.TypeException:oiref>=1990,162,92,59,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ComplexTypeImpl#superType:oiref>=1259,672,1259,490,1428,490,1428,308:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.SchemaException:oiref>=2102,162,112,59,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicSchema#basicTypes:oiref>=746,1227,1941,943:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.XmlSchema#org.zoap.xml.Schema:oiref>=1436,1752,1174,1019,1152,667:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.NameAttribute#lnkIDType:oiref>=3515,2875,3424,3006,2325,3006,2325,2896:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=313,1224,7,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#schema:oiref>=1509,828,487,309:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1529,150,1286,150:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchElementException#org.zoap.xml.ElementException:oiref>=2643,316,2643,233:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#urnResolver:oiref>=518,2378,518,2548:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ShortType#lnkXmlSchema:oiref>=1537,2787,1726,1908,1726,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#lnkType:oiref>=1529,97,1473,97,1473,31,662,31,662,100,501,100:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Element#schema:oiref>=1747,962,492,309:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ClassType.ArrayType:oiref>=2947,2788,98,81,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SerializableSchema#org.zoap.xml.Schema:oiref>=2840,782,3010,577:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Appearance:oiref>=1529,62,199,176,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ComplexTypeImpl#typeSchema:oiref>=1170,672,1170,414,1021,414,1021,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.IDType#org.zoap.xml.SimpleTypeImpl:oiref>=2206,2787,1515,907,1515,860:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#lnkXmlType:oiref>=806,96,1828,96:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeImpl#lnkSimpleType:oiref>=1513,1069,1437,1069:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.NoCompatibleElementException:oiref>=1768,430,190,59,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Appearance#org.zoap.xml.PartOfSchema:oiref>=973,1062,852,109:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.LongType#org.zoap.xml.SimpleTypeImpl:oiref>=1259,2787,1475,1816,1475,860:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaType#org.zoap.xml.ComplexTypeImpl:oiref>=2756,2787,3000,1005:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ElementException#org.zoap.xml.AppearanceException:oiref>=1892,296,1892,261,1860,261,1860,221:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.NoCompatibleElementException#org.zoap.xml.ElementException:oiref>=1892,430,1892,355:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BooleanType#lnkXmlSchema:oiref>=1738,2787,1738,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicDoubleType#basicDoubleType:oiref>=3090,1227,2118,943:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ElementImpl#org.zoap.xml.Appearance:oiref>=1974,961,1750,499:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.TypeException#org.zoap.xml.XmlException:oiref>=2036,162,2036,127,2029,127,2029,87:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.SimpleType:oiref>=131,1035,178,280,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#referenceAttribute:oiref>=2038,398,2038,299:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleTypeImpl#typeSchema:oiref>=1397,672,1397,414,1044,414,1044,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ClassType.ArrayType#org.zoap.xml.ClassType:oiref>=2996,2788,2996,2787:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SerializableSchema#serializableSchema:oiref>=2890,872,2890,900,2936,900,2936,854,2908,854:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.FloatType#lnkXmlSchema:oiref>=622,2787,1681,1744,1681,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.CharacterType#charType:oiref>=188,2915,188,2950,248,2950,248,2890,213,2890:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicObjectType#basicObjectType:oiref>=2149,1342,2020,1067,2020,920:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicLongType#basicLongType:oiref>=2893,1227,2101,943:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.XmlSchemaInstance#org.zoap.xml.Schema:oiref>=1515,1035,1515,901,1194,901,1194,437:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#arrayElement:oiref>=3377,822,4059,822:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=1108,437,1108,571,841,571,841,1035:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IntegerType#integerType:oiref>=2103,2896,2103,2927,2155,2927,2155,2875,2124,2875:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.CharacterType#lnkXmlSchema:oiref>=145,2787,1659,1664,1659,872:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ShortType#org.zoap.xml.SimpleTypeImpl:oiref>=1485,2787,1485,860:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.meta.builtin:oiref>=90,623,203,81,1:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.Type:oiref>=1192,672,1192,338,1441,338,1441,308:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaSchema#schemaSchema:oiref>=851,1227,740,696:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.FieldElement:oiref>=4282,2787,203,147,1:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=546,564,58,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#lnkXmlSchema:oiref>=1828,141,794,141:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.SchemaElement:oiref>=3207,2787,203,128,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ShortType#shortType:oiref>=1615,2896,1615,2927,1667,2927,1667,2875,1636,2875:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.meta.builtin#org.zoap.xml.Binding:oiref>=293,639,737,583:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.StringType#lnkXmlSchema:oiref>=405,2796,1670,1704,1670,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#defaultDataBinding:oiref>=484,1006,484,1041,544,1041,544,981,509,981:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.ElementImpl#org.zoap.xml.Element:oiref>=1137,1714,1137,782,1804,782,1804,752:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleTypeImpl#lnkSimpleType:oiref>=574,941,574,986,654,986,654,906,609,906:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicByteType#basicByteType:oiref>=1495,1227,1989,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaElement#schemaElement:oiref>=3385,2915,3385,2950,3445,2950,3445,2890,3410,2890:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=996,2398,87,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SimpleType#org.zoap.xml.Type:oiref>=220,1035,220,835,349,835,349,570:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Appearance#org.zoap.xml.PartOfSchema:oiref>=1465,260,1266,107:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Type:oiref>=308,62,193,508,1:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.Schema:oiref>=759,290,759,335,839,335,839,255,794,255:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicCharacterType#basicCharacterType:oiref>=1286,1227,1973,943:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=265,1315,5,17,0:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.XmlObjectReader:oiref>=414,1035,209,1343,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.NameAttribute#nameAttribute:oiref>=3697,2896,3697,2927,3749,2927,3749,2875,3718,2875:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=285,1339,58,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.RefAttribute#refAttribute:oiref>=4000,2896,4000,2927,4052,2927,4052,2875,4021,2875:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeType#IDREF:oiref>=2345,194,2345,234,2415,234,2415,164,2375,164:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.ElementContainer:oiref>=634,260,634,166:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ObjectSchema#objectSchema:oiref>=1008,949,1008,980,1060,980,1060,928,1029,928:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectWriter#dataBinding:oiref>=114,864,529,409:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicLongType#org.zoap.xml.Type:oiref>=2951,1227,2109,943:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchemaInstance#xmlSchemaInstance:oiref>=1596,1153,51,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#schemas:oiref>=465,1227,649,998,649,715:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.XmlSchemaInstance:oiref>=1414,1035,203,90,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ObjectType:oiref>=668,1228,162,109,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaNotFoundException#org.zoap.xml.XmlException:oiref>=2810,174,2810,87:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.XmlObjectWriter:oiref>=1019,2548,202,602,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.DuplicateReferenceAttributeException#org.zoap.xml.AttributeException:oiref>=3098,316,3098,233:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Type#attributes:oiref>=2083,398,2083,299:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Binding#org.zoap.xml.SchemaContainer:oiref>=92,840,92,416:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.TypeContainer:oiref>=761,260,943,166:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDType#lnkSchemaType:oiref>=2247,2787,1762,926,1762,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#binding:oiref>=623,1210,1011,1210:oigroup>
+<oigroup:Composite#clientRole#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1520,150,5,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.StringType#org.zoap.xml.SimpleTypeImpl:oiref>=351,2796,1439,1772,1439,860:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1791,1014,5,17,0:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Schema#org.zoap.xml.PartOfSchemaContainer:oiref>=722,260,722,166:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ElementType#org.zoap.xml.Element:oiref>=1851,1714,1851,782,1804,782,1804,752:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ClassType.ArrayType#org.zoap.xml.ComplexTypeImpl:oiref>=198,310,3020,782:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#lnkXmlType:oiref>=475,878,1836,414:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#type:oiref>=433,1035,433,570:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.FieldAttribute#org.zoap.xml.Attribute:oiref>=4185,2787,3967,863:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.AttributeException:oiref>=1703,296,114,59,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.AttributeException#org.zoap.xml.XmlException:oiref>=3126,174,2842,87:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=505,189,5,17,0:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.CharacterType:oiref>=10,2787,203,128,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkClassType:oiref>=3214,986,3056,2787:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.RefAttribute#lnkIDRefType:oiref>=3818,2875,3683,3016,2578,3016,2470,2896:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchemaInstance#xmlSchemaInstance:oiref>=1599,1125,1599,1153,1645,1153,1645,1107,1617,1107:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ByteType#lnkXmlSchema:oiref>=840,2787,1692,1784,1692,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IntegerType#lnkXmlSchema:oiref>=2037,2787,1750,925,1750,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaElement#lnkXmlSchema:oiref>=3274,2787,1798,909,1798,872:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.NameAttribute#org.zoap.xml.Attribute:oiref>=3649,2787,3918,863:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=832,1014,5,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#dataBinding:oiref>=227,1347,322,1347:oigroup>
+<oigroup:<oiref:design#Class#id2nzq3c8wpmexoc8wpnwj4.diagram:oiref>=1880,530,92,148,1:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Attribute#org.zoap.xml.Appearance:oiref>=1860,1035,1860,681,1634,681,1634,238:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ObjectType#org.zoap.xml.ComplexTypeImpl:oiref>=722,1228,472,1139:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicBooleanType#org.zoap.xml.Type:oiref>=1136,1227,1965,943:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.ComplexTypeImpl#org.zoap.xml.ElementContainer:oiref>=446,840,567,166:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.IDType#idType:oiref>=2348,2896,2348,2927,2400,2927,2400,2875,2369,2875:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ClassElement:oiref>=4473,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.RefAttribute:oiref>=3818,2787,203,109,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicStringType#basicStringType:oiref>=2573,1227,2069,1101,2069,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#lnkXmlSchemaInstance:oiref>=1230,1080,1414,1080:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.TypeNotFoundException#org.zoap.xml.XmlException:oiref>=2976,174,2826,87:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaSchema#basicTypes:oiref>=943,1227,1949,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.BasicFloatType#basicFloatType:oiref>=1878,1227,2021,943:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Schema:oiref>=1067,62,219,375,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectWriter#binding:oiref>=1120,2548,1120,1220:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicFloatType#org.zoap.xml.Type:oiref>=1935,1227,2029,943:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaType#lnkXmlSchema:oiref>=2693,2787,1786,916,1786,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.AttributeImpl#appearanceSchema:oiref>=1491,1714,1491,935,1067,935,1067,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.AttributeException#org.zoap.xml.AppearanceException:oiref>=1760,296,1760,261,1860,261,1860,221:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Attribute:oiref>=1740,1035,168,147,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.FloatType#floatType:oiref>=703,2896,703,2927,755,2927,755,2875,724,2875:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.SerializableSchema:oiref>=2705,782,203,90,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Element#type:oiref>=788,1035,788,843,453,843,453,570:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchAttributeException#org.zoap.xml.AttributeException:oiref>=3165,316,3165,233:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlObjectReader#element:oiref>=623,1113,736,1113:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Schema#org.zoap.xml.Type:oiref>=794,198,1828,198:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.LongType:oiref>=1208,2787,203,109,1:oigroup>
+<oigroup:Composite#supplierCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=505,164,7,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaSchema#org.zoap.xml.Schema:oiref>=897,1227,774,696:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.BooleanType:oiref>=1660,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ClassType:oiref>=2923,2787,203,128,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#lnkSimpleType:oiref>=1476,930,1437,930:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Type#superType:oiref>=461,570,5,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SerializableSchema#lnkBinding:oiref>=2772,782,1776,560,1776,501:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.ByteType:oiref>=744,2787,203,109,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SimpleType#superType:oiref>=274,1315,274,1360,354,1360,354,1280,309,1280:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#appearanceSchema:oiref>=1362,129,90,17,0:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.IntegerType:oiref>=1921,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.XmlException:oiref>=1986,10,87,77,1:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.SchemaElement#lnkSchemaType:oiref>=3207,2812,3088,2767,2933,2767,2833,2820:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.ClassSchema#lnkFieldElement:oiref>=3295,986,4330,2787:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Binding#defaultBinding:oiref>=916,623,916,673,1006,673,1006,583,956,583:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DefaultAccessControl#defaultAccessControl:oiref>=3460,239,3460,156:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicCharacterType#org.zoap.xml.Type:oiref>=1352,1227,1981,943:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.DoubleType:oiref>=959,2787,203,109,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.SchemaType:oiref>=2630,2787,203,166,1:oigroup>
+<oigroup:<oiref:java#Class#org.zoap.xml.Environment:oiref>=1992,530,198,432,1:oigroup>
+<oigroup:<oiref:design#Class#id38blncb1vpvpgcb2e7dhd.diagram:oiref>=1940,1030,173,718,1:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Attribute#type:oiref>=1731,1132,5,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BasicObjectType#org.zoap.xml.Type:oiref>=2037,1227,2037,943:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchAttributeException#org.zoap.xml.XmlException:oiref>=2940,173,2822,87:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#attribute:oiref>=1229,437,7,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.DoubleType#org.zoap.xml.SimpleTypeImpl:oiref>=1018,2787,1466,1784,1466,860:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#lnkXmlSchema:oiref>=441,878,636,687,636,186:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.LongType#lnkXmlSchema:oiref>=1310,2787,1714,1864,1714,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.DataBinding#dataBinding:oiref>=475,1468,475,1516,561,1516,561,1430,513,1430:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.Attribute#org.zoap.xml.PartOfSchema:oiref>=796,214,968,145:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.AttributeImpl#org.zoap.xml.Appearance:oiref>=1730,974,1730,499:oigroup>
+<oigroup:Composite#label#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#element:oiref>=845,792,109,17,0:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.SchemaException#org.zoap.xml.XmlException:oiref>=2158,162,2158,127,2029,127,2029,87:oigroup>
+<oigroup:<oiref:java#Implements#org.zoap.xml.Type#org.zoap.xml.PartOfSchema:oiref>=1009,260,1233,107:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.FieldElement#org.zoap.xml.Element:oiref>=4378,2787,4111,863:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.BooleanType#org.zoap.xml.SimpleTypeImpl:oiref>=1699,2787,1495,1074,1495,860:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.RefAttribute#lnkSerializableSchema:oiref>=3880,2787,2828,872:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.NoSuchElementException#org.zoap.xml.AttributeException:oiref>=280,63,2763,173:oigroup>
+<oigroup:<oiref:java#Extends#org.zoap.xml.ElementType#org.zoap.xml.Type:oiref>=1879,1714,1879,338,1441,338,1441,308:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.NameAttribute#lnkSerializableSchema:oiref>=3582,2787,2766,872:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.XmlSchema#urn:oiref>=920,2346,1306,2242,1306,2011:oigroup>
+<oigroup:Composite#clientCardinality#MemberLink#<oiref:java#Member#org.zoap.xml.Schema#type:oiref>=1056,189,7,17,0:oigroup>
+<oigroup:MemberLink#<oiref:java#Member#org.zoap.xml.Appearance#type:oiref>=1529,185,501,185:oigroup>
+
+*/
+class __positions {
+}
1.1 zoap/src/org/zoap/xml/SerialisationPolicy.java
Index: SerialisationPolicy.java
===================================================================
/*
* $Id: SerialisationPolicy.java,v 1.1 2000/12/04 12:36:21 jung Exp $
* Copyright (c) 2000 infor:business solutions AG, Hauerstrasse 12,
* D-66299 Friedrichsthal, Germany. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.zoap.xml;
/** this interface must be implemented by policy objects controlling the
serialisation depth. */
public interface SerialisationPolicy {
/** decides whether the @arg element of @arg objects is to be serialised at
@arg depth */
public boolean isToBeSerialised(Object object, Element element, int depth);
/** decides whether the @arg attribute of @arg objects is to be serialised at
@arg depth */
public boolean isToBeSerialised(Object object, Attribute element, int depth);
public static SerialisationPolicy defaultSerialisationPolicy = new
DefaultSerialisationPolicy();
public static class DefaultSerialisationPolicy implements SerialisationPolicy {
public boolean isToBeSerialised(Object object, Element element, int
depth) {
return true;
}
public boolean isToBeSerialised(Object object, Attribute element, int
depth) {
return true;
}
}
}