ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1551645 - /webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchema.java
Date Tue, 17 Dec 2013 18:17:54 GMT
Author: veithen
Date: Tue Dec 17 18:17:54 2013
New Revision: 1551645

URL: http://svn.apache.org/r1551645
Log:
Not sure why we have a (non static) XmlSchema#serializeInternal(XmlSchema, Writer, Map<String,String>)
method. That doesn't look like proper OO design. Remove the XmlSchema parameter and instead
use "this".

Modified:
    webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchema.java

Modified: webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchema.java
URL: http://svn.apache.org/viewvc/webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchema.java?rev=1551645&r1=1551644&r2=1551645&view=diff
==============================================================================
--- webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchema.java
(original)
+++ webservices/xmlschema/trunk/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchema.java
Tue Dec 17 18:17:54 2013
@@ -581,7 +581,7 @@ public class XmlSchema extends XmlSchema
      * @param writer - the writer to write this
      */
     public void write(Writer writer) {
-        serializeInternal(this, writer, null);
+        serializeInternal(writer, null);
     }
 
     /**
@@ -590,7 +590,7 @@ public class XmlSchema extends XmlSchema
      * @param writer - the writer to write this
      */
     public void write(Writer writer, Map<String, String> options) {
-        serializeInternal(this, writer, options);
+        serializeInternal(writer, options);
     }
 
     protected XmlSchemaAttribute getAttributeByName(QName name, boolean deep, Stack<XmlSchema>
schemaStack) {
@@ -868,16 +868,15 @@ public class XmlSchema extends XmlSchema
     /**
      * serialize the schema - this is the method tht does to work
      *
-     * @param schema
      * @param out
      * @param options
      */
-    private void serializeInternal(XmlSchema schema, Writer out, Map<String, String>
options) {
+    private void serializeInternal(Writer out, Map<String, String> options) {
 
         try {
             XmlSchemaSerializer xser = new XmlSchemaSerializer();
             xser.setExtReg(this.parent.getExtReg());
-            Document[] serializedSchemas = xser.serializeSchema(schema, false);
+            Document[] serializedSchemas = xser.serializeSchema(this, false);
             TransformerFactory trFac = TransformerFactory.newInstance();
 
             try {
@@ -892,8 +891,8 @@ public class XmlSchema extends XmlSchema
             javax.xml.transform.Transformer tr = trFac.newTransformer();
 
             // use the input encoding if there is one
-            if (schema.inputEncoding != null && !"".equals(schema.inputEncoding))
{
-                tr.setOutputProperty(OutputKeys.ENCODING, schema.inputEncoding);
+            if (this.inputEncoding != null && !"".equals(this.inputEncoding)) {
+                tr.setOutputProperty(OutputKeys.ENCODING, this.inputEncoding);
             }
 
             // let these be configured from outside if any is present



Mime
View raw message