[prev in list] [next in list] [prev in thread] [next in thread]
List: wsf-c-dev
Subject: [Wsf-dev] [Jython] svn commit r67627 -
From: heshan () wso2 ! com
Date: 2010-06-05 4:05:24
Message-ID: E1OKkdQ-0003OQ-Sw () wso2 ! org
[Download RAW message or body]
Author: heshan
Date: Fri Jun 4 21:05:24 2010
New Revision: 67627
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=67627
Log:
Refactored code.
Modified:
trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java
trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/TypeTable.java
Modified: trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/jython/server/core/src/main/java/org/ws \
o2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java?rev=67627&r1=67626&r2=67627&view=diff
==============================================================================
--- trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java (original)
+++ trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java Fri \
Jun 4 21:05:24 2010 @@ -30,7 +30,6 @@
import org.apache.ws.commons.schema.utils.NamespaceMap;
import javax.xml.namespace.QName;
-import java.util.Iterator;
/**
* Schema generation class.
@@ -47,8 +46,6 @@
private TypeTable typeTable;
- private String DEFAULT_SCHEMA_NAMESPACE_PREFIX = "xs";
- private String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
private String RESPONSE = "Response";
public NamespaceMap getNamespaceMap() {
@@ -65,8 +62,9 @@
xmlSchema.setAttributeFormDefault(new \
XmlSchemaForm(XmlSchemaForm.UNQUALIFIED));
xmlSchema.setElementFormDefault(new \
XmlSchemaForm(XmlSchemaForm.UNQUALIFIED));
- nameSpacesMap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX,
- URI_2001_SCHEMA_XSD);
+ String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
+ String DEFAULT_SCHEMA_NAMESPACE_PREFIX = "xs";
+ nameSpacesMap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD);
nameSpacesMap.put(prefix, this.schemaTargetNamespace);
xmlSchema.setNamespaceContext(nameSpacesMap);
}
@@ -129,17 +127,15 @@
xmlSchema.getItems().add(xmlSchemaComplexType);
XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
- Iterator<Type> iterator = complexType.getMembers().iterator();
- while (iterator.hasNext()) {
- Object object = iterator.next();
+ for (Type type : complexType.getMembers()) {
XmlSchemaElement xmlSchemaElement;
- if (object instanceof SimpleType) {
- SimpleType simpleType = (SimpleType) object;
+ if (type instanceof SimpleType) {
+ SimpleType simpleType = (SimpleType) type;
if ((xmlSchemaElement = createXMLSchemaElement(simpleType.getName(), \
simpleType.getType())) != null) { \
xmlSchemaSequence.getItems().add(xmlSchemaElement); }
- } else if (object instanceof ComplexType) {
- ComplexType complexTypeParam = (ComplexType) object;
+ } else if (type instanceof ComplexType) {
+ ComplexType complexTypeParam = (ComplexType) type;
if ((xmlSchemaElement = handleComplexType(complexTypeParam, \
elementName + complexTypeParam.getName() + TYPE)) != null) {
xmlSchemaElement.setName(complexTypeParam.getName());
Modified: trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/TypeTable.java
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/jython/server/core/src/main/java/org/ws \
o2/wsf/jython/deployer/schemagenarator/TypeTable.java?rev=67627&r1=67626&r2=67627&view=diff
==============================================================================
--- trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/TypeTable.java (original)
+++ trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/TypeTable.java Fri \
Jun 4 21:05:24 2010 @@ -19,8 +19,7 @@
import javax.xml.namespace.QName;
import java.util.HashMap;
-public abstract class
- TypeTable {
+public abstract class TypeTable {
protected HashMap simpleTypetoxsd;
protected HashMap complexTypeMap;
_______________________________________________
Wsf-dev mailing list
Wsf-dev@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/wsf-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic