/** * * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tuscany.tools.wsdl2java.generate; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.apache.axis2.description.AxisMessage; import org.apache.axis2.description.AxisOperation; import org.apache.axis2.util.FileWriter; import org.apache.axis2.wsdl.WSDLConstants; import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; import org.apache.axis2.wsdl.codegen.emitter.JavaEmitter; import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter; import org.apache.axis2.wsdl.databinding.TypeMapper; import org.apache.tuscany.model.util.XMLNameUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; /** * Overrides the Axis2 JavaEmitter to generate unwrapped methods. */ public class JavaInterfaceEmitter extends JavaEmitter { private CodeGenConfiguration codegenConfiguration; private TypeMapper typeMapper; public void setCodeGenConfiguration(CodeGenConfiguration configuration) { super.setCodeGenConfiguration(configuration); codegenConfiguration=configuration; } public void setMapper(TypeMapper typeMapper) { super.setMapper(typeMapper); this.typeMapper = typeMapper; } private List getParameterElementList(Document doc, AxisMessage message, boolean wrapped) { List parameterElementList = new ArrayList(); if (message != null && message.getElementQName()!=null) { SDODataBindingTypeMappingEntry typeMappingEntry = (SDODataBindingTypeMappingEntry)this.typeMapper.getTypeMappingObject(message.getElementQName()); List typeMappings; if (wrapped) { typeMappings = (List)typeMappingEntry.getPropertyClassNames(); } else { typeMappings = new ArrayList(); typeMappings.add(typeMappingEntry.getClassName()); } for (int i=0; i> Generating Java class " + packageName + "." + className); File outputFile = FileWriter.createClassFile(this.codegenConfiguration.getOutputLocation(), packageName, className, ".java"); if (outputFile.exists()) { outputFile.delete(); } writeClass(interfaceModel, interfaceWriter); } protected String makeJavaClassName(String word) { return XMLNameUtil.getJavaNameFromXMLName(word, true); } }