From fbe4de5323fdbacbc8836966159e35a331b7f4c1 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 28 Jan 2005 04:18:09 +0000 Subject: [PATCH] Added decompose to break a composed compound message back into individual strings and restore any previously escaped instances of the separator character. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1582 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/text/MessageUtil.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/projects/samskivert/src/java/com/samskivert/text/MessageUtil.java b/projects/samskivert/src/java/com/samskivert/text/MessageUtil.java index dd9b5d08..92855307 100644 --- a/projects/samskivert/src/java/com/samskivert/text/MessageUtil.java +++ b/projects/samskivert/src/java/com/samskivert/text/MessageUtil.java @@ -180,6 +180,19 @@ public class MessageUtil return compose(key, targs); } + /** + * Decomposes a compound key into its constituent parts. Arguments + * that were tainted during composition will remain tainted. + */ + public static String[] decompose (String compoundKey) + { + String[] args = StringUtil.split(compoundKey, "|"); + for (int ii = 0; ii < args.length; ii++) { + args[ii] = unescape(args[ii]); + } + return args; + } + /** * Returns a fully qualified message key which, when translated by * some other bundle, will know to resolve and utilize the supplied