minchau 2005/03/07 12:34:36
Modified: java/src/org/apache/xml/serializer/utils MsgKey.java
SerializerMessages.java
java/src/org/apache/xml/serializer SerializerFactory.java
Log:
Fix for XALANJ-2074, committing patch2 in that issue, which removes two
untranslated messages in SerializerFactory, and uses a new common message
in SerializerMessages.
Revision Changes Path
1.3 +2 -1
xml-xalan/java/src/org/apache/xml/serializer/utils/MsgKey.java
Index: MsgKey.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/serializer/utils/MsgKey.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MsgKey.java 2 Mar 2005 23:08:08 -0000 1.2
+++ MsgKey.java 7 Mar 2005 20:34:36 -0000 1.3
@@ -92,4 +92,5 @@
"ER_NO_USERINFO_IF_NO_HOST";
public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
public static final String ER_XML_VERSION_NOT_SUPPORTED =
"ER_XML_VERSION_NOT_SUPPORTED";
+ public static final String ER_FACTORY_PROPERTY_MISSING =
"ER_FACTORY_PROPERTY_MISSING";
}
1.7 +10 -2
xml-xalan/java/src/org/apache/xml/serializer/utils/SerializerMessages.java
Index: SerializerMessages.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/serializer/utils/SerializerMessages.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SerializerMessages.java 2 Mar 2005 23:08:08 -0000 1.6
+++ SerializerMessages.java 7 Mar 2005 20:34:36 -0000 1.7
@@ -183,7 +183,15 @@
"Warning: The version of the output document is requested
to be ''{0}''. This version of XML is not supported. The version of the
output document will be ''1.0''." },
{ MsgKey.ER_SCHEME_REQUIRED,
- "Scheme is required!" }
+ "Scheme is required!" },
+
+ /*
+ * Note to translators: The words 'Properties' and
+ * 'SerializerFactory' in this message are Java class names
+ * and should not be translated.
+ */
+ { MsgKey.ER_FACTORY_PROPERTY_MISSING,
+ "The Properties object passed to the SerializerFactory does
not have a ''{0}'' property." },
};
1.9 +14 -8
xml-xalan/java/src/org/apache/xml/serializer/SerializerFactory.java
Index: SerializerFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/serializer/SerializerFactory.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SerializerFactory.java 16 Dec 2004 19:24:08 -0000 1.8
+++ SerializerFactory.java 7 Mar 2005 20:34:36 -0000 1.9
@@ -93,9 +93,12 @@
{
String method = format.getProperty(OutputKeys.METHOD);
- if (method == null)
- throw new IllegalArgumentException(
- "The output format has a null method name");
+ if (method == null) {
+ String msg = Utils.messages.createMessage(
+ MsgKey.ER_FACTORY_PROPERTY_MISSING,
+ new Object[] { OutputKeys.METHOD});
+ throw new IllegalArgumentException(msg);
+ }
String className =
format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER);
@@ -108,10 +111,13 @@
OutputPropertiesFactory.getDefaultMethodProperties(method);
className =
methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER);
- if (null == className)
- throw new IllegalArgumentException(
- "The output format must have a '"
- + OutputPropertiesFactory.S_KEY_CONTENT_HANDLER + "'
property!");
+ if (null == className) {
+ String msg = Utils.messages.createMessage(
+ MsgKey.ER_FACTORY_PROPERTY_MISSING,
+ new Object[] {
OutputPropertiesFactory.S_KEY_CONTENT_HANDLER});
+ throw new IllegalArgumentException(msg);
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]