You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/22 04:38:43 UTC
svn commit: r358474 [2/3] - in
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2: rpc/
rpc/client/ rpc/receivers/ schema/ schema/typemap/ schema/util/
schema/writer/ util/ wsdl/codegen/ wsdl/codegen/emitter/
wsdl/codegen/extension/ wsd...
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Wed Dec 21 19:38:20 2005
@@ -20,7 +20,11 @@
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -44,9 +48,9 @@
/**
* Java Bean writer for the schema compiler.
*/
-public class JavaBeanWriter implements BeanWriter{
+public class JavaBeanWriter implements BeanWriter {
- public static final String WRAPPED_DATABINDING_CLASS_NAME="WrappedDatabinder";
+ public static final String WRAPPED_DATABINDING_CLASS_NAME = "WrappedDatabinder";
private String javaBeanTemplateName = null;
private boolean templateLoaded = false;
@@ -56,14 +60,15 @@
private static int count = 0;
private boolean wrapClasses;
- private String packageName=null;
+ private String packageName = null;
private File rootDir;
private Document globalWrappedDocument;
+
/**
* Default constructor
*/
- public JavaBeanWriter(){
+ public JavaBeanWriter() {
}
public void init(CompilerOptions options) throws SchemaCompilationException {
@@ -74,17 +79,17 @@
//if the wrap mode is set then create a global document to keep the wrapped
//element models
- if (options.isWrapClasses()){
+ if (options.isWrapClasses()) {
globalWrappedDocument = XSLTUtils.getDocument();
- Element rootElement = XSLTUtils.getElement(globalWrappedDocument,"beans");
+ Element rootElement = XSLTUtils.getElement(globalWrappedDocument, "beans");
globalWrappedDocument.appendChild(rootElement);
- XSLTUtils.addAttribute(globalWrappedDocument,"name",WRAPPED_DATABINDING_CLASS_NAME,rootElement);
+ XSLTUtils.addAttribute(globalWrappedDocument, "name", WRAPPED_DATABINDING_CLASS_NAME, rootElement);
String tempPackageName = null;
- if (packageName.endsWith(".")){
- tempPackageName = this.packageName.substring(0, this.packageName.lastIndexOf("."));
+ if (packageName.endsWith(".")) {
+ tempPackageName = this.packageName.substring(0, this.packageName.lastIndexOf("."));
}
- XSLTUtils.addAttribute(globalWrappedDocument,"package",tempPackageName,rootElement);
+ XSLTUtils.addAttribute(globalWrappedDocument, "package", tempPackageName, rootElement);
}
} catch (IOException e) {
throw new SchemaCompilationException(e);
@@ -94,14 +99,13 @@
}
/**
- *
* @param element
* @param typeMap
* @param metainf
* @return
* @throws SchemaCompilationException
*/
- public String write(XmlSchemaElement element, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException{
+ public String write(XmlSchemaElement element, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
try {
QName qName = element.getQName();
@@ -112,12 +116,14 @@
}
+
/**
- * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaComplexType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
* @param complexType
* @param typeMap
* @param metainf
* @throws org.apache.axis2.schema.SchemaCompilationException
+ *
+ * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaComplexType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
*/
public String write(XmlSchemaComplexType complexType, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
@@ -126,9 +132,9 @@
QName qName = complexType.getQName();
return process(qName, metainf, typeMap, false);
- }catch (SchemaCompilationException e) {
+ } catch (SchemaCompilationException e) {
throw e;
- }catch (Exception e) {
+ } catch (Exception e) {
throw new SchemaCompilationException(e);
}
@@ -136,16 +142,16 @@
}
/**
- * @see org.apache.axis2.schema.writer.BeanWriter#writeBatch()
* @throws Exception
+ * @see BeanWriter#writeBatch()
*/
- public void writeBatch() throws SchemaCompilationException{
+ public void writeBatch() throws SchemaCompilationException {
try {
- if (wrapClasses){
+ if (wrapClasses) {
- OutputStream out = createOutFile(packageName,WRAPPED_DATABINDING_CLASS_NAME);
+ OutputStream out = createOutFile(packageName, WRAPPED_DATABINDING_CLASS_NAME);
//parse with the template and create the files
- parse(globalWrappedDocument,out);
+ parse(globalWrappedDocument, out);
}
} catch (Exception e) {
throw new SchemaCompilationException(e);
@@ -153,27 +159,28 @@
}
/**
- * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaSimpleType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
* @param simpleType
* @param typeMap
* @param metainf
* @return
* @throws SchemaCompilationException
+ * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaSimpleType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
*/
public String write(XmlSchemaSimpleType simpleType, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
throw new SchemaCompilationException("Not implemented yet");
}
+
/**
- * @see BeanWriter#init(java.io.File)
* @param rootDir
* @throws IOException
+ * @see BeanWriter#init(java.io.File)
*/
- private void initWithFile(File rootDir) throws IOException{
- if (rootDir ==null){
+ private void initWithFile(File rootDir) throws IOException {
+ if (rootDir == null) {
this.rootDir = new File(".");
- }else if (!rootDir.isDirectory()){
+ } else if (!rootDir.isDirectory()) {
throw new IOException("Root location needs to be a directory!");
- } else{
+ } else {
this.rootDir = rootDir;
}
@@ -182,11 +189,11 @@
}
-
/**
* A util method that holds common code
* for the complete schema that the generated XML complies to
* look under other/beanGenerationSchema.xsd
+ *
* @param qName
* @param metainf
* @param typeMap
@@ -198,36 +205,36 @@
String nameSpaceFromURL = URLProcessor.getNameSpaceFromURL(qName.getNamespaceURI());
- String packageName = this.packageName==null?
+ String packageName = this.packageName == null ?
nameSpaceFromURL :
- this.packageName +nameSpaceFromURL;
+ this.packageName + nameSpaceFromURL;
String originalName = qName.getLocalPart();
- String className = getNonConflictingName(this.namesList,originalName);
+ String className = getNonConflictingName(this.namesList, originalName);
String fullyqualifiedClassName = null;
ArrayList propertyNames = new ArrayList();
- if (!templateLoaded){
+ if (!templateLoaded) {
loadTemplate();
}
//if wrapped then do not write the classes now but add the models to a global document. However in order to write the
//global class that is generated, one needs to call the writeBatch() method
- if (wrapClasses){
+ if (wrapClasses) {
globalWrappedDocument.getDocumentElement().appendChild(
getBeanElement(globalWrappedDocument, className, originalName, packageName, qName, isElement, metainf, propertyNames, typeMap)
);
//now the fully qualified class name needs to have the name of the including class as well
- fullyqualifiedClassName = (this.packageName==null?"":this.packageName)+ WRAPPED_DATABINDING_CLASS_NAME +"." + className;
- }else{
+ fullyqualifiedClassName = (this.packageName == null ? "" : this.packageName) + WRAPPED_DATABINDING_CLASS_NAME + "." + className;
+ } else {
//create the model
- Document model= XSLTUtils.getDocument();
+ Document model = XSLTUtils.getDocument();
//make the XML
model.appendChild(getBeanElement(model, className, originalName, packageName, qName, isElement, metainf, propertyNames, typeMap));
//create the file
- OutputStream out = createOutFile(packageName,className);
+ OutputStream out = createOutFile(packageName, className);
//parse with the template and create the files
- parse(model,out);
+ parse(model, out);
fullyqualifiedClassName = packageName + "." + className;
}
@@ -237,10 +244,7 @@
}
-
-
/**
- *
* @param model
* @param className
* @param originalName
@@ -259,102 +263,102 @@
BeanWriterMetaInfoHolder metainf, ArrayList propertyNames, Map typeMap
) throws SchemaCompilationException {
- Element rootElt = XSLTUtils.getElement(model,"bean");
- XSLTUtils.addAttribute(model,"name",className,rootElt);
- XSLTUtils.addAttribute(model,"originalName",originalName,rootElt);
- XSLTUtils.addAttribute(model,"package",packageName,rootElt);
- XSLTUtils.addAttribute(model,"nsuri",qName.getNamespaceURI(),rootElt);
- XSLTUtils.addAttribute(model,"nsprefix",qName.getPrefix(),rootElt);
+ Element rootElt = XSLTUtils.getElement(model, "bean");
+ XSLTUtils.addAttribute(model, "name", className, rootElt);
+ XSLTUtils.addAttribute(model, "originalName", originalName, rootElt);
+ XSLTUtils.addAttribute(model, "package", packageName, rootElt);
+ XSLTUtils.addAttribute(model, "nsuri", qName.getNamespaceURI(), rootElt);
+ XSLTUtils.addAttribute(model, "nsprefix", qName.getPrefix(), rootElt);
- if (!wrapClasses){
- XSLTUtils.addAttribute(model,"unwrapped","yes",rootElt);
+ if (!wrapClasses) {
+ XSLTUtils.addAttribute(model, "unwrapped", "yes", rootElt);
}
- if (!isElement){
- XSLTUtils.addAttribute(model,"type","yes",rootElt);
+ if (!isElement) {
+ XSLTUtils.addAttribute(model, "type", "yes", rootElt);
}
- if (metainf.isAnonymous()){
- XSLTUtils.addAttribute(model,"anon","yes",rootElt);
+ if (metainf.isAnonymous()) {
+ XSLTUtils.addAttribute(model, "anon", "yes", rootElt);
}
- if (metainf.isExtension()){
- XSLTUtils.addAttribute(model,"extension",metainf.getExtensionClassName(),rootElt);
+ if (metainf.isExtension()) {
+ XSLTUtils.addAttribute(model, "extension", metainf.getExtensionClassName(), rootElt);
}
// go in the loop and add the part elements
QName[] qNames;
- if (metainf.isOrdered()){
+ if (metainf.isOrdered()) {
qNames = metainf.getOrderedQNameArray();
- }else{
+ } else {
qNames = metainf.getQNameArray();
}
QName name;
for (int i = 0; i < qNames.length; i++) {
- Element property = XSLTUtils.addChildElement(model,"property",rootElt);
+ Element property = XSLTUtils.addChildElement(model, "property", rootElt);
name = qNames[i];
String xmlName = name.getLocalPart();
- XSLTUtils.addAttribute(model,"name",xmlName,property);
+ XSLTUtils.addAttribute(model, "name", xmlName, property);
String javaName;
- if (JavaUtils.isJavaKeyword(xmlName)){
+ if (JavaUtils.isJavaKeyword(xmlName)) {
javaName = JavaUtils.makeNonJavaKeyword(xmlName);
- }else{
- javaName = JavaUtils.xmlNameToJava(xmlName,false);
+ } else {
+ javaName = JavaUtils.xmlNameToJava(xmlName, false);
}
- javaName = getNonConflictingName(propertyNames,javaName);
- XSLTUtils.addAttribute(model,"name",xmlName,property);
- XSLTUtils.addAttribute(model,"javaname",javaName,property);
+ javaName = getNonConflictingName(propertyNames, javaName);
+ XSLTUtils.addAttribute(model, "name", xmlName, property);
+ XSLTUtils.addAttribute(model, "javaname", javaName, property);
String javaClassNameForElement = metainf.getClassNameForQName(name);
String shortTypeName = "";
- if (metainf.getSchemaQNameForQName(name)!=null){
+ if (metainf.getSchemaQNameForQName(name) != null) {
shortTypeName = metainf.getSchemaQNameForQName(name).getLocalPart();
}
- if (javaClassNameForElement==null){
+ if (javaClassNameForElement == null) {
throw new SchemaCompilationException("Type missing!");
}
- XSLTUtils.addAttribute(model,"type",javaClassNameForElement,property);
- if (typeMap.containsKey(metainf.getSchemaQNameForQName(name))){
- XSLTUtils.addAttribute(model,"ours","yes",property); //todo introduce a better name for this
+ XSLTUtils.addAttribute(model, "type", javaClassNameForElement, property);
+ if (typeMap.containsKey(metainf.getSchemaQNameForQName(name))) {
+ XSLTUtils.addAttribute(model, "ours", "yes", property); //todo introduce a better name for this
}
- if (metainf.getAttributeStatusForQName(name)){
- XSLTUtils.addAttribute(model,"attribute","yes",property);
+ if (metainf.getAttributeStatusForQName(name)) {
+ XSLTUtils.addAttribute(model, "attribute", "yes", property);
}
- XSLTUtils.addAttribute(model,"shorttypename",shortTypeName,property);
+ XSLTUtils.addAttribute(model, "shorttypename", shortTypeName, property);
- if (metainf.getAnyStatusForQName(name)){
- XSLTUtils.addAttribute(model,"any","yes",property);
+ if (metainf.getAnyStatusForQName(name)) {
+ XSLTUtils.addAttribute(model, "any", "yes", property);
}
- if (metainf.getAnyAttributeStatusForQName(name)){
- XSLTUtils.addAttribute(model,"anyAtt","yes",property);
+ if (metainf.getAnyAttributeStatusForQName(name)) {
+ XSLTUtils.addAttribute(model, "anyAtt", "yes", property);
}
- if (metainf.getArrayStatusForQName(name)){
+ if (metainf.getArrayStatusForQName(name)) {
- XSLTUtils.addAttribute(model,"array","yes",property);
+ XSLTUtils.addAttribute(model, "array", "yes", property);
XSLTUtils.addAttribute(
model,
"arrayBaseType",
- javaClassNameForElement.substring(0,javaClassNameForElement.indexOf("[")),
+ javaClassNameForElement.substring(0, javaClassNameForElement.indexOf("[")),
property);
long minOccurs = metainf.getMinOccurs(name);
- if (minOccurs >0){
- XSLTUtils.addAttribute(model,"minOccurs",minOccurs +"",property);
+ if (minOccurs > 0) {
+ XSLTUtils.addAttribute(model, "minOccurs", minOccurs + "", property);
}
long maxOccurs = metainf.getMaxOccurs(name);
- if (maxOccurs==Long.MAX_VALUE){
- XSLTUtils.addAttribute(model,"unbound","yes",property);
- }else{
- XSLTUtils.addAttribute(model,"maxOccurs",maxOccurs +"",property);
+ if (maxOccurs == Long.MAX_VALUE) {
+ XSLTUtils.addAttribute(model, "unbound", "yes", property);
+ } else {
+ XSLTUtils.addAttribute(model, "maxOccurs", maxOccurs + "", property);
}
}
}
@@ -363,19 +367,19 @@
}
-
/**
* gets a non conflicting java name
+ *
* @param listOfNames
* @param nameBase
* @return
*/
- private String getNonConflictingName(List listOfNames,String nameBase){
+ private String getNonConflictingName(List listOfNames, String nameBase) {
String nameToReturn = nameBase;
- if (JavaUtils.isJavaKeyword(nameToReturn)){
+ if (JavaUtils.isJavaKeyword(nameToReturn)) {
nameToReturn = JavaUtils.makeNonJavaKeyword(nameToReturn);
}
- while (listOfNames.contains(nameToReturn)){
+ while (listOfNames.contains(nameToReturn)) {
nameToReturn = nameToReturn + count++;
}
@@ -384,30 +388,26 @@
}
-
-
-
/**
- * A bit of code from the old code generator. We are better off using the template
+ * A bit of code from the old code generator. We are better off using the template
* engines and such stuff that's already there. But the class writers are hard to be
* reused so some code needs to be repeated (atleast a bit)
- *
*/
- private void loadTemplate() throws SchemaCompilationException {
+ private void loadTemplate() throws SchemaCompilationException {
//first get the language specific property map
Class clazz = this.getClass();
InputStream xslStream;
String templateName = javaBeanTemplateName;
- if (templateName!=null){
+ if (templateName != null) {
try {
xslStream = clazz.getResourceAsStream(templateName);
templateCache = TransformerFactory.newInstance().newTemplates(new StreamSource(xslStream));
templateLoaded = true;
} catch (TransformerConfigurationException e) {
- throw new SchemaCompilationException("Error loading the template",e);
+ throw new SchemaCompilationException("Error loading the template", e);
}
- }else{
+ } else {
throw new SchemaCompilationException("template for this writer is not found");
}
}
@@ -435,7 +435,7 @@
* @param documentStream
* @throws Exception
*/
- private void parse(Document doc,OutputStream outStream) throws Exception {
+ private void parse(Document doc, OutputStream outStream) throws Exception {
XSLTTemplateProcessor.parse(outStream,
doc,
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/FileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/FileWriter.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/FileWriter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/FileWriter.java Wed Dec 21 19:38:20 2005
@@ -61,7 +61,7 @@
returnFile = new File(root, fileName);
if (!returnFile.exists()) {
- // returnFile.createNewFile();
+ // returnFile.createNewFile();
}
return returnFile;
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java Wed Dec 21 19:38:20 2005
@@ -58,40 +58,40 @@
}
/**
- * Parses an XML stream with an XSL stream
- *
- * @param out Stream to write the output
- * @param xmlStream Source XML stream
- * @throws TransformerFactoryConfigurationError
- *
- * @throws TransformerException
- */
- public static void parse(OutputStream out,
- Document doc,
- Transformer transformer)
- throws TransformerFactoryConfigurationError, TransformerException {
- Source xmlSource = new DOMSource(doc);
- Result result = new StreamResult(out);
- transformer.transform(xmlSource, result);
+ * Parses an XML stream with an XSL stream
+ *
+ * @param out Stream to write the output
+ * @param xmlStream Source XML stream
+ * @throws TransformerFactoryConfigurationError
+ *
+ * @throws TransformerException
+ */
+ public static void parse(OutputStream out,
+ Document doc,
+ Transformer transformer)
+ throws TransformerFactoryConfigurationError, TransformerException {
+ Source xmlSource = new DOMSource(doc);
+ Result result = new StreamResult(out);
+ transformer.transform(xmlSource, result);
- }
+ }
/**
- *
* @param out
* @param document
* @param xsltStream
* @throws TransformerFactoryConfigurationError
+ *
* @throws TransformerException
*/
- public static void parse(OutputStream out,
+ public static void parse(OutputStream out,
Document document,
InputStream xsltStream)
throws TransformerFactoryConfigurationError, TransformerException {
Source xsltSource = new StreamSource(xsltStream);
Transformer transformer = TransformerFactory.newInstance()
.newTransformer(xsltSource);
- parse(out,document,transformer);
+ parse(out, document, transformer);
}
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTUtils.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTUtils.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTUtils.java Wed Dec 21 19:38:20 2005
@@ -33,6 +33,7 @@
/**
* Utility method to add an attribute to a given element
+ *
* @param document
* @param AttribName
* @param attribValue
@@ -48,14 +49,15 @@
}
public static Element getElement(Document document,
- String elementName) {
- return document.createElement(elementName);
-
- }
+ String elementName) {
+ return document.createElement(elementName);
+
+ }
/**
* Utility method to add an attribute to a given element
+ *
* @param document
* @param attribName
* @param attribValue
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Wed Dec 21 19:38:20 2005
@@ -48,7 +48,6 @@
private boolean generateAll = false;
-
/**
* A hashmap to hang the property objects
*/
@@ -71,6 +70,7 @@
/**
* get the wrap classes flag
+ *
* @return
*/
public boolean isWrapClasses() {
@@ -79,6 +79,7 @@
/**
* set the wrap classes flag
+ *
* @param wrapClasses
*/
public void setWrapClasses(boolean wrapClasses) {
@@ -87,6 +88,7 @@
/**
* gets the policy map
+ *
* @return
*/
public Map getPolicyMap() {
@@ -95,6 +97,7 @@
/**
* sets the policy map
+ *
* @param policyMap
*/
public void setPolicyMap(Map policyMap) {
@@ -106,39 +109,41 @@
* absent, switches to the interface. The user however, can switch to the interface or the binding
* modes explicitly by specifying this parameter
*/
- private int codeGenerationStyle = XSLTConstants.CodegenStyle.AUTOMATIC;
-
+ private int codeGenerationStyle = XSLTConstants.CodegenStyle.AUTOMATIC;
/**
* put a property into the configuration
+ *
* @param key
* @param value
*/
- public void put(Object key, Object value){
- configurationProperties.put(key,value);
+ public void put(Object key, Object value) {
+ configurationProperties.put(key, value);
}
/**
* get the property from the configuration
+ *
* @param key
* @return
*/
- public Object get(Object key){
+ public Object get(Object key) {
return configurationProperties.get(key);
}
/**
* Get the whole property object
+ *
* @return
*/
- public Map getProperties(){
+ public Map getProperties() {
return configurationProperties;
}
+
private TypeMapper typeMapper;
/**
- *
* @return
*/
public int getCodeGenerationStyle() {
@@ -146,7 +151,6 @@
}
/**
- *
* @param codeGenerationStyle
*/
public void setCodeGenerationStyle(int codeGenerationStyle) {
@@ -154,7 +158,6 @@
}
/**
- *
* @return
*/
public TypeMapper getTypeMapper() {
@@ -162,7 +165,6 @@
}
/**
- *
* @param typeMapper
*/
public void setTypeMapper(TypeMapper typeMapper) {
@@ -170,7 +172,6 @@
}
/**
- *
* @return
*/
public String getDatabindingType() {
@@ -178,7 +179,6 @@
}
/**
- *
* @param databindingType
*/
public void setDatabindingType(String databindingType) {
@@ -198,6 +198,7 @@
/**
* Constructor for the configuration. populate the values using the options map
+ *
* @param wom
* @param optionMap
*/
@@ -206,18 +207,18 @@
String outputLocation = "."; //default output directory is the current working directory
CommandLineOption clo =
- ((CommandLineOption)optionMap.get(OUTPUT_LOCATION_OPTION));
+ ((CommandLineOption) optionMap.get(OUTPUT_LOCATION_OPTION));
if (clo != null) {
outputLocation = clo.getOptionValue();
}
this.outputLocation = new File(outputLocation);
//check and create the directories
- if (this.outputLocation.exists()){
- if (this.outputLocation.isFile()){
- throw new RuntimeException("The specified output location is not a directory!");
+ if (this.outputLocation.exists()) {
+ if (this.outputLocation.isFile()) {
+ throw new RuntimeException("The specified output location is not a directory!");
}
- }else{
+ } else {
this.outputLocation.mkdirs();
}
@@ -255,23 +256,22 @@
CommandLineOption dataBindingOption = (CommandLineOption) optionMap.get(
DATA_BINDING_TYPE_OPTION);
- if(dataBindingOption != null){
+ if (dataBindingOption != null) {
setDatabindingType(dataBindingOption.getOptionValue());
}
CommandLineOption wrapClassesOption = (CommandLineOption) optionMap.get(
WRAP_CLASSES_OPTION);
- if(wrapClassesOption != null){
+ if (wrapClassesOption != null) {
wrapClasses = true;
}
- CommandLineOption generateAllOption = (CommandLineOption) optionMap.get(
+ CommandLineOption generateAllOption = (CommandLineOption) optionMap.get(
GENERATE_ALL_OPTION);
- if(generateAllOption != null){
+ if (generateAllOption != null) {
generateAll = true;
}
}
-
/**
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Wed Dec 21 19:38:20 2005
@@ -35,7 +35,7 @@
private CodeGenConfiguration configuration;
- public CodeGenerationEngine(CodeGenConfiguration configuration) throws CodeGenerationException{
+ public CodeGenerationEngine(CodeGenConfiguration configuration) throws CodeGenerationException {
this.configuration = configuration;
loadExtensions();
}
@@ -54,17 +54,17 @@
loadExtensions();
}
- private void loadExtensions() throws CodeGenerationException{
+ private void loadExtensions() throws CodeGenerationException {
String[] extensions = ConfigPropertyFileLoader.getExtensionClassNames();
for (int i = 0; i < extensions.length; i++) {
//load the Extension class
- addExtension((CodeGenExtension)getObjectFromClassName(extensions[i]));
+ addExtension((CodeGenExtension) getObjectFromClassName(extensions[i]));
}
}
- private void addExtension(CodeGenExtension ext){
+ private void addExtension(CodeGenExtension ext) {
ext.init(configuration);
moduleEndpoints.add(ext);
}
@@ -80,7 +80,7 @@
TypeMapper mapper = configuration.getTypeMapper();
- if (mapper==null){
+ if (mapper == null) {
// this check is redundant here. The default databinding extension should
// have already figured this out and thrown an error message. However in case the
// users mess with the config it is safe to keep this check in order to throw
@@ -90,23 +90,23 @@
Map emitterMap = ConfigPropertyFileLoader.getLanguageEmitterMap();
String className = emitterMap.get(configuration.getOutputLanguage()).toString();
- if (className!=null){
- emitter = (Emitter)getObjectFromClassName(className);
+ if (className != null) {
+ emitter = (Emitter) getObjectFromClassName(className);
emitter.setCodeGenConfiguration(configuration);
emitter.setMapper(mapper);
- }else{
+ } else {
throw new Exception("Emitter class not found!");
}
- if (configuration.isServerSide()){
+ if (configuration.isServerSide()) {
emitter.emitSkeleton();
- }else{
+ } else {
emitter.emitStub();
}
} catch (ClassCastException e) {
- throw new CodeGenerationException("Non emitter class found!",e);
+ throw new CodeGenerationException("Non emitter class found!", e);
} catch (Exception e) {
throw new CodeGenerationException(e);
@@ -128,19 +128,20 @@
/**
* gets a object from the class
+ *
* @param className
* @return
*/
- private Object getObjectFromClassName(String className) throws CodeGenerationException{
+ private Object getObjectFromClassName(String className) throws CodeGenerationException {
try {
Class extensionClass = getClass().getClassLoader().loadClass(className);
return extensionClass.newInstance();
} catch (ClassNotFoundException e) {
- throw new CodeGenerationException("Extension class loading problem",e);
+ throw new CodeGenerationException("Extension class loading problem", e);
} catch (InstantiationException e) {
- throw new CodeGenerationException("Extension class instantiation problem",e);
+ throw new CodeGenerationException("Extension class instantiation problem", e);
} catch (IllegalAccessException e) {
- throw new CodeGenerationException("Illegal extension!",e);
+ throw new CodeGenerationException("Illegal extension!", e);
} catch (Exception e) {
throw new CodeGenerationException(e);
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CommandLineOption.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CommandLineOption.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CommandLineOption.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CommandLineOption.java Wed Dec 21 19:38:20 2005
@@ -96,7 +96,7 @@
(GENERATE_SERVICE_DESCRIPTION_OPTION).equalsIgnoreCase(optionType) ||
(GENERATE_TEST_CASE_OPTION).equalsIgnoreCase(optionType) ||
(STUB_LANGUAGE_OPTION).equalsIgnoreCase(optionType) ||
- (DATA_BINDING_TYPE_OPTION).equalsIgnoreCase(optionType)||
+ (DATA_BINDING_TYPE_OPTION).equalsIgnoreCase(optionType) ||
(WRAP_CLASSES_OPTION).equalsIgnoreCase(optionType) ||
(GENERATE_ALL_OPTION).equalsIgnoreCase(optionType))
;
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/XSLTConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/XSLTConstants.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/XSLTConstants.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/XSLTConstants.java Wed Dec 21 19:38:20 2005
@@ -20,8 +20,8 @@
public interface XSLTConstants {
String DEFAULT_PACKAGE_NAME = "codegen";
- QName BASE_64_CONTENT_QNAME= new QName("http://www.w3.org/2001/XMLSchema","base64Binary");
- QName XMIME_CONTENT_TYPE_QNAME = new QName("http://www.w3.org/2004/06/xmlmime","contentType");
+ QName BASE_64_CONTENT_QNAME = new QName("http://www.w3.org/2001/XMLSchema", "base64Binary");
+ QName XMIME_CONTENT_TYPE_QNAME = new QName("http://www.w3.org/2004/06/xmlmime", "contentType");
String BASE_64_PROPERTY_KEY = "base64map";
@@ -35,11 +35,11 @@
}
- public interface CodegenStyle{
+ public interface CodegenStyle {
public static final int AUTOMATIC = 0;
public static final int INTERFACE = 1;
public static final int BINDING = 2;
}
-
+
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java Wed Dec 21 19:38:20 2005
@@ -22,7 +22,7 @@
public class CSharpEmitter extends MultiLanguageClientEmitter {
- public CSharpEmitter(){
+ public CSharpEmitter() {
}
public CSharpEmitter(CodeGenConfiguration configuration) {
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/Emitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/Emitter.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/Emitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/Emitter.java Wed Dec 21 19:38:20 2005
@@ -23,8 +23,8 @@
public interface Emitter {
public void setCodeGenConfiguration(CodeGenConfiguration configuration);
-
- public void setMapper(TypeMapper mapper) ;
+
+ public void setMapper(TypeMapper mapper);
public void emitStub() throws CodeGenerationException;
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Wed Dec 21 19:38:20 2005
@@ -63,7 +63,7 @@
import java.util.List;
import java.util.Map;
-public abstract class MultiLanguageClientEmitter implements Emitter {
+public abstract class MultiLanguageClientEmitter implements Emitter {
private Log log = LogFactory.getLog(getClass());
@@ -106,6 +106,7 @@
public void setCodeGenConfiguration(CodeGenConfiguration configuration) {
this.configuration = configuration;
}
+
/**
* @see org.apache.axis2.wsdl.codegen.emitter.Emitter#emitSkeleton()
*/
@@ -114,19 +115,19 @@
//get the interface
WSDLDescription wom = this.configuration.getWom();
int codegenStyle = this.configuration.getCodeGenerationStyle();
- if (codegenStyle== XSLTConstants.CodegenStyle.INTERFACE){
+ if (codegenStyle == XSLTConstants.CodegenStyle.INTERFACE) {
emitSkeletonInterface(wom);
- }else if (codegenStyle== XSLTConstants.CodegenStyle.BINDING){
+ } else if (codegenStyle == XSLTConstants.CodegenStyle.BINDING) {
emitSkeletonBinding(wom);
- }else if (codegenStyle==XSLTConstants.CodegenStyle.AUTOMATIC){
+ } else if (codegenStyle == XSLTConstants.CodegenStyle.AUTOMATIC) {
emitSkeletonAutomatic(wom);
- }else{
+ } else {
throw new Exception("Unknown code generation style!!! " + codegenStyle);
}
// Call the emit stub method to generate the client side too
- if (configuration.isGenerateAll()){
- emitStub();
+ if (configuration.isGenerateAll()) {
+ emitStub();
}
@@ -134,6 +135,7 @@
throw new CodeGenerationException(e);
}
}
+
/**
* @see org.apache.axis2.wsdl.codegen.emitter.Emitter#emitStub()
*/
@@ -142,13 +144,13 @@
//get the interface
WSDLDescription wom = this.configuration.getWom();
int codegenStyle = this.configuration.getCodeGenerationStyle();
- if (codegenStyle== XSLTConstants.CodegenStyle.INTERFACE){
+ if (codegenStyle == XSLTConstants.CodegenStyle.INTERFACE) {
emitStubInterface(wom);
- }else if (codegenStyle== XSLTConstants.CodegenStyle.BINDING){
+ } else if (codegenStyle == XSLTConstants.CodegenStyle.BINDING) {
emitStubBinding(wom);
- }else if (codegenStyle==XSLTConstants.CodegenStyle.AUTOMATIC){
+ } else if (codegenStyle == XSLTConstants.CodegenStyle.AUTOMATIC) {
emitStubAutomatic(wom);
- }else{
+ } else {
throw new Exception("Unknown code generation style!!! " + codegenStyle);
}
@@ -159,15 +161,16 @@
/**
* Emit the skeleton with inteface only
+ *
* @param wom
*/
- private void emitSkeletonInterface(WSDLDescription wom) throws Exception{
+ private void emitSkeletonInterface(WSDLDescription wom) throws Exception {
Map interfaces = wom.getWsdlInterfaces();
//loop through the wsdlInterfaces to generate the interface code
//theoretically the interface should be the base for the interfaces
- Collection interfaceCollection =interfaces.values();
+ Collection interfaceCollection = interfaces.values();
for (Iterator iterator = interfaceCollection.iterator(); iterator.hasNext();) {
WSDLInterface axisInteface = (WSDLInterface) iterator.next();
//write skeleton
@@ -183,20 +186,21 @@
/**
* Emit the skelton with binding
+ *
* @param wom
*/
- private void emitSkeletonBinding(WSDLDescription wom) throws Exception{
+ private void emitSkeletonBinding(WSDLDescription wom) throws Exception {
Map bindings = wom.getBindings();
- if (bindings==null || bindings.isEmpty()){
+ if (bindings == null || bindings.isEmpty()) {
//asking for a code generation with a binding when a binding is
//not present should be the cause of an Exception !
throw new Exception("Cannot find a binding!!");
- }else{
+ } else {
WSDLBinding axisBinding;
Collection bindingCollection = bindings.values();
for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {
- axisBinding = (WSDLBinding)iterator.next();
+ axisBinding = (WSDLBinding) iterator.next();
//write skeleton
writeSkeleton(axisBinding.getBoundInterface(), axisBinding);
@@ -205,8 +209,8 @@
//write a MessageReceiver for this particular service.
writeMessageReceiver(axisBinding);
//write the ant build if not asked for all
- if (!configuration.isGenerateAll()){
- writeAntBuild(axisBinding.getBoundInterface(),axisBinding);
+ if (!configuration.isGenerateAll()) {
+ writeAntBuild(axisBinding.getBoundInterface(), axisBinding);
}
}
@@ -215,28 +219,31 @@
/**
* Skeleton emission - Automatic mode
+ *
* @param wom
*/
- private void emitSkeletonAutomatic(WSDLDescription wom) throws Exception{
+ private void emitSkeletonAutomatic(WSDLDescription wom) throws Exception {
Map bindings = wom.getBindings();
- if (bindings==null || bindings.isEmpty()){
+ if (bindings == null || bindings.isEmpty()) {
//No binding is present.use the interface mode
emitSkeletonInterface(wom);
- }else{
+ } else {
//use the binding mode
emitSkeletonBinding(wom);
}
}
+
/**
* Emits the stub code with the interfaces only
+ *
* @param wom
* @throws Exception
*/
- private void emitStubInterface(WSDLDescription wom) throws Exception{
+ private void emitStubInterface(WSDLDescription wom) throws Exception {
Map interfaces = wom.getWsdlInterfaces();
//loop through the wsdlInterfaces to generate the interface code
- Collection interfaceCollection =interfaces.values();
+ Collection interfaceCollection = interfaces.values();
for (Iterator iterator = interfaceCollection.iterator(); iterator.hasNext();) {
//Write the interfaces
WSDLInterface axisInterface = (WSDLInterface) iterator.next();
@@ -256,28 +263,29 @@
/**
* Emit the stubcode with bindings
+ *
* @param wom
* @throws Exception
*/
- private void emitStubBinding(WSDLDescription wom) throws Exception{
+ private void emitStubBinding(WSDLDescription wom) throws Exception {
Map bindings = wom.getBindings();
- if (bindings==null || bindings.isEmpty()){
+ if (bindings == null || bindings.isEmpty()) {
//asking for a code generation with a binding when a binding is
//not present should be the cause of an Exception !
throw new Exception("Cannot find a binding!!");
- }else{
- WSDLBinding axisBinding ;
+ } else {
+ WSDLBinding axisBinding;
WSDLService axisService = null;
Collection bindingCollection = bindings.values();
for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {
- axisBinding = (WSDLBinding)iterator.next();
+ axisBinding = (WSDLBinding) iterator.next();
//Check the service
axisService = checkService(wom, axisService);
//write the inteface
//feed the binding information also
//note that we do not create this interface if the user switched on the wrap classes mode
- if (!configuration.isWrapClasses()){
+ if (!configuration.isWrapClasses()) {
writeInterface(axisBinding.getBoundInterface(), axisBinding);
}
//write the call back handlers
@@ -292,7 +300,7 @@
//write a testservice.xml that will load the dummy skeleton impl for testing
//writeTestServiceXML(axisBinding);
//write an ant build file
- writeAntBuild(axisBinding.getBoundInterface(),axisBinding);
+ writeAntBuild(axisBinding.getBoundInterface(), axisBinding);
}
}
}
@@ -300,14 +308,15 @@
/**
* emit the stubcode with the automatic mode. Look for the binding and if present
* emit the skeleton with the binding. Else go for the interface
+ *
* @param wom
*/
- private void emitStubAutomatic(WSDLDescription wom) throws Exception{
+ private void emitStubAutomatic(WSDLDescription wom) throws Exception {
Map bindings = wom.getBindings();
- if (bindings==null || bindings.isEmpty()){
+ if (bindings == null || bindings.isEmpty()) {
//No binding is not present.use the interface mode
emitStubInterface(wom);
- }else{
+ } else {
//use the binding mode
emitStubBinding(wom);
}
@@ -316,9 +325,10 @@
/**
* Check the service for compatibility. Am incompatible service consists of
* multiple services ATM
+ *
* @param wom
* @param axisService
- * @return the WSDLService object
+ * @return the WSDLService object
*/
private WSDLService checkService(WSDLDescription wom, WSDLService axisService) {
Map services = wom.getServices();
@@ -334,8 +344,6 @@
}
-
-
/**
* Write the callback handlers
*/
@@ -354,7 +362,6 @@
}
-
/**
*
*/
@@ -372,6 +379,7 @@
/**
* Writes the interfaces
+ *
* @param axisInterface
* @param axisBinding
* @throws Exception
@@ -407,7 +415,6 @@
}
-
/**
* Writes the Ant build
*
@@ -479,7 +486,6 @@
}
-
/**
* A resusable method for the implementation of interface and implementation writing
*
@@ -499,8 +505,6 @@
}
-
-
private Document getEmptyDocument() {
try {
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
@@ -512,6 +516,7 @@
/**
* Generating the model for the callbacks
+ *
* @param boundInterface
* @param axisBinding
*/
@@ -525,7 +530,7 @@
rootElement);
addAttribute(doc,
"name",
- reformatName(boundInterface.getName().getLocalPart(),false) +
+ reformatName(boundInterface.getName().getLocalPart(), false) +
CALL_BACK_HANDLER_SUFFIX,
rootElement);
addAttribute(doc,
@@ -534,7 +539,7 @@
rootElement);
//TODO JAXRPC mapping support should be considered
- this.loadOperations(boundInterface, doc, rootElement,axisBinding);
+ this.loadOperations(boundInterface, doc, rootElement, axisBinding);
//this.loadOperations(boundInterface, doc, rootElement, "on", "Complete");
doc.appendChild(rootElement);
@@ -542,7 +547,6 @@
}
-
/**
* Finds the input element for the xml document
*
@@ -554,23 +558,20 @@
WSDLOperation operation, List headerParameterQNameList) {
Element inputElt = doc.createElement("input");
Element param = getInputParamElement(doc, operation);
- if (param!=null){
+ if (param != null) {
inputElt.appendChild(param);
}
- List parameterElementList = getParameterElementList(doc,headerParameterQNameList, "header");
+ List parameterElementList = getParameterElementList(doc, headerParameterQNameList, "header");
for (int i = 0; i < parameterElementList.size(); i++) {
- inputElt.appendChild((Element)parameterElementList.get(i));
+ inputElt.appendChild((Element) parameterElementList.get(i));
}
return inputElt;
}
-
-
-
- private List getParameterElementList(Document doc, List parameters, String location){
+ private List getParameterElementList(Document doc, List parameters, String location) {
List parameterElementList = new ArrayList();
- if (parameters!=null && !parameters.isEmpty()) {
+ if (parameters != null && !parameters.isEmpty()) {
int count = parameters.size();
for (int i = 0; i < count; i++) {
Element param = doc.createElement("param");
@@ -582,7 +583,7 @@
String typeMapping = this.mapper.getTypeMappingName(name);
String typeMappingStr = typeMapping == null ? "" : typeMapping;
addAttribute(doc, "type", typeMappingStr, param);
- addAttribute(doc,"location",location,param);
+ addAttribute(doc, "location", location, param);
parameterElementList.add(param);
}
@@ -591,7 +592,6 @@
}
/**
- *
* @param doc
* @param operation
* @return the parameter element
@@ -600,7 +600,7 @@
WSDLOperation operation) {
Element param = doc.createElement("param");
MessageReference inputMessage = operation.getInputMessage();
- if (inputMessage!=null){
+ if (inputMessage != null) {
addAttribute(doc,
"name",
this.mapper.getParameterName(inputMessage.getElementQName()),
@@ -612,23 +612,22 @@
addAttribute(doc, "type", typeMapping == null ? "" : typeMapping, param);
//add an extra attribute to say whether the type mapping is the default
- if (TypeMapper.DEFAULT_CLASS_NAME.equals(typeMapping)){
- addAttribute(doc,"default","yes",param);
+ if (TypeMapper.DEFAULT_CLASS_NAME.equals(typeMapping)) {
+ addAttribute(doc, "default", "yes", param);
}
//add this as a body parameter
- addAttribute(doc,"location","body",param);
+ addAttribute(doc, "location", "body", param);
Iterator iter = inputMessage.getExtensibilityAttributes().iterator();
- while(iter.hasNext()){
+ while (iter.hasNext()) {
WSDLExtensibilityAttribute att = (WSDLExtensibilityAttribute) iter.next();
addAttribute(doc, att.getKey().getLocalPart(), att.getValue().toString(), param);
}
- }else{
+ } else {
param = null;
}
-
return param;
}
@@ -643,12 +642,12 @@
WSDLOperation operation, List headerParameterQNameList) {
Element outputElt = doc.createElement("output");
Element param = getOutputParamElement(doc, operation);
- if (param!=null){
+ if (param != null) {
outputElt.appendChild(param);
}
- List outputElementList = getParameterElementList(doc,headerParameterQNameList, "header");
+ List outputElementList = getParameterElementList(doc, headerParameterQNameList, "header");
for (int i = 0; i < outputElementList.size(); i++) {
- outputElt.appendChild((Element)outputElementList.get(i));
+ outputElt.appendChild((Element) outputElementList.get(i));
}
return outputElt;
}
@@ -661,38 +660,36 @@
String typeMappingStr;
String parameterName;
- if (outputMessage!=null){
- parameterName = this.mapper.getParameterName(
- outputMessage.getElementQName()) ;
+ if (outputMessage != null) {
+ parameterName = this.mapper.getParameterName(
+ outputMessage.getElementQName());
String typeMapping = this.mapper.getTypeMappingName(
operation.getOutputMessage().getElementQName());
typeMappingStr = typeMapping == null ? "" : typeMapping;
- }else{
- parameterName = "" ;
+ } else {
+ parameterName = "";
typeMappingStr = "";
}
- addAttribute(doc,"name",parameterName,param);
- addAttribute(doc,"type", typeMappingStr, param);
+ addAttribute(doc, "name", parameterName, param);
+ addAttribute(doc, "type", typeMappingStr, param);
//add an extra attribute to say whether the type mapping is the default
- if (TypeMapper.DEFAULT_CLASS_NAME.equals(typeMappingStr)){
- addAttribute(doc,"default","yes",param);
+ if (TypeMapper.DEFAULT_CLASS_NAME.equals(typeMappingStr)) {
+ addAttribute(doc, "default", "yes", param);
}
//add this as a body parameter
- addAttribute(doc,"location","body",param);
+ addAttribute(doc, "location", "body", param);
return param;
}
-
-
protected Document createDOMDocumentForServiceXML(WSDLInterface boundInterface,
boolean forTesting, WSDLBinding axisBinding) {
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("interface");
- String localPart = reformatName(boundInterface.getName().getLocalPart(),false);
+ String localPart = reformatName(boundInterface.getName().getLocalPart(), false);
if (forTesting) {
addAttribute(doc,
"package",
@@ -712,7 +709,7 @@
//name
addAttribute(doc,
"package",
- SERVICE_XML_OUTPUT_FOLDER_NAME+localPart,
+ SERVICE_XML_OUTPUT_FOLDER_NAME + localPart,
rootElement);
addAttribute(doc,
"classpackage",
@@ -730,7 +727,7 @@
localPart + MESSAGE_RECEIVER_SUFFIX,
rootElement);
fillSyncAttributes(doc, rootElement);
- loadOperations(boundInterface, doc, rootElement,axisBinding);
+ loadOperations(boundInterface, doc, rootElement, axisBinding);
doc.appendChild(rootElement);
return doc;
@@ -746,7 +743,7 @@
"package",
configuration.getPackageName(),
rootElement);
- String localPart = reformatName(boundInterface.getName().getLocalPart(),false);
+ String localPart = reformatName(boundInterface.getName().getLocalPart(), false);
addAttribute(doc,
"name",
localPart + MESSAGE_RECEIVER_SUFFIX,
@@ -768,7 +765,7 @@
loadOperations(boundInterface, doc, rootElement, binding);
/////////////////////////
- rootElement.appendChild(createDOMElementforDatabinders(doc,binding));
+ rootElement.appendChild(createDOMElementforDatabinders(doc, binding));
/////////////////////////
doc.appendChild(rootElement);
return doc;
@@ -776,6 +773,7 @@
/**
* Creates the DOM tree for the interface creation. Uses the interface
+ *
* @param wsdlInterface
* @param axisBinding
*/
@@ -783,7 +781,7 @@
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("ant");
- String localPart = reformatName(wsdlInterface.getName().getLocalPart(),false);
+ String localPart = reformatName(wsdlInterface.getName().getLocalPart(), false);
String packageName = configuration.getPackageName();
String[] dotSeparatedValues = packageName.split("\\.");
addAttribute(doc,
@@ -802,6 +800,7 @@
/**
* Creates the DOM tree for the interface creation. Uses the interface
+ *
* @param wsdlInterface
* @param axisBinding
*/
@@ -809,7 +808,7 @@
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("interface");
- String localPart = reformatName(wsdlInterface.getName().getLocalPart(),false);
+ String localPart = reformatName(wsdlInterface.getName().getLocalPart(), false);
addAttribute(doc,
"package",
configuration.getPackageName(),
@@ -825,7 +824,7 @@
CALL_BACK_HANDLER_SUFFIX,
rootElement);
fillSyncAttributes(doc, rootElement);
- loadOperations(wsdlInterface, doc, rootElement,axisBinding);
+ loadOperations(wsdlInterface, doc, rootElement, axisBinding);
doc.appendChild(rootElement);
return doc;
@@ -834,6 +833,7 @@
/**
* Create the model for the skeleton
+ *
* @param boundInterface
* @param axisBinding
* @return documentModel for the skeleton
@@ -842,7 +842,7 @@
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("interface");
- String localpart = reformatName(boundInterface.getName().getLocalPart(),false);
+ String localpart = reformatName(boundInterface.getName().getLocalPart(), false);
addAttribute(doc,
"package",
configuration.getPackageName(),
@@ -858,7 +858,7 @@
CALL_BACK_HANDLER_SUFFIX,
rootElement);
fillSyncAttributes(doc, rootElement);
- loadOperations(boundInterface, doc, rootElement,axisBinding);
+ loadOperations(boundInterface, doc, rootElement, axisBinding);
doc.appendChild(rootElement);
return doc;
@@ -877,6 +877,7 @@
/**
* Loads operations based on the interface
+ *
* @param boundInterface
* @param doc
* @param rootElement
@@ -889,7 +890,6 @@
/**
- *
* @param boundInterface
* @param doc
* @param rootElement
@@ -901,10 +901,10 @@
WSDLBinding binding) {
Collection col = boundInterface.getOperations().values();
- String portTypeName = reformatName(boundInterface.getName().getLocalPart(),false);
+ String portTypeName = reformatName(boundInterface.getName().getLocalPart(), false);
- Element methodElement ;
- WSDLOperation operation ;
+ Element methodElement;
+ WSDLOperation operation;
for (Iterator iterator = col.iterator(); iterator.hasNext();) {
@@ -913,7 +913,7 @@
operation = (WSDLOperation) iterator.next();
methodElement = doc.createElement("method");
- String localPart = reformatName(operation.getName().getLocalPart(),false);
+ String localPart = reformatName(operation.getName().getLocalPart(), false);
addAttribute(doc, "name", localPart, methodElement);
addAttribute(doc,
"namespace",
@@ -934,10 +934,10 @@
WSDLBindingOperation bindingOperation =
binding.getBindingOperation(operation.getName());
// todo This can be a prob !!!!!
- if (bindingOperation!=null){
+ if (bindingOperation != null) {
addSOAPAction(doc, methodElement, bindingOperation);
- addHeaderOperations(soapHeaderInputParameterList,bindingOperation,true);
- addHeaderOperations(soapHeaderOutputParameterList,bindingOperation,false);
+ addHeaderOperations(soapHeaderInputParameterList, bindingOperation, true);
+ addHeaderOperations(soapHeaderOutputParameterList, bindingOperation, false);
}
}
@@ -949,18 +949,18 @@
}
}
- private void addHeaderOperations(List soapHeaderParameterQNameList, WSDLBindingOperation bindingOperation,boolean input) {
+ private void addHeaderOperations(List soapHeaderParameterQNameList, WSDLBindingOperation bindingOperation, boolean input) {
Iterator extIterator;
- if (input){
- extIterator = bindingOperation.getInput()==null?null:bindingOperation.getInput().getExtensibilityElements().iterator();
- }else{
- extIterator = bindingOperation.getOutput()==null?null: bindingOperation.getOutput().getExtensibilityElements().iterator();
+ if (input) {
+ extIterator = bindingOperation.getInput() == null ? null : bindingOperation.getInput().getExtensibilityElements().iterator();
+ } else {
+ extIterator = bindingOperation.getOutput() == null ? null : bindingOperation.getOutput().getExtensibilityElements().iterator();
}
- while (extIterator!=null && extIterator.hasNext()) {
+ while (extIterator != null && extIterator.hasNext()) {
WSDLExtensibilityElement element = (WSDLExtensibilityElement) extIterator.next();
if (ExtensionConstants.SOAP_11_HEADER.equals(element.getType())) {
- SOAPHeader header = (SOAPHeader)element;
+ SOAPHeader header = (SOAPHeader) element;
soapHeaderParameterQNameList.add(header.getElement());
}
}
@@ -972,12 +972,12 @@
WSDLBindingOperation binding) {
List extensibilityElements = binding.getExtensibilityElements();
boolean actionAdded = false;
- if (extensibilityElements!=null && !extensibilityElements.isEmpty()){
+ if (extensibilityElements != null && !extensibilityElements.isEmpty()) {
Iterator extIterator = extensibilityElements.iterator();
while (extIterator.hasNext()) {
WSDLExtensibilityElement element = (WSDLExtensibilityElement) extIterator.next();
if (ExtensionConstants.SOAP_11_OPERATION.equals(element.getType())
- || ExtensionConstants.SOAP_12_OPERATION.equals(element.getType()) ) {
+ || ExtensionConstants.SOAP_12_OPERATION.equals(element.getType())) {
addAttribute(doc,
"soapaction",
((SOAPOperation) element).getSoapAction(),
@@ -993,7 +993,7 @@
protected Document createDOMDocumentForTestCase(WSDLBinding binding) {
WSDLInterface boundInterface = binding.getBoundInterface();
- String localPart = reformatName(boundInterface.getName().getLocalPart(),false);
+ String localPart = reformatName(boundInterface.getName().getLocalPart(), false);
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("class");
addAttribute(doc,
@@ -1025,14 +1025,13 @@
}
-
protected Element createDOMElementforDatabinders(
Document doc, WSDLBinding binding) {
//First Iterate through the operations and find the relevant fromOM and toOM methods to be generated
- Map bindingOperationsMap = binding.getBindingOperations();
+ Map bindingOperationsMap = binding.getBindingOperations();
Map parameterMap = new HashMap();
- Iterator operationsIterator = bindingOperationsMap.values().iterator();
+ Iterator operationsIterator = bindingOperationsMap.values().iterator();
while (operationsIterator.hasNext()) {
WSDLBindingOperation bindingOperation = (WSDLBindingOperation) operationsIterator.next();
//Add the parameters to a map with their type as the key
@@ -1040,40 +1039,40 @@
//process the input and output parameters
Element inputParamElement = getInputParamElement(doc, bindingOperation.getOperation());
- if (inputParamElement!=null){
- parameterMap.put(inputParamElement.getAttribute("type"),inputParamElement);
+ if (inputParamElement != null) {
+ parameterMap.put(inputParamElement.getAttribute("type"), inputParamElement);
}
Element outputParamElement = getOutputParamElement(doc, bindingOperation.getOperation());
- if (outputParamElement!=null){
- parameterMap.put(outputParamElement.getAttribute("type"),outputParamElement);
+ if (outputParamElement != null) {
+ parameterMap.put(outputParamElement.getAttribute("type"), outputParamElement);
}
//todo process the exceptions
//process the header parameters
Element newChild;
- List headerParameterQNameList= new ArrayList();
- addHeaderOperations(headerParameterQNameList,bindingOperation,true);
- List parameterElementList = getParameterElementList(doc,headerParameterQNameList, "header");
+ List headerParameterQNameList = new ArrayList();
+ addHeaderOperations(headerParameterQNameList, bindingOperation, true);
+ List parameterElementList = getParameterElementList(doc, headerParameterQNameList, "header");
for (int i = 0; i < parameterElementList.size(); i++) {
newChild = (Element) parameterElementList.get(i);
- parameterMap.put(newChild.getAttribute("type"),newChild);
+ parameterMap.put(newChild.getAttribute("type"), newChild);
}
headerParameterQNameList.clear();
parameterElementList.clear();
- addHeaderOperations(headerParameterQNameList,bindingOperation,false);
- parameterElementList = getParameterElementList(doc,headerParameterQNameList, "header");
+ addHeaderOperations(headerParameterQNameList, bindingOperation, false);
+ parameterElementList = getParameterElementList(doc, headerParameterQNameList, "header");
for (int i = 0; i < parameterElementList.size(); i++) {
newChild = (Element) parameterElementList.get(i);
- parameterMap.put(newChild.getAttribute("type"),newChild);
+ parameterMap.put(newChild.getAttribute("type"), newChild);
}
}
Element rootElement = doc.createElement("databinders");
- addAttribute(doc,"dbtype",configuration.getDatabindingType(),rootElement);
+ addAttribute(doc, "dbtype", configuration.getDatabindingType(), rootElement);
//add the names of the elements that have base 64 content
//if the base64 name list is missing then this whole step is skipped
@@ -1082,7 +1081,7 @@
//Now run through the parameters and add them to the root element
Collection parameters = parameterMap.values();
for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
- rootElement.appendChild((Element)iterator.next());
+ rootElement.appendChild((Element) iterator.next());
}
@@ -1091,28 +1090,30 @@
/**
* Get the base64 types. If not available this will be empty!!!
+ *
* @param doc
* @return element
*/
- private Element getBase64Elements(Document doc){
+ private Element getBase64Elements(Document doc) {
Element root = doc.createElement("base64Elements");
Element elt;
QName qname;
//this is a list of QNames
- List list = (List)configuration.getProperties().get(XSLTConstants.BASE_64_PROPERTY_KEY);
- if (list!=null && !list.isEmpty()){
+ List list = (List) configuration.getProperties().get(XSLTConstants.BASE_64_PROPERTY_KEY);
+ if (list != null && !list.isEmpty()) {
int count = list.size();
for (int i = 0; i < count; i++) {
- qname = (QName)list.get(i);
- elt = doc.createElement("name") ;
- addAttribute(doc,"ns-url",qname.getNamespaceURI(),elt);
- addAttribute(doc,"localName",qname.getLocalPart(),elt);
+ qname = (QName) list.get(i);
+ elt = doc.createElement("name");
+ addAttribute(doc, "ns-url", qname.getNamespaceURI(), elt);
+ addAttribute(doc, "localName", qname.getLocalPart(), elt);
root.appendChild(elt);
}
}
return root;
}
+
/**
* Creates the DOM tree for implementations
*
@@ -1123,7 +1124,7 @@
WSDLBinding binding, WSDLService service) throws Exception {
WSDLInterface boundInterface = binding.getBoundInterface();
HashMap endpoints = new HashMap(1);
- if (service!=null){
+ if (service != null) {
endpoints = service.getEndpoints();
}
@@ -1133,7 +1134,7 @@
"package",
configuration.getPackageName(),
rootElement);
- String localPart = reformatName(boundInterface.getName().getLocalPart(),false);
+ String localPart = reformatName(boundInterface.getName().getLocalPart(), false);
addAttribute(doc, "name", localPart + STUB_SUFFIX, rootElement);
addAttribute(doc, "servicename", localPart, rootElement);
addAttribute(doc,
@@ -1146,7 +1147,7 @@
localPart + CALL_BACK_HANDLER_SUFFIX,
rootElement);
//add the wrap classes flag
- if (configuration.isWrapClasses()){
+ if (configuration.isWrapClasses()) {
addAttribute(doc,
"wrapped",
"yes",
@@ -1161,7 +1162,7 @@
rootElement);
//add SOAP version
- addSoapVersion(binding,doc,rootElement);
+ addSoapVersion(binding, doc, rootElement);
//add the end point
addEndpoints(doc, rootElement, endpoints);
//set the sync/async attributes
@@ -1172,7 +1173,7 @@
//add the databind supporters. Now the databind supporters are completly contained inside
//the stubs implementation and not visible outside
rootElement.appendChild(
- createDOMElementforDatabinders(doc,binding));
+ createDOMElementforDatabinders(doc, binding));
doc.appendChild(rootElement);
@@ -1182,23 +1183,25 @@
}
- protected void addSoapVersion(WSDLBinding binding,Document doc,Element rootElement){
+ protected void addSoapVersion(WSDLBinding binding, Document doc, Element rootElement) {
//loop through the extensibility elements to get to the bindings element
List extensibilityElementsList = binding.getExtensibilityElements();
int count = extensibilityElementsList.size();
for (int i = 0; i < count; i++) {
- WSDLExtensibilityElement extElement = (WSDLExtensibilityElement)extensibilityElementsList.get(i);
- if (ExtensionConstants.SOAP_11_BINDING.equals(extElement.getType())){
- addAttribute(doc,"soap-version", "1.1",rootElement);
+ WSDLExtensibilityElement extElement = (WSDLExtensibilityElement) extensibilityElementsList.get(i);
+ if (ExtensionConstants.SOAP_11_BINDING.equals(extElement.getType())) {
+ addAttribute(doc, "soap-version", "1.1", rootElement);
break;
- }else if (ExtensionConstants.SOAP_12_BINDING.equals(extElement.getType())){
- addAttribute(doc,"soap-version", "1.2",rootElement);
+ } else if (ExtensionConstants.SOAP_12_BINDING.equals(extElement.getType())) {
+ addAttribute(doc, "soap-version", "1.2", rootElement);
break;
}
}
}
+
/**
* Add the endpoint to the document
+ *
* @param doc
* @param rootElement
* @param endpointMap
@@ -1206,7 +1209,7 @@
protected void addEndpoints(Document doc,
Element rootElement,
- HashMap endpointMap) throws Exception{
+ HashMap endpointMap) throws Exception {
// Map endpointPolicyMap = configuration.getPolicyMap();
Object[] endpoints = endpointMap.values().toArray();
WSDLEndpoint endpoint;
@@ -1231,11 +1234,11 @@
while (iterator.hasNext()) {
WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator.next();
if (ExtensionConstants.SOAP_11_ADDRESS.equals(element.getType()) ||
- ExtensionConstants.SOAP_12_ADDRESS.equals(element.getType())){
+ ExtensionConstants.SOAP_12_ADDRESS.equals(element.getType())) {
address = (org.apache.wsdl.extensions.SOAPAddress) element;
}
}
- text = doc.createTextNode(address!=null?address.getLocationURI():"");
+ text = doc.createTextNode(address != null ? address.getLocationURI() : "");
// if (policyFileResourceName!=null){
// addAttribute(doc,"policyRef",policyFileResourceName,endpointElement);
// }
@@ -1248,7 +1251,7 @@
/**
* Commented for now for the
* @param policy
- * @return the file name and the package of this policy
+ * @return the file name and the package of this policy
*/
// private String processPolicy(Policy policy,String name) throws Exception{
// PolicyFileWriter writer = new PolicyFileWriter(configuration.getOutputLocation());
@@ -1265,6 +1268,7 @@
/**
* Utility method to add an attribute to a given element
+ *
* @param document
* @param AttribName
* @param attribValue
@@ -1274,28 +1278,27 @@
String AttribName,
String attribValue,
Element element) {
- XSLTUtils.addAttribute(document,AttribName,attribValue,element);
+ XSLTUtils.addAttribute(document, AttribName, attribValue, element);
}
/**
- *
* @param word
* @return character removed string
*/
protected String reformatName(String word) {
- return reformatName(word,true);
+ return reformatName(word, true);
}
+
/**
- *
* @param word
* @return character removed string
*/
protected String reformatName(String word, boolean decapitalizaFirst) {
- if (JavaUtils.isJavaKeyword(word)){
+ if (JavaUtils.isJavaKeyword(word)) {
return JavaUtils.makeNonJavaKeyword(word);
- }else{
- return JavaUtils.xmlNameToJava(word,decapitalizaFirst);
+ } else {
+ return JavaUtils.xmlNameToJava(word, decapitalizaFirst);
}
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractCodeGenerationExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractCodeGenerationExtension.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractCodeGenerationExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractCodeGenerationExtension.java Wed Dec 21 19:38:20 2005
@@ -23,7 +23,7 @@
public abstract class AbstractCodeGenerationExtension implements CodeGenExtension {
protected Log log = LogFactory.getLog(this.getClass());
-
+
protected CodeGenConfiguration configuration;
public void init(CodeGenConfiguration configuration) {
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractDBProcessingExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractDBProcessingExtension.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractDBProcessingExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AbstractDBProcessingExtension.java Wed Dec 21 19:38:20 2005
@@ -19,7 +19,7 @@
* limitations under the License.
*/
-public abstract class AbstractDBProcessingExtension extends AbstractCodeGenerationExtension{
+public abstract class AbstractDBProcessingExtension extends AbstractCodeGenerationExtension {
/**
* Method to test whether the passed in framework name is
@@ -28,9 +28,9 @@
* @param dbFrameworkName
* @return
*/
- protected boolean testFallthrough(String dbFrameworkName){
+ protected boolean testFallthrough(String dbFrameworkName) {
Map extensionsMap = ConfigPropertyFileLoader.getDatabindingFrameworkNameToExtensionMap();
- String mappedExtension=extensionsMap.get(dbFrameworkName)!=null?extensionsMap.get(dbFrameworkName).toString():"";
+ String mappedExtension = extensionsMap.get(dbFrameworkName) != null ? extensionsMap.get(dbFrameworkName).toString() : "";
return !(getClass().getName().equals(mappedExtension));
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AxisBindingBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AxisBindingBuilder.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AxisBindingBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AxisBindingBuilder.java Wed Dec 21 19:38:20 2005
@@ -16,7 +16,6 @@
package org.apache.axis2.wsdl.codegen.extension;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import org.apache.wsdl.WSDLBinding;
import org.apache.wsdl.WSDLDescription;
import org.apache.wsdl.WSDLExtensibilityAttribute;
@@ -50,14 +49,14 @@
Map bindingMap = wom.getBindings();
Vector bindingVector = new Vector();
- if (bindingMap==null || bindingMap.isEmpty()) {
+ if (bindingMap == null || bindingMap.isEmpty()) {
log.info(" bindings are not present in the original document");
//just fall through
- }else{
+ } else {
Collection bindingCollection = bindingMap.values();
for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {
- WSDLBinding binding = (WSDLBinding)iterator.next();
+ WSDLBinding binding = (WSDLBinding) iterator.next();
WSDLBinding newBinding = wom.createBinding();
newBinding.setName(AXIS_BINDING_QNAME);
@@ -85,7 +84,7 @@
//drop all the bindings and add the new ones
wom.getBindings().clear();
for (int i = 0; i < bindingVector.size(); i++) {
- wom.addBinding ((WSDLBinding) bindingVector.get(i));
+ wom.addBinding((WSDLBinding) bindingVector.get(i));
}
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/DefaultDatabindingExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/DefaultDatabindingExtension.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/DefaultDatabindingExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/DefaultDatabindingExtension.java Wed Dec 21 19:38:20 2005
@@ -16,23 +16,21 @@
package org.apache.axis2.wsdl.codegen.extension;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import org.apache.axis2.wsdl.codegen.CodeGenerationException;
-import org.apache.axis2.wsdl.codegen.XSLTConstants;
import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
import org.apache.axis2.wsdl.databinding.TypeMapper;
-public class DefaultDatabindingExtension extends AbstractDBProcessingExtension{
+public class DefaultDatabindingExtension extends AbstractDBProcessingExtension {
+
-
public void engage() throws CodeGenerationException {
TypeMapper mappper = configuration.getTypeMapper();
- if (testFallthrough(configuration.getDatabindingType())){
+ if (testFallthrough(configuration.getDatabindingType())) {
//if it's fall through for the default databinding extension and a mapper has
//not yet being set, then there's a problem.
//Hence check the mapper status here
- if (mappper==null){
+ if (mappper == null) {
//this shouldn't happen
throw new CodeGenerationException("No proper databinding has taken place");
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java Wed Dec 21 19:38:20 2005
@@ -17,12 +17,11 @@
package org.apache.axis2.wsdl.codegen.extension;
import org.apache.axis2.util.URLProcessor;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import org.apache.wsdl.WSDLBinding;
public class PackageFinder extends AbstractCodeGenerationExtension {
-
+
public void engage() {
String packageName = this.configuration.getPackageName();
if (packageName == null) {
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java?rev=358474&r1=358473&r2=358474&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java Wed Dec 21 19:38:20 2005
@@ -18,7 +18,6 @@
import org.apache.axis2.schema.CompilerOptions;
import org.apache.axis2.schema.SchemaCompiler;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
import org.apache.ws.commons.schema.XmlSchema;
@@ -38,7 +37,6 @@
/**
* Work in progress to test simple DataBinding with the XmlSchema lib
- *
*/
public class SimpleDBExtension extends AbstractDBProcessingExtension {
@@ -67,14 +65,13 @@
for (int i = 0; i < typesArray.size(); i++) {
extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
-
//add the namespace map here. it is absolutely needed
Map nsMap = configuration.getWom().getNamespaces();
Iterator keys = nsMap.keySet().iterator();
String key;
while (keys.hasNext()) {
key = (String) keys.next();
- schemaColl.mapNamespace(key,(String)nsMap.get(key));
+ schemaColl.mapNamespace(key, (String) nsMap.get(key));
}
Schema schema;
@@ -83,8 +80,8 @@
Stack importedSchemaStack = schema.getImportedSchemaStack();
//compile these schemas
while (!importedSchemaStack.isEmpty()) {
- Element el = (Element)importedSchemaStack.pop();
- if (el!=null){
+ Element el = (Element) importedSchemaStack.pop();
+ if (el != null) {
XmlSchema thisSchema = schemaColl.read(el);
xmlSchemaTypeVector.add(thisSchema);
}
@@ -109,8 +106,8 @@
Iterator processedkeys = processedMap.keySet().iterator();
QName qNameKey;
while (processedkeys.hasNext()) {
- qNameKey =(QName)processedkeys.next();
- mapper.addTypeMappingName(qNameKey,processedMap.get(qNameKey).toString());
+ qNameKey = (QName) processedkeys.next();
+ mapper.addTypeMappingName(qNameKey, processedMap.get(qNameKey).toString());
}
//set the type mapper to the config