You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/01/06 07:47:52 UTC

svn commit: r731848 - /activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java

Author: davsclaus
Date: Mon Jan  5 22:47:52 2009
New Revision: 731848

URL: http://svn.apache.org/viewvc?rev=731848&view=rev
Log:
Polished code so its immutable (no setters)

Modified:
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java?rev=731848&r1=731847&r2=731848&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java (original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java Mon Jan  5 22:47:52 2009
@@ -32,7 +32,7 @@
 
 /**
  * A helper class which provides a JAXP {@link javax.xml.transform.Source Source} from a String which can
- * be read as many times as required.
+ * be read as many times as required. Encoding is default UTF-8.
  *
  * @version $Revision$
  */
@@ -50,13 +50,14 @@
 
     public StringSource(String text, String systemId) {
         this(text);
+        ObjectHelper.notNull(systemId, "systemId");
         setSystemId(systemId);
     }
 
     public StringSource(String text, String systemId, String encoding) {
-        this.text = text;
+        this(text, systemId);
+        ObjectHelper.notNull(encoding, "encoding");
         this.encoding = encoding;
-        setSystemId(systemId);
     }
 
     public InputStream getInputStream() {
@@ -83,10 +84,16 @@
         return encoding;
     }
 
+    /**
+     * @deprecated will be removed in Camel 2.0
+     */
     public void setEncoding(String encoding) {
         this.encoding = encoding;
     }
 
+    /**
+     * @deprecated will be removed in Camel 2.0
+     */
     public void setText(String text) {
         this.text = text;
     }