User: jung
Date: 00/12/04 04:36:14
Modified: src/org/zoap/soap/meta/builtin/string DefaultBinding.java
builtin.dfPackage
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 +295 -291 zoap/src/org/zoap/soap/meta/builtin/string/DefaultBinding.java
Index: DefaultBinding.java
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/soap/meta/builtin/string/DefaultBinding.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultBinding.java 2000/08/10 21:07:16 1.1
+++ DefaultBinding.java 2000/12/04 12:36:13 1.2
@@ -1,294 +1,304 @@
-/*
- * $Id: DefaultBinding.java,v 1.1 2000/08/10 21:07:16 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.soap.meta.builtin.string;
-
-import org.zoap.soap.Environment;
-import org.zoap.soap.Envelope;
-import org.zoap.soap.MethodRequest;
-import org.zoap.soap.MethodResponse;
-
-import org.zoap.soap.meta.RequestElement;
-import org.zoap.soap.meta.ResponseElement;
-import org.zoap.soap.meta.string.RequestType;
-import org.zoap.soap.meta.string.ResponseType;
-
-import org.zoap.soap.meta.SoapBinding;
-
-import org.zoap.xml.meta.StringType;
-
-import org.zoap.xml.Schema;
-import org.zoap.xml.Element;
-import org.zoap.xml.Type;
-import org.zoap.xml.TypeException;
-import org.zoap.xml.ComplexType;
-import org.zoap.xml.ElementException;
-
-import de.infor.ce.util.URN;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Properties;
-
-import java.lang.reflect.Method;
-
-/**
- * SoapBinding overrides the default databinding of infor:XML to introduce
SOAP-related
- * schemas, elements, attributes and types.
- * <br>
- * @see <related>
- * @author $Author: jung $
- * @version $Revision: 1.1 $
- */
-
-public class DefaultBinding extends SoapBinding {
-
- private org.zoap.xml.meta.builtin.DefaultBinding objectBinding;
-
- /** register the additional soap schema which overrides some defaults */
- public DefaultBinding() {
-
- if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
- Environment.out.print(toString()+"()\n");
-
- }
-
- /**
- * looks up a @return Schema by its @arg urn. Here, the SOAP schema and
- * the default schemas.
- * @clientRole *
- * @supplierRole 1
- * @directed
- * @link association
- * @label registeredSchema
- */
- /*#SoapSchema soapSchema;*/
-
- public Schema getSchema(URN urn) {
-
- if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
- Environment.out.print(toString()+".getSchema("+urn+")\n");
-
- Schema result=super.getSchema(urn);
-
- if(result==null) {
-
- try{
- Class forClass=
- Environment.getClassForUrn(urn);
-
- return getInterfaceSchema(forClass);
- } catch(ClassNotFoundException e) {
-
- if(objectBinding==null)
- objectBinding=new org.zoap.xml.meta.builtin.DefaultBinding();
-
- return objectBinding.getSchema(urn);
- }
- } else
- return result;
- }
-
- /**
- * method to lookup a @return Element in the registered schemas
- * whose type complies to the given Java @arg object. Since SOAP must
- * always use a non-empty envelope, this is quite straightforward.
- */
-
- public Element findElementCompatibleTo(Object object, Class clazz) {
-
- if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
-
Environment.out.println(toString()+".findElementCompatibleTo("+object+","+clazz+")");
-
- Element result=super.findElementCompatibleTo(object,clazz);
-
- if(result==null) {
-
- if(object instanceof MethodRequest) {
-
- return getInterfaceSchema(((MethodRequest)
object).getMethod().getDeclaringClass()).
- findElementCompatibleTo(object,MethodRequest.class);
-
- } else if(object instanceof MethodResponse) {
-
- return getInterfaceSchema(((MethodResponse)
object).getMethod().getDeclaringClass()).
- findElementCompatibleTo(object,MethodResponse.class);
-
- } else {
-
- if(objectBinding==null)
- objectBinding=new org.zoap.xml.meta.builtin.DefaultBinding();
-
- return objectBinding.findElementCompatibleTo(object,clazz);
-
- }
- } else
- return result;
-
- }
-
- public Type findTypeCompatibleTo(Object object, Class clazz) {
-
- if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
-
Environment.out.print(toString()+".findTypeCompatibleTo("+object+","+clazz+")\n");
-
- Element element=findElementCompatibleTo(object,clazz);
-
- if(element!=null)
- return element.getType();
- else
- return null;
- }
-
- public Schema getInterfaceSchema(Class forClass) {
-
- Schema result=(Schema) classInterfaceSchemaMap.get(forClass);
-
- if(result==null)
-
- synchronized(classInterfaceSchemaMap) {
-
- result=(Schema) classInterfaceSchemaMap.get(forClass);
-
- if(result==null) {
-
- result=new Schema();
-
- result.setUrn(new URN(Environment.INTERNAL_URN.toString()+
- org.zoap.xml.Environment.getNameSpaceForClass(forClass)));
-
- addSchema(result);
-
- Method[] methods=forClass.getMethods();
-
- for(int count=0;count<methods.length;count++) {
-
- RequestElement requestElement=new RequestElement();
- ResponseElement responseElement=new ResponseElement();
-
- // extract our name suffix
-
requestElement.setAppearanceName(methods[count].getName()+"-"+count+"-Request");
-
responseElement.setAppearanceName(methods[count].getName()+"-"+count+"-Response");
-
- // we build up a nice schema for the package of the class
- requestElement.setAppearanceSchema(result);
- responseElement.setAppearanceSchema(result);
-
- // create a new responsetype
- RequestType requestType=new RequestType();
- ResponseType responseType=new ResponseType();
-
- // extract our name suffix
-
requestType.setTypeName(methods[count].getName()+"-"+count+"-Request");
-
responseType.setTypeName(methods[count].getName()+"-"+count+"-Response");
-
- // we build up a nice schema for the package of the class
- requestType.setTypeSchema(result);
- responseType.setTypeSchema(result);
-
- // we set the method name
- requestType.setAssociatedMethod(methods[count]);
- responseType.setAssociatedMethod(methods[count]);
-
- // and we determine the allowed "elements"
- Class[] argClasses=methods[count].getParameterTypes();
- Schema[] argumentSchemas=new Schema[argClasses.length];
- String[] argumentNames=new String[argClasses.length];
-
- for(int count2=0;count2<argClasses.length;count2++) {
- argumentSchemas[count2]=result;
-
argumentNames[count2]=methods[count].getName()+"-"+count+"-Argument-"+count2;
- } // for
-
- requestType.setArgumentSchemas(argumentSchemas);
- requestType.setArgumentNames(argumentNames);
-
- // and we determine the allowed "elements"
- Class returnClass=methods[count].getReturnType();
-
- if(returnClass!=void.class) {
- responseType.setReturnSchema(result);
-
responseType.setReturnName(methods[count].getName()+"-"+count+"-Return");
- } //if
-
- requestElement.setType(requestType);
- responseElement.setType(responseType);
-
- result.addElement(requestElement);
- result.addElement(responseElement);
-
- } // for
-
- addSchema(result);
-
- } // if
- } // sync
-
- return result;
- }
-
- /** we keep a static reference to a singleton */
- private static DefaultBinding defaultBinding;
-
- /** retrieve the singleton */
- public static DefaultBinding getDefaultBinding() {
- if(defaultBinding==null)
- synchronized(DefaultBinding.class) {
- if(defaultBinding==null)
- defaultBinding=new DefaultBinding();
- }
-
- return defaultBinding;
- }
-
- private static Map classInterfaceSchemaMap=new HashMap();
-
-
-}
-/*
+/*
+ * $Id: DefaultBinding.java,v 1.2 2000/12/04 12:36:13 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.soap.meta.builtin.string;
+
+import org.zoap.soap.Environment;
+import org.zoap.soap.Envelope;
+import org.zoap.soap.MethodRequest;
+import org.zoap.soap.MethodResponse;
+
+import org.zoap.soap.meta.RequestElement;
+import org.zoap.soap.meta.ResponseElement;
+import org.zoap.soap.meta.string.RequestType;
+import org.zoap.soap.meta.string.ResponseType;
+
+import org.zoap.soap.meta.SoapBinding;
+
+import org.zoap.xml.meta.StringType;
+
+import org.zoap.xml.Schema;
+import org.zoap.xml.Element;
+import org.zoap.xml.Type;
+import org.zoap.xml.TypeException;
+import org.zoap.xml.ComplexType;
+import org.zoap.xml.ElementException;
+
+import de.infor.ce.util.URN;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Properties;
+
+import java.lang.reflect.Method;
+
+/**
+ * SoapBinding overrides the default databinding of infor:XML to introduce
SOAP-related
+ * schemas, elements, attributes and types.
+ * <br>
+ * @see <related>
+ * @author $Author: jung $
+ * @version $Revision: 1.2 $
+ */
+
+public class DefaultBinding extends SoapBinding {
+
+ private org.zoap.xml.meta.builtin.DefaultBinding objectBinding;
+
+ /** register the additional soap schema which overrides some defaults */
+ public DefaultBinding() {
+
+ if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
+ Environment.out.print(toString()+"()\n");
+
+ }
+
+ /**
+ * looks up a @return Schema by its @arg urn. Here, the SOAP schema and
+ * the default schemas.
+ * @clientRole *
+ * @supplierRole 1
+ * @directed
+ * @link association
+ * @label registeredSchema
+ */
+ /*#SoapSchema soapSchema;*/
+
+ public Schema getSchema(URN urn) {
+
+ if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
+ Environment.out.print(toString()+".getSchema("+urn+")\n");
+
+ Schema result=super.getSchema(urn);
+
+ if(result==null) {
+
+ try{
+ Class forClass=
+ Environment.getClassForUrn(urn);
+
+ return getInterfaceSchema(forClass);
+ } catch(ClassNotFoundException e) {
+
+ if(objectBinding==null)
+ objectBinding=new org.zoap.xml.meta.builtin.DefaultBinding();
+
+ return objectBinding.getSchema(urn);
+ }
+ } else
+ return result;
+ }
+
+ /**
+ * method to lookup a @return Element in the registered schemas
+ * whose type complies to the given Java @arg object. Since SOAP must
+ * always use a non-empty envelope, this is quite straightforward.
+ */
+
+ public Element findElementCompatibleTo(Object object, Class clazz) {
+
+ if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
+
Environment.out.println(toString()+".findElementCompatibleTo("+object+","+clazz+")");
+
+ Element result=super.findElementCompatibleTo(object,clazz);
+
+ if(result==null) {
+
+ if(object instanceof MethodRequest) {
+
+ return getInterfaceSchema(((MethodRequest)
object).getMethod().getDeclaringClass()).
+ findElementCompatibleTo(object,MethodRequest.class);
+
+ } else if(object instanceof MethodResponse) {
+
+ return getInterfaceSchema(((MethodResponse)
object).getMethod().getDeclaringClass()).
+ findElementCompatibleTo(object,MethodResponse.class);
+
+ } else {
+
+ if(objectBinding==null)
+ objectBinding=new org.zoap.xml.meta.builtin.DefaultBinding();
+
+ return objectBinding.findElementCompatibleTo(object,clazz);
+
+ }
+ } else
+ return result;
+
+ }
+
+ public Type findTypeCompatibleTo(Object object, Class clazz) {
+
+ if(Environment.DEBUG_SOAP && Environment.DEBUG_SOAP_META)
+
Environment.out.print(toString()+".findTypeCompatibleTo("+object+","+clazz+")\n");
+
+ Element element=findElementCompatibleTo(object,clazz);
+
+ if(element!=null)
+ return element.getType();
+ else
+ return null;
+ }
+
+ public Schema getInterfaceSchema(Class forClass) {
+
+ Schema result=(Schema) classInterfaceSchemaMap.get(forClass);
+
+ if(result==null)
+
+ synchronized(classInterfaceSchemaMap) {
+
+ result=(Schema) classInterfaceSchemaMap.get(forClass);
+
+ if(result==null) {
+
+ result=new Schema();
+
+ result.setUrn(new URN(Environment.INTERNAL_URN.toString()+
+ org.zoap.xml.Environment.getNameSpaceForClass(forClass)));
+
+ addSchema(result);
+
+ Method[] methods=forClass.getMethods();
+
+ for(int count=0;count<methods.length;count++) {
+
+ RequestElement requestElement=new RequestElement();
+ ResponseElement responseElement=new ResponseElement();
+
+ // extract our name suffix
+
requestElement.setAppearanceName(methods[count].getName()+"-"+count+"-Request");
+
responseElement.setAppearanceName(methods[count].getName()+"-"+count+"-Response");
+
+ // we build up a nice schema for the package of the class
+ requestElement.setAppearanceSchema(result);
+ responseElement.setAppearanceSchema(result);
+
+ // create a new responsetype
+ RequestType requestType=new RequestType();
+ ResponseType responseType=new ResponseType();
+
+ // extract our name suffix
+
requestType.setTypeName(methods[count].getName()+"-"+count+"-Request");
+
responseType.setTypeName(methods[count].getName()+"-"+count+"-Response");
+
+ // we build up a nice schema for the package of the class
+ requestType.setTypeSchema(result);
+ responseType.setTypeSchema(result);
+
+ // we set the method name
+ requestType.setAssociatedMethod(methods[count]);
+ responseType.setAssociatedMethod(methods[count]);
+
+ // and we determine the allowed "elements"
+ Class[] argClasses=methods[count].getParameterTypes();
+ Schema[] argumentSchemas=new Schema[argClasses.length];
+ String[] argumentNames=new String[argClasses.length];
+
+ for(int count2=0;count2<argClasses.length;count2++) {
+ argumentSchemas[count2]=result;
+
argumentNames[count2]=methods[count].getName()+"-"+count+"-Argument-"+count2;
+ } // for
+
+ requestType.setArgumentSchemas(argumentSchemas);
+ requestType.setArgumentNames(argumentNames);
+
+ // and we determine the allowed "elements"
+ Class returnClass=methods[count].getReturnType();
+
+ if(returnClass!=void.class) {
+ responseType.setReturnSchema(result);
+
responseType.setReturnName(methods[count].getName()+"-"+count+"-Return");
+ } //if
+
+ requestElement.setType(requestType);
+ responseElement.setType(responseType);
+
+ result.addElement(requestElement);
+ result.addElement(responseElement);
+
+ } // for
+
+ addSchema(result);
+
+ } // if
+ } // sync
+
+ return result;
+ }
+
+ /** we keep a static reference to a singleton */
+ private static DefaultBinding defaultBinding;
+
+ /** retrieve the singleton */
+ public static DefaultBinding getDefaultBinding() {
+ if(defaultBinding==null)
+ synchronized(DefaultBinding.class) {
+ if(defaultBinding==null)
+ defaultBinding=new DefaultBinding();
+ }
+
+ return defaultBinding;
+ }
+
+ private static Map classInterfaceSchemaMap=new HashMap();
+
+
+}
+/*
* $Log: DefaultBinding.java,v $
- * Revision 1.1 2000/08/10 21:07:16 jung
- * Initial revision
- *
- */
+ * Revision 1.2 2000/12/04 12:36:13 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:16 jung
+ * Initial import.
+ *
+ *
+ */
1.2 +27 -27 zoap/src/org/zoap/soap/meta/builtin/string/builtin.dfPackage
Index: builtin.dfPackage
===================================================================
RCS file:
/products/cvs/ejboss/zoap/src/org/zoap/soap/meta/builtin/string/builtin.dfPackage,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- builtin.dfPackage 2000/08/10 21:07:15 1.1
+++ builtin.dfPackage 2000/12/04 12:36:13 1.2
@@ -1,27 +1,27 @@
-package idd1uocbhi562acbhkttca;
-
-/**
-@version 2.0
-@physicalPackage
-@__modelType diagram
-*/
-class diagram {
-/**
-@__ref
<oiref:java#Class#org.zoap.soap.meta.builtin.string.DefaultBinding:oiref><oihard>
-@__modelType reference
-*/
-class reference {
-}}/**
-@__tags
-@shapeType ClassDiagram
-*/
-class __tags {
-}/**
-@__options
-*/
-class __options {
-}/**
-@__positions
-*/
-class __positions {
-}
\ No newline at end of file
+package idd1uocbhi562acbhkttca;
+
+/**
+@version 2.0
+@physicalPackage
+@__modelType diagram
+*/
+class diagram {
+/**
+@__ref
<oiref:java#Class#org.zoap.soap.meta.builtin.string.DefaultBinding:oiref><oihard>
+@__modelType reference
+*/
+class reference {
+}}/**
+@__tags
+@shapeType ClassDiagram
+*/
+class __tags {
+}/**
+@__options
+*/
+class __options {
+}/**
+@__positions
+*/
+class __positions {
+}