package mir.util;
+import multex.Failure;
+import multex.Exc;
+
import java.util.*;
public class ParameterExpander {
location = location + part;
if (node == null) {
- throw new Exception( "Can't expand key " + aKey + ": "+ location + " does not exist" );
+ throw new ParameterExpanderExc( "Can't expand key {1}: {2} does not exist", new Object[]{aKey,location} );
}
}
}
if (!(node instanceof String))
- throw new Exception( "Can't expand key " + aKey + ": "+ location + " is not a string but a " + node.getClass().getName() );
+ throw new ParameterExpanderExc( "Can't expand key {1}: {2} is not a string but a {3}", new Object[]{aKey,location,node.getClass().getName()} );
return (String) node;
}
previousPosition=endOfNamePosition+1;
}
else {
- throw new Exception("Missing } in " + anExpression);
+ throw new ParameterExpanderExc("Missing } in {1}",new Object[]{anExpression});
}
}
else
return result.toString();
}
+
+ public static class ParameterExpanderExc extends Exc {
+ public ParameterExpanderExc(String msg, Object[] objects) {
+ super(msg, objects);
+ }
+ }
}