incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mvesc...@apache.org
Subject svn commit: r514743 - in /incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools: ./ common/ processors/idl/
Date Mon, 05 Mar 2007 17:25:55 GMT
Author: mvescovi
Date: Mon Mar  5 09:25:53 2007
New Revision: 514743

URL: http://svn.apache.org/viewvc?view=rev&rev=514743
Log:
[YOKO-299] Added command line option -s to idltowsdl tool to specify which mapping to use for idl:sequence<octet> '-s hexBinary' or '-s base64Binary'. Default is base64Binary.

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstrTypeSpecVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DefinitionVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ModuleVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamTypeSpecVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SimpleTypeSpecVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StringVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TemplateTypeSpecVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypeDclVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypedefVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/VisitorBase.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java Mon Mar  5 09:25:53 2007
@@ -108,6 +108,10 @@
         if (env.optionSet(ToolCorbaConstants.CFG_ADDRESS)) {
             env.put(ToolCorbaConstants.CFG_ADDRESS, doc.getParameter(ToolCorbaConstants.CFG_ADDRESS));
         }
+        if (env.optionSet(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE)) {
+            env.put(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE,
+                    doc.getParameter(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE));
+        }
         
         //need to add all the other options
     }
@@ -139,7 +143,7 @@
             if (!dir.exists()) {
                 dir.mkdir();
             }
-        }
+        }        
     }
 
     public void checkParams(ErrorVisitor errors) throws ToolException {
@@ -152,6 +156,16 @@
             && (doc.hasParameter(ToolCorbaConstants.CFG_IMPORTSCHEMA))) {
             errors.add(new ErrorVisitor.UserError("Options -n & -T cannot be used together"));
         }
+        if (doc.hasParameter(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE)) {
+            String sequenceOctetType = doc.getParameter(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE);
+            if (sequenceOctetType != null) {
+                if (!(sequenceOctetType == ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_BASE64BINARY
+                    || sequenceOctetType == ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_HEXBINARY)) {
+                    errors.add(new ErrorVisitor.UserError("Invalid value specified for -s option"));
+                }
+            }
+        }
+
         if (errors.getErrors().size() > 0) {
             Message msg = new Message("PARAMETER_MISSING", LOG);
             throw new ToolException(msg, new BadUsageException(getUsage(), errors));

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ToolCorbaConstants.java Mon Mar  5 09:25:53 2007
@@ -32,4 +32,7 @@
     public static final String CFG_SCHEMA = "schema";
     public static final String CFG_IMPORTSCHEMA = "importschema";
     public static final String CFG_ADDRESS = "address";
+    public static final String CFG_SEQUENCE_OCTET_TYPE = "sequencetype";
+    public static final String CFG_SEQUENCE_OCTET_TYPE_BASE64BINARY = "base64Binary";
+    public static final String CFG_SEQUENCE_OCTET_TYPE_HEXBINARY = "hexBinary";
 }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java Mon Mar  5 09:25:53 2007
@@ -25,10 +25,7 @@
 
 import org.apache.schemas.yoko.bindings.corba.Anonarray;
 import org.apache.schemas.yoko.bindings.corba.Array;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
@@ -43,13 +40,11 @@
     private CorbaTypeImpl corbaType;
     
     public ArrayVisitor(Scope scope,
-                        XmlSchemaCollection xmlSchemas,
-                        XmlSchema xmlSchema,
-                        TypeMappingType typeMapRef,
+                        WSDLASTVisitor wsdlVisitor,
                         XmlSchemaType schemaTypeRef,
                         CorbaTypeImpl corbaTypeRef,
                         AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, typeMapRef);
+        super(scope, wsdlVisitor);
         identifierNode = identifierNodeRef;
         schemaType = schemaTypeRef;
         corbaType = corbaTypeRef;

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java Mon Mar  5 09:25:53 2007
@@ -41,10 +41,7 @@
 import org.apache.schemas.yoko.bindings.corba.ModeType;
 import org.apache.schemas.yoko.bindings.corba.OperationType;
 import org.apache.schemas.yoko.bindings.corba.ParamType;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
@@ -69,14 +66,11 @@
     private Binding             binding;
     
     public AttributeVisitor(Scope scope,
-                            XmlSchemaCollection xmlSchemas,
-                            XmlSchema xmlSchema,
-                            TypeMappingType typeMap,
-                            Definition wsdlDefinition,
+                            WSDLASTVisitor wsdlVisitor,
                             PortType wsdlPortType,
                             Binding wsdlBinding) {
-        super(scope, xmlSchemas, xmlSchema, typeMap);
-        definition = wsdlDefinition;
+        super(scope, wsdlVisitor);
+        definition = wsdlVisitor.getDefinition();
         extReg = definition.getExtensionRegistry();
         portType = wsdlPortType;
         binding = wsdlBinding;
@@ -218,10 +212,7 @@
         XmlSchemaElement element = new XmlSchemaElement();
         if (typeNode != null) {
             ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), 
-                                                                    schemas, 
-                                                                    schema, 
-                                                                    typeMap,
-                                                                    definition);
+                                                                    wsdlVisitor);
             visitor.visit(typeNode);
             XmlSchemaType stype = visitor.getSchemaType();
             
@@ -288,10 +279,7 @@
         param.setName(RETURN_PARAM_NAME);
 
         ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), 
-                                                                schemas, 
-                                                                schema, 
-                                                                typeMap,
-                                                                definition);
+                                                                wsdlVisitor);
         visitor.visit(type);
         CorbaTypeImpl corbaType = visitor.getCorbaType();
         
@@ -306,10 +294,7 @@
         param.setMode(ModeType.IN);
         
         ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), 
-                                                                schemas, 
-                                                                schema, 
-                                                                typeMap,
-                                                                definition);
+                                                                wsdlVisitor);
         visitor.visit(type);
         CorbaTypeImpl corbaType = visitor.getCorbaType();
         

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstVisitor.java Mon Mar  5 09:25:53 2007
@@ -24,10 +24,7 @@
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.Const;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
 import org.apache.yoko.wsdl.CorbaTypeImpl;
@@ -35,10 +32,8 @@
 public class ConstVisitor extends VisitorBase {
 
     public ConstVisitor(Scope scope,
-                        XmlSchemaCollection xmlSchemas,
-                        XmlSchema xmlSchema,
-                        TypeMappingType typeMappingType) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+                        WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
     
     public static boolean accept(AST node) {
@@ -80,7 +75,7 @@
         // TEMPORARILY 
         // using TypesVisitor to visit <const_type>
         // it should be visited by a ConstTypeVisitor
-        TypesVisitor visitor = new TypesVisitor(getScope(), schemas, schema, typeMap, constNameNode);
+        TypesVisitor visitor = new TypesVisitor(getScope(), wsdlVisitor, constNameNode);
         visitor.visit(constTypeNode);
         XmlSchemaType constSchemaType = visitor.getSchemaType();
         CorbaTypeImpl constCorbaType = visitor.getCorbaType();

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstrTypeSpecVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstrTypeSpecVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstrTypeSpecVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ConstrTypeSpecVisitor.java Mon Mar  5 09:25:53 2007
@@ -21,21 +21,14 @@
 
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class ConstrTypeSpecVisitor extends VisitorBase {
 
     private AST identifierNode;
     
     public ConstrTypeSpecVisitor(Scope scope,
-                                 XmlSchemaCollection xmlSchemas,
-                                 XmlSchema xmlSchema,
-                                 TypeMappingType corbaTypeMap,
+                                 WSDLASTVisitor wsdlASTVisitor,
                                  AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+        super(scope, wsdlASTVisitor);
         identifierNode = identifierNodeRef;
     }
     
@@ -55,15 +48,15 @@
         Visitor visitor = null;
         
         if (StructVisitor.accept(node)) {
-            visitor = new StructVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new StructVisitor(getScope(), wsdlVisitor);
         }
 
         if (UnionVisitor.accept(node)) {
-            visitor = new UnionVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new UnionVisitor(getScope(), wsdlVisitor);
         }
 
         if (EnumVisitor.accept(node)) {
-            visitor = new EnumVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new EnumVisitor(getScope(), wsdlVisitor);
         }
 
         visitor.visit(node);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java Mon Mar  5 09:25:53 2007
@@ -26,10 +26,7 @@
 import org.apache.schemas.yoko.bindings.corba.Alias;
 import org.apache.schemas.yoko.bindings.corba.Fixed;
 import org.apache.schemas.yoko.bindings.corba.Sequence;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaType;
@@ -42,15 +39,12 @@
     //                | <complex_declarator>
     // <simple_declarator> ::= <identifier>
     // <complex_declarator> ::= <array_declarator>
-
-
+    
     public DeclaratorVisitor(Scope scope,
-                             XmlSchemaCollection xmlSchemas,
-                             XmlSchema xmlSchema,
-                             TypeMappingType corbaTypeMap,
+                             WSDLASTVisitor wsdlASTVisitor,
                              XmlSchemaType schemaTypeRef,
                              CorbaTypeImpl corbaTypeRef) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+        super(scope, wsdlASTVisitor);
         setSchemaType(schemaTypeRef);
         setCorbaType(corbaTypeRef);
     }
@@ -59,9 +53,7 @@
     
         if (ArrayVisitor.accept(node)) {
             ArrayVisitor arrayVisitor = new ArrayVisitor(getScope(),
-                                                         schemas,
-                                                         schema,
-                                                         typeMap,
+                                                         wsdlVisitor,
                                                          getSchemaType(),
                                                          getCorbaType(),
                                                          node); 
@@ -84,9 +76,7 @@
 
             if (ArrayVisitor.accept(nextDecl)) {
                 ArrayVisitor arrayVisitor = new ArrayVisitor(newScope,
-                                                             schemas,
-                                                             schema,
-                                                             typeMap,
+                                                             wsdlVisitor,
                                                              getSchemaType(),
                                                              getCorbaType(),
                                                              nextDecl); 

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DefinitionVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DefinitionVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DefinitionVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DefinitionVisitor.java Mon Mar  5 09:25:53 2007
@@ -23,22 +23,14 @@
 
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class DefinitionVisitor extends VisitorBase {
     
     private Definition definition;
 
     public DefinitionVisitor(Scope scope,
-                             Definition wsdlDefinition,
-                             XmlSchemaCollection xmlSchemas,
-                             XmlSchema xmlSchema,
-                             TypeMappingType corbaTypeMap) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
-        definition = wsdlDefinition;
+                             WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
+        definition = wsdlVisitor.getDefinition();
     }
 
     public void visit(AST node) {
@@ -58,43 +50,31 @@
         }
         case IDLTokenTypes.LITERAL_module: {
             ModuleVisitor moduleVisitor = new ModuleVisitor(getScope(),
-                                                            definition,
-                                                            schemas,
-                                                            schema,
-                                                            typeMap);
+                                                            wsdlVisitor);
             moduleVisitor.visit(node);
             break;
         }
         case IDLTokenTypes.LITERAL_interface: {
             PortTypeVisitor portTypeVisitor = new PortTypeVisitor(getScope(),
-                                                                  schemas,
-                                                                  schema,
-                                                                  typeMap,
-                                                                  definition);
+                                                                  wsdlVisitor);
             portTypeVisitor.visit(node);
             break;
         }
         case IDLTokenTypes.LITERAL_exception: {
             ExceptionVisitor exceptionVisitor = new ExceptionVisitor(getScope(),
-                                                                     schemas,
-                                                                     schema,
-                                                                     typeMap);
+                                                                     wsdlVisitor);
             exceptionVisitor.visit(node);
             break;
         }
         case IDLTokenTypes.LITERAL_const: {
             ConstVisitor constVisitor = new ConstVisitor(getScope(),
-                                                         schemas,
-                                                         schema,
-                                                         typeMap);
+                                                         wsdlVisitor);
             constVisitor.visit(node);
             break;
         }
         default: {
             TypeDclVisitor typeDclVisitor = new TypeDclVisitor(getScope(),
-                                                               schemas,
-                                                               schema,
-                                                               typeMap);
+                                                               wsdlVisitor);
             typeDclVisitor.visit(node);
         }
         

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java Mon Mar  5 09:25:53 2007
@@ -25,10 +25,7 @@
 
 import org.apache.schemas.yoko.bindings.corba.Enum;
 import org.apache.schemas.yoko.bindings.corba.Enumerator;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction;
@@ -38,10 +35,8 @@
 public class EnumVisitor extends VisitorBase {
 
     public EnumVisitor(Scope scope,
-                       XmlSchemaCollection xmlSchemas,
-                       XmlSchema xmlSchema,
-                       TypeMappingType typeMappingType) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+                       WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
     
     public static boolean accept(AST node) {

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java Mon Mar  5 09:25:53 2007
@@ -25,10 +25,7 @@
 
 import org.apache.schemas.yoko.bindings.corba.Exception;
 import org.apache.schemas.yoko.bindings.corba.MemberType;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
@@ -41,10 +38,8 @@
     private static final String TYPE_SUFFIX = "Type";
     
     public ExceptionVisitor(Scope scope,
-                            XmlSchemaCollection xmlSchemas,
-                            XmlSchema xmlSchema,
-                            TypeMappingType typeMappingType) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+                            WSDLASTVisitor wsdlASTVisitor) {
+        super(scope, wsdlASTVisitor);
     }
 
     public static boolean accept(AST node) {
@@ -103,9 +98,7 @@
             AST memberNode = memberTypeNode.getNextSibling();
 
             TypesVisitor visitor = new TypesVisitor(exceptionScope,
-                                                    schemas,
-                                                    schema,
-                                                    typeMap,
+                                                    wsdlVisitor,
                                                     null);
             visitor.visit(memberTypeNode);
             XmlSchemaType stype = visitor.getSchemaType();
@@ -116,9 +109,7 @@
                 Scope anonScope = new Scope(exceptionScope, 
                                             TypesUtils.getCorbaTypeNameNode(memberTypeNode));
                 ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
-                                                             schemas,
-                                                             schema,
-                                                             typeMap,
+                                                             wsdlVisitor,
                                                              stype,
                                                              ctype,
                                                              null);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java Mon Mar  5 09:25:53 2007
@@ -24,10 +24,7 @@
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.Fixed;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaFractionDigitsFacet;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction;
@@ -39,11 +36,9 @@
     private AST identifierNode;
     
     public FixedVisitor(Scope scope,
-                        XmlSchemaCollection xmlSchemas,
-                        XmlSchema xmlSchema,
-                        TypeMappingType typeMappingType,
+                        WSDLASTVisitor wsdlVisitor,
                         AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+        super(scope, wsdlVisitor);
         identifierNode = identifierNodeRef;
     }
     

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java Mon Mar  5 09:25:53 2007
@@ -74,7 +74,9 @@
         parser.specification();
         AST idlTree = parser.getAST();
 
-        System.out.println(idlTree.toStringTree());
+        if (!env.isVerbose()) {
+            System.out.println(idlTree.toStringTree());
+        }
         
         Object obj = env.get(ToolConstants.CFG_OUTPUTDIR);
         String outputDir = ".";
@@ -89,6 +91,9 @@
 
         try {
             WSDLASTVisitor visitor = new WSDLASTVisitor(tns);
+            if (env.optionSet(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE)) {
+                visitor.setSequenceOctetType((String) env.get(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE));
+            }
             visitor.visit(idlTree);
             if (outputWriter == null) {
                 FileWriterUtil fw = new FileWriterUtil(outputDir);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ModuleVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ModuleVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ModuleVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ModuleVisitor.java Mon Mar  5 09:25:53 2007
@@ -19,26 +19,13 @@
 
 package org.apache.yoko.tools.processors.idl;
 
-import javax.wsdl.Definition;
-
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class ModuleVisitor extends VisitorBase {
-
-    private Definition definition;
     
     public ModuleVisitor(Scope scope,
-                         Definition wsdlDefinition,
-                         XmlSchemaCollection xmlSchemas,
-                         XmlSchema xmlSchema,
-                         TypeMappingType corbaTypeMap) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
-        definition = wsdlDefinition;
+                         WSDLASTVisitor wsdlASTVisitor) {
+        super(scope, wsdlASTVisitor);
     }
     
     public void visit(AST node) {
@@ -50,10 +37,7 @@
         while (definitionNode != null) {
             DefinitionVisitor definitionVisitor =
                 new DefinitionVisitor(new Scope(getScope(), identifierNode),
-                                      definition,
-                                      schemas,
-                                      schema,
-                                      typeMap);
+                                      wsdlVisitor);
 
             definitionVisitor.visit(definitionNode);
             

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java Mon Mar  5 09:25:53 2007
@@ -37,12 +37,10 @@
 
 import org.apache.schemas.yoko.bindings.corba.BindingType;
 import org.apache.schemas.yoko.bindings.corba.Object;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaAnnotation;
 import org.apache.ws.commons.schema.XmlSchemaAppInfo;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaImport;
 import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
@@ -58,12 +56,9 @@
     private Definition wsdlDefinition;
     
     public ObjectReferenceVisitor(Scope scope,
-                                  XmlSchemaCollection xmlSchemas,
-                                  XmlSchema xmlSchema,
-                                  TypeMappingType typeMappingType,
-                                  Definition wsdlDef) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
-        wsdlDefinition = wsdlDef;
+                                  WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
+        wsdlDefinition = wsdlVisitor.getDefinition();
     }
 
     public static boolean accept(AST node) {

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java Mon Mar  5 09:25:53 2007
@@ -77,14 +77,11 @@
     private OperationType corbaOperation;
     
     public OperationVisitor(Scope scope,
-                            XmlSchemaCollection xmlSchemas,
-                            XmlSchema xmlSchema,
-                            TypeMappingType typeMapRef,
-                            Definition wsdlDefinition,
+                            WSDLASTVisitor wsdlVisitor,
                             PortType wsdlPortType,
                             Binding wsdlBinding) {
-        super(scope, xmlSchemas, xmlSchema, typeMapRef);
-        definition = wsdlDefinition;
+        super(scope, wsdlVisitor);
+        definition = wsdlVisitor.getDefinition();
         extReg = definition.getExtensionRegistry();
         portType = wsdlPortType;
         binding = wsdlBinding;
@@ -159,16 +156,10 @@
         while (ParamDclVisitor.accept(node)) {
 
             ParamDclVisitor visitor = new ParamDclVisitor(getScope(),
-                                                          schemas,
-                                                          schema,
-                                                          typeMap,
+                                                          wsdlVisitor,
                                                           inputWrappingSequence,
                                                           outputWrappingSequence,
                                                           corbaOperation);
-            // need to provide the wsdl definition so that object references can be 
-            // constructed correctly
-            visitor.setWSDLDefinition(definition);
-
             visitor.visit(node);
 
             node = node.getNextSibling();
@@ -332,10 +323,7 @@
             return;
         } else {
             ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), 
-                                                                    schemas, 
-                                                                    schema, 
-                                                                    typeMap,
-                                                                    definition);
+                                                                    wsdlVisitor);
 
             visitor.visit(node);
             

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamDclVisitor.java Mon Mar  5 09:25:53 2007
@@ -19,17 +19,12 @@
 
 package org.apache.yoko.tools.processors.idl;
 
-import javax.wsdl.Definition;
-
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.ModeType;
 import org.apache.schemas.yoko.bindings.corba.OperationType;
 import org.apache.schemas.yoko.bindings.corba.ParamType;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
@@ -41,16 +36,13 @@
     private XmlSchemaSequence inWrappingSequence; 
     private XmlSchemaSequence outWrappingSequence;
     private OperationType corbaOperation;
-    private Definition wsdlDefinition;
     
     public ParamDclVisitor(Scope scope,
-                           XmlSchemaCollection xmlSchemas,
-                           XmlSchema xmlSchema,
-                           TypeMappingType corbaTypeMap,
+                           WSDLASTVisitor wsdlVisitor,
                            XmlSchemaSequence inWrapSeq,
                            XmlSchemaSequence outWrapSeq,
                            OperationType corbaOp) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+        super(scope, wsdlVisitor);
         inWrappingSequence = inWrapSeq;
         outWrappingSequence = outWrapSeq;
         corbaOperation = corbaOp;
@@ -77,10 +69,7 @@
         AST nameNode = TypesUtils.getCorbaTypeNameNode(typeNode);
         
         ParamTypeSpecVisitor visitor = new ParamTypeSpecVisitor(getScope(), 
-                                                                schemas, 
-                                                                schema, 
-                                                                typeMap,
-                                                                wsdlDefinition);
+                                                                wsdlVisitor);
         visitor.visit(typeNode);
         XmlSchemaType schemaType = visitor.getSchemaType();
         CorbaTypeImpl corbaType = visitor.getCorbaType();
@@ -113,12 +102,6 @@
         setCorbaType(corbaType);
     }
 
-    // need this to pass to our parameter type spec in the case of an 
-    // object refernce.
-    public void setWSDLDefinition(Definition wsdlDef) {
-        wsdlDefinition = wsdlDef;
-    }
-    
     private XmlSchemaElement addElement(XmlSchemaSequence schemaSequence,
                                         XmlSchemaType schemaType,
                                         String name,

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamTypeSpecVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamTypeSpecVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamTypeSpecVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ParamTypeSpecVisitor.java Mon Mar  5 09:25:53 2007
@@ -23,22 +23,14 @@
 
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class ParamTypeSpecVisitor extends VisitorBase {
 
     private Definition wsdlDefinition;
     
     public ParamTypeSpecVisitor(Scope scope,
-                                XmlSchemaCollection xmlSchemas,
-                                XmlSchema xmlSchema,
-                                TypeMappingType corbaTypeMap,
-                                Definition wsdlDef) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
-        wsdlDefinition = wsdlDef;
+                                WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
+        wsdlDefinition = wsdlVisitor.getDefinition();
     }
 
     public void visit(AST node) {
@@ -58,15 +50,15 @@
         } else if (StringVisitor.accept(node)) {
             // string_type_spec
             // wstring_type_spec
-            visitor = new StringVisitor(getScope(), schemas, schema, typeMap, null);
+            visitor = new StringVisitor(getScope(), wsdlVisitor, null);
 
         } else if (ScopedNameVisitor.accept(getScope(), schemas, schema, typeMap, node)) {
             // scoped_name
-            visitor = new ScopedNameVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new ScopedNameVisitor(getScope(), wsdlVisitor);
         
         } else if (ObjectReferenceVisitor.accept(node)) {
             // an object reference
-            visitor = new ObjectReferenceVisitor(getScope(), schemas, schema, typeMap, wsdlDefinition);
+            visitor = new ObjectReferenceVisitor(getScope(), wsdlVisitor);
             
         } else {
             System.out.println("[ParamTypeSpecVisitor] Invalid IDL: unknown element " + node.toString());

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java Mon Mar  5 09:25:53 2007
@@ -33,10 +33,6 @@
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.BindingType;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 
 import org.apache.yoko.wsdl.CorbaConstants;
 
@@ -45,16 +41,12 @@
     Definition definition;
     ExtensionRegistry extReg;
     PortType portType;
-    WSDLASTVisitor wsdlASTVisitor;
     String module;
 
     public PortTypeVisitor(Scope scope,
-                           XmlSchemaCollection xmlSchemas,
-                           XmlSchema xmlSchema,
-                           TypeMappingType corbaTypeMap,
-                           Definition wsdlDefinition) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
-        definition = wsdlDefinition;
+                           WSDLASTVisitor wsdlASTVisitor) {
+        super(scope, wsdlASTVisitor);
+        definition = wsdlVisitor.getDefinition();
         extReg = definition.getExtensionRegistry();
     }
 
@@ -99,37 +91,25 @@
             
             if (TypeDclVisitor.accept(exportNode)) {
                 TypeDclVisitor visitor = new TypeDclVisitor(interfaceScope,
-                                                            schemas,
-                                                            schema,
-                                                            typeMap);
+                                                            wsdlVisitor);
                 visitor.visit(exportNode);
             } else if (ConstVisitor.accept(exportNode)) {
                 ConstVisitor visitor = new ConstVisitor(interfaceScope,
-                                                        schemas,
-                                                        schema,
-                                                        typeMap);
+                                                        wsdlVisitor);
                 visitor.visit(exportNode);
             } else if (ExceptionVisitor.accept(exportNode)) {
                 ExceptionVisitor visitor = new ExceptionVisitor(interfaceScope,
-                                                                schemas,
-                                                                schema,
-                                                                typeMap);
+                                                                wsdlVisitor);
                 visitor.visit(exportNode);
             } else if (AttributeVisitor.accept(exportNode)) {
                 AttributeVisitor attributeVisitor = new AttributeVisitor(interfaceScope,
-                                                                         schemas,
-                                                                         schema,
-                                                                         typeMap,
-                                                                         definition,
+                                                                         wsdlVisitor,
                                                                          portType,
                                                                          binding);
                 attributeVisitor.visit(exportNode);                
             } else if (OperationVisitor.accept(interfaceScope, schemas, schema, typeMap, exportNode)) {
                 OperationVisitor visitor = new OperationVisitor(interfaceScope,
-                                                                schemas,
-                                                                schema,
-                                                                typeMap,
-                                                                definition,
+                                                                wsdlVisitor,
                                                                 portType,
                                                                 binding);
                 visitor.visit(exportNode);                     

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java Mon Mar  5 09:25:53 2007
@@ -39,10 +39,8 @@
 public class ScopedNameVisitor extends VisitorBase {
 
     public ScopedNameVisitor(Scope scope,
-                             XmlSchemaCollection xmlSchemas,
-                             XmlSchema xmlSchema,
-                             TypeMappingType corbaTypeMap) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+                             WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
     
     public static boolean accept(Scope scope,

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java Mon Mar  5 09:25:53 2007
@@ -25,17 +25,12 @@
 
 import org.apache.schemas.yoko.bindings.corba.Anonsequence;
 import org.apache.schemas.yoko.bindings.corba.Sequence;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
-import org.apache.ws.commons.schema.constants.Constants;
-
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 
 public class SequenceVisitor extends VisitorBase {
@@ -43,11 +38,9 @@
     private AST identifierNode;
     
     public SequenceVisitor(Scope scope,
-                           XmlSchemaCollection xmlSchemas,
-                           XmlSchema xmlSchema,
-                           TypeMappingType typeMapRef,
+                           WSDLASTVisitor wsdlVisitor,
                            AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, typeMapRef);
+        super(scope, wsdlVisitor);
         identifierNode = identifierNodeRef;
     }
     
@@ -70,9 +63,7 @@
 
         
         SimpleTypeSpecVisitor visitor = new SimpleTypeSpecVisitor(new Scope(getScope(), identifierNode),
-                                                                  schemas,
-                                                                  schema,
-                                                                  typeMap,
+                                                                  wsdlVisitor,
                                                                   null);
         visitor.visit(simpleTypeSpecNode);
         
@@ -94,12 +85,17 @@
         }
 
         XmlSchemaType schemaType = null;
-        if (stype != schemas.getTypeByQName(Constants.XSD_UNSIGNEDBYTE)) {
+        if (simpleTypeSpecNode.getType() != IDLTokenTypes.LITERAL_octet) {
             schemaType = generateSchemaType(stype, scopedName, bound);
         } else {
             // According to CORBA Binding for WSDL specification,
             // idl:sequence<octet> maps to xs:base64Binary by default.
-            schemaType = schemas.getTypeByQName(Constants.XSD_BASE64);
+            // 
+            // wsdlVisitor.getSequenceOctetType() returns the XmlSchema type
+            // that idl:sequence<octet> should map to, as specified by the 
+            // -s command line option or the default type xsd:base64Binary.
+            //
+            schemaType = wsdlVisitor.getSequenceOctetType();
         }
         
         CorbaTypeImpl corbaType = null;

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SimpleTypeSpecVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SimpleTypeSpecVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SimpleTypeSpecVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SimpleTypeSpecVisitor.java Mon Mar  5 09:25:53 2007
@@ -21,21 +21,14 @@
 
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class SimpleTypeSpecVisitor extends VisitorBase {
 
     private AST identifierNode;
     
     public SimpleTypeSpecVisitor(Scope scope,
-                                 XmlSchemaCollection xmlSchemas,
-                                 XmlSchema xmlSchema,
-                                 TypeMappingType corbaTypeMap,
+                                 WSDLASTVisitor wsdlVisitor,
                                  AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+        super(scope, wsdlVisitor);
         identifierNode = identifierNodeRef;
     }
 
@@ -61,11 +54,11 @@
             
         } else if (TemplateTypeSpecVisitor.accept(node)) {
             // simple_type_spec - template_type_spec
-            visitor = new TemplateTypeSpecVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+            visitor = new TemplateTypeSpecVisitor(getScope(), wsdlVisitor, identifierNode);
 
         } else if (ScopedNameVisitor.accept(getScope(), schemas, schema, typeMap, node)) {
             // simple_type_spec - scoped_name
-            visitor = new ScopedNameVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new ScopedNameVisitor(getScope(), wsdlVisitor);
         
         }
         

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StringVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StringVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StringVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StringVisitor.java Mon Mar  5 09:25:53 2007
@@ -26,10 +26,7 @@
 import org.apache.schemas.yoko.bindings.corba.Alias;
 import org.apache.schemas.yoko.bindings.corba.Anonstring;
 import org.apache.schemas.yoko.bindings.corba.Anonwstring;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaMaxLengthFacet;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction;
@@ -48,11 +45,9 @@
 
     
     public StringVisitor(Scope scope,
-                         XmlSchemaCollection xmlSchemas,
-                         XmlSchema xmlSchema,
-                         TypeMappingType typeMappingType,
+                         WSDLASTVisitor wsdlVisitor,
                          AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+        super(scope, wsdlVisitor);
         stringNode = null;
         boundNode = null;
         identifierNode = identifierNodeRef;

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java Mon Mar  5 09:25:53 2007
@@ -25,10 +25,7 @@
 
 import org.apache.schemas.yoko.bindings.corba.MemberType;
 import org.apache.schemas.yoko.bindings.corba.Struct;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
@@ -39,10 +36,8 @@
 public class StructVisitor extends VisitorBase {
     
     public StructVisitor(Scope scope,
-                         XmlSchemaCollection xmlSchemas,
-                         XmlSchema xmlSchema,
-                         TypeMappingType typeMappingType) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+                         WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
 
     public static boolean accept(AST node) {
@@ -84,9 +79,7 @@
             CorbaTypeImpl corbaType = null;
             try {
                 TypesVisitor visitor = new TypesVisitor(structScope, 
-                                                        schemas,
-                                                        schema,
-                                                        typeMap,
+                                                        wsdlVisitor,
                                                         null);
                 visitor.visit(memberTypeNode);
                 
@@ -103,9 +96,7 @@
                 Scope anonScope = new Scope(structScope,
                                             TypesUtils.getCorbaTypeNameNode(memberTypeNode));
                 ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
-                                                             schemas,
-                                                             schema,
-                                                             typeMap,
+                                                             wsdlVisitor,
                                                              schemaType,
                                                              corbaType,
                                                              null);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TemplateTypeSpecVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TemplateTypeSpecVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TemplateTypeSpecVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TemplateTypeSpecVisitor.java Mon Mar  5 09:25:53 2007
@@ -21,21 +21,14 @@
 
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class TemplateTypeSpecVisitor extends VisitorBase {
     
     private AST identifierNode;
     
     public TemplateTypeSpecVisitor(Scope scope,
-                                   XmlSchemaCollection xmlSchemas,
-                                   XmlSchema xmlSchema,
-                                   TypeMappingType corbaTypeMap,
+                                   WSDLASTVisitor wsdlVisitor,
                                    AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+        super(scope, wsdlVisitor);
         identifierNode = identifierNodeRef;
     }
 
@@ -58,14 +51,14 @@
         
         if (SequenceVisitor.accept(node)) {
             // <sequence_type>
-            visitor = new SequenceVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+            visitor = new SequenceVisitor(getScope(), wsdlVisitor, identifierNode);
         } else if (StringVisitor.accept(node)) {
             // <string_type>
             // <wstring_type>
-            visitor = new StringVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+            visitor = new StringVisitor(getScope(), wsdlVisitor, identifierNode);
         } else if (FixedVisitor.accept(node)) {
             // <fixed_pt_type>
-            visitor = new FixedVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+            visitor = new FixedVisitor(getScope(), wsdlVisitor, identifierNode);
         }
 
         visitor.visit(node);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypeDclVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypeDclVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypeDclVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypeDclVisitor.java Mon Mar  5 09:25:53 2007
@@ -21,18 +21,11 @@
 
 import antlr.collections.AST;
 
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
-
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-
 public class TypeDclVisitor extends VisitorBase {
     
     public TypeDclVisitor(Scope scope,
-                          XmlSchemaCollection xmlSchemas,
-                          XmlSchema xmlSchema,
-                          TypeMappingType corbaTypeMap) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+                          WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
     
     public static boolean accept(AST node) {
@@ -56,16 +49,16 @@
         
         if (TypedefVisitor.accept(node)) {
             // "typedef" <type_declarator>
-            visitor = new TypedefVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new TypedefVisitor(getScope(), wsdlVisitor);
         } else if (StructVisitor.accept(node)) {
             // <struct_type>
-            visitor = new StructVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new StructVisitor(getScope(), wsdlVisitor);
         } else if (UnionVisitor.accept(node)) {
             // <union_type>
-            visitor = new UnionVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new UnionVisitor(getScope(), wsdlVisitor);
         } else if (EnumVisitor.accept(node)) {
             // <enum_type>
-            visitor = new EnumVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new EnumVisitor(getScope(), wsdlVisitor);
         } else if (node.getType() == IDLTokenTypes.LITERAL_native) {
             // "native" <simple_declarator>
             //

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypedefVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypedefVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypedefVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypedefVisitor.java Mon Mar  5 09:25:53 2007
@@ -24,10 +24,7 @@
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.Alias;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction;
 import org.apache.ws.commons.schema.XmlSchemaType;
@@ -39,10 +36,8 @@
 public class TypedefVisitor extends VisitorBase {
     
     public TypedefVisitor(Scope scope,
-                          XmlSchemaCollection xmlSchemas,
-                          XmlSchema xmlSchema,
-                          TypeMappingType typeMappingType) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+                          WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
     
     public static boolean accept(AST node) {
@@ -59,7 +54,7 @@
         AST typeDeclaratorNode = typedefNode.getFirstChild();
         AST identifierNode = TypesUtils.getCorbaTypeNameNode(typeDeclaratorNode);
         
-        TypesVisitor typesVisitor = new TypesVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+        TypesVisitor typesVisitor = new TypesVisitor(getScope(), wsdlVisitor, identifierNode);
         typesVisitor.visit(typeDeclaratorNode);
 
         XmlSchemaType schemaType = typesVisitor.getSchemaType();
@@ -72,9 +67,7 @@
             // Handle cases "typedef sequence"
             //              "typedef fixed"
             DeclaratorVisitor declaratorVisitor = new DeclaratorVisitor(typedefScope,
-                                                                        schemas,
-                                                                        schema,
-                                                                        typeMap,
+                                                                        wsdlVisitor,
                                                                         schemaType,
                                                                         corbaType);
             declaratorVisitor.visit(identifierNode);
@@ -85,9 +78,7 @@
 
             if (StringVisitor.isBounded(typeDeclaratorNode)) {
                 DeclaratorVisitor declaratorVisitor = new DeclaratorVisitor(typedefScope,
-                                                                            schemas,
-                                                                            schema,
-                                                                            typeMap,
+                                                                            wsdlVisitor,
                                                                             schemaType,
                                                                             corbaType);
                 declaratorVisitor.visit(identifierNode);
@@ -132,9 +123,7 @@
             }
             
             DeclaratorVisitor declaratorVisitor = new DeclaratorVisitor(typedefScope,
-                                                                        schemas,
-                                                                        schema,
-                                                                        typeMap,
+                                                                        wsdlVisitor,
                                                                         schemaType,
                                                                         corbaType);
             declaratorVisitor.visit(identifierNode);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java Mon Mar  5 09:25:53 2007
@@ -22,10 +22,7 @@
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.ArgType;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaObject;
 
 public class TypesVisitor extends VisitorBase {
@@ -40,11 +37,9 @@
 
     // identifierNode null if anonymous type
     public TypesVisitor(Scope scope,
-                        XmlSchemaCollection xmlSchemas,
-                        XmlSchema xmlSchema,
-                        TypeMappingType corbaTypeMap,
+                        WSDLASTVisitor wsdlVisitor,
                         AST identifierNodeRef) {
-        super(scope, xmlSchemas, xmlSchema, corbaTypeMap);
+        super(scope, wsdlVisitor);
         identifierNode = identifierNodeRef;
     }
 
@@ -57,10 +52,10 @@
         
         if (ConstrTypeSpecVisitor.accept(node)) {
             // type_spec - constr_type_spec
-            visitor = new ConstrTypeSpecVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+            visitor = new ConstrTypeSpecVisitor(getScope(), wsdlVisitor, identifierNode);
         } else if (SimpleTypeSpecVisitor.accept(node)) {
             // type_spec - simple_type_spec
-            visitor = new SimpleTypeSpecVisitor(getScope(), schemas, schema, typeMap, identifierNode);
+            visitor = new SimpleTypeSpecVisitor(getScope(), wsdlVisitor, identifierNode);
         } else if (visitor == null) {
             // REVISIT: !!!!!
             // This is ugly. It should be done in the SimpleTypeSpecVisitor.accept(node) method.
@@ -74,7 +69,7 @@
             // To work around that redesign and get things working now, I am assuming that if visitor
             // is null at this point, then it has to be a scoped_name.
             // REVISIT!!!
-            visitor = new ScopedNameVisitor(getScope(), schemas, schema, typeMap);
+            visitor = new ScopedNameVisitor(getScope(), wsdlVisitor);
         }
         
         visitor.visit(node);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java Mon Mar  5 09:25:53 2007
@@ -24,13 +24,10 @@
 import antlr.collections.AST;
 
 import org.apache.schemas.yoko.bindings.corba.CaseType;
-import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 import org.apache.schemas.yoko.bindings.corba.Union;
 import org.apache.schemas.yoko.bindings.corba.Unionbranch;
 
-import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaChoice;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
@@ -43,10 +40,8 @@
     private final String discriminator = "discriminator";
     
     public UnionVisitor(Scope scope,
-                        XmlSchemaCollection xmlSchemas,
-                        XmlSchema xmlSchema,
-                        TypeMappingType typeMappingType) {
-        super(scope, xmlSchemas, xmlSchema, typeMappingType);
+                        WSDLASTVisitor wsdlVisitor) {
+        super(scope, wsdlVisitor);
     }
     
     public static boolean accept(AST node) {
@@ -86,7 +81,7 @@
         // TEMPORARILY 
         // using TypesVisitor to visit <const_type>
         // it should be visited by a SwitchTypeSpecVisitor
-        TypesVisitor visitor = new TypesVisitor(getScope(), schemas, schema, typeMap, null);
+        TypesVisitor visitor = new TypesVisitor(getScope(), wsdlVisitor, null);
         visitor.visit(discriminatorNode);
         XmlSchemaType stype = visitor.getSchemaType();
         CorbaTypeImpl ctype = visitor.getCorbaType();
@@ -161,9 +156,7 @@
             
 
             TypesVisitor visitor = new TypesVisitor(scope,
-                                                    schemas,
-                                                    schema,
-                                                    typeMap,
+                                                    wsdlVisitor,
                                                     null);
             visitor.visit(typeNode);
             XmlSchemaType stype = visitor.getSchemaType();
@@ -174,9 +167,7 @@
             if (ArrayVisitor.accept(nameNode)) {
                 Scope anonScope = new Scope(scope, TypesUtils.getCorbaTypeNameNode(nameNode));
                 ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
-                                                             schemas,
-                                                             schema,
-                                                             typeMap,
+                                                             wsdlVisitor,
                                                              stype,
                                                              ctype,
                                                              null);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/VisitorBase.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/VisitorBase.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/VisitorBase.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/VisitorBase.java Mon Mar  5 09:25:53 2007
@@ -29,6 +29,7 @@
 
 public abstract class VisitorBase implements Visitor {
 
+    protected WSDLASTVisitor wsdlVisitor;
     protected XmlSchema schema;
     protected XmlSchemaCollection schemas;
     protected TypeMappingType typeMap;
@@ -38,12 +39,11 @@
     private Scope scope;
     
     public VisitorBase(Scope scopeRef,
-                       XmlSchemaCollection xmlSchemas,
-                       XmlSchema xmlSchema,
-                       TypeMappingType typeMapRef) {
-        schemas = xmlSchemas;
-        schema = xmlSchema;
-        typeMap = typeMapRef;
+                       WSDLASTVisitor wsdlASTVisitor) {
+        wsdlVisitor = wsdlASTVisitor;
+        schemas = wsdlVisitor.getSchemas();
+        schema = wsdlVisitor.getSchema();
+        typeMap = wsdlVisitor.getTypeMap();
         
         scope = scopeRef; 
         

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java?view=diff&rev=514743&r1=514742&r2=514743
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java Mon Mar  5 09:25:53 2007
@@ -42,6 +42,7 @@
 import antlr.ASTVisitor;
 import antlr.collections.AST;
 
+import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.WSDLConstants;
 import org.apache.cxf.wsdl.JAXBExtensionHelper;
 
@@ -57,6 +58,7 @@
 import org.apache.ws.commons.schema.constants.Constants;
 import org.apache.ws.commons.schema.utils.NamespaceMap;
 
+import org.apache.yoko.tools.common.ToolCorbaConstants;
 import org.apache.yoko.tools.common.WSDLUtils;
 import org.apache.yoko.wsdl.CorbaConstants;
 
@@ -70,6 +72,8 @@
     
     TypeMappingType typeMap;
 
+    XmlSchemaType sequenceOctetType;
+    
     public WSDLASTVisitor(String tns)
         throws WSDLException, JAXBException {
         
@@ -81,6 +85,9 @@
         addAnyType();
         
         createCorbaTypeMap();
+        
+        // idl:sequence<octet> maps to xsd:base64Binary by default
+        sequenceOctetType = schemas.getTypeByQName(Constants.XSD_BASE64);
     }
 
     public void visit(AST node) {
@@ -88,10 +95,7 @@
 
         while (node != null) {
             DefinitionVisitor definitionVisitor = new DefinitionVisitor(new Scope(),
-                                                                        definition,
-                                                                        schemas,
-                                                                        schema,
-                                                                        typeMap);
+                                                                        this);
             definitionVisitor.visit(node);
 
             node = node.getNextSibling();
@@ -111,7 +115,36 @@
     public WSDLFactory getFactory() {
         return wsdlFactory;
     }
-
+    
+    public XmlSchema getSchema() {
+        return schema;
+    }
+    
+    public XmlSchemaCollection getSchemas() {
+        return schemas;
+    }
+    
+    public TypeMappingType getTypeMap() {
+        return typeMap;
+    }
+    
+    public XmlSchemaType getSequenceOctetType() {
+        return sequenceOctetType;
+    }
+    
+    public void setSequenceOctetType(String type) throws Exception {
+        XmlSchemaType stype = null;
+        if (type.equals(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_BASE64BINARY)) {
+            stype = schemas.getTypeByQName(Constants.XSD_BASE64);
+        } else if (type.equals(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_HEXBINARY)) {
+            stype = schemas.getTypeByQName(Constants.XSD_HEXBIN);
+        } else {
+            throw new ToolException("WSDLASTVisitor: Invalid XmlSchemaType specified " 
+                                    + "for idl:sequence<octet> mapping.");
+        }
+        sequenceOctetType = stype;
+    }
+    
     public Binding[] getCorbaBindings() {
         List<Binding> result = new ArrayList<Binding>();
         Map bindings = definition.getBindings();



Mime
View raw message