String params)
throws RegainException
{
String packageName = (String) mNamespaceHash.get(namespace);
if (packageName == null) {
throw new RegainException("Unknown tag namespace: '" + namespace + "'");
}
String className = packageName;
// Add the sub packages (E.g. stats_size)
int linePos;
String cutTagName = tagName;
while ((linePos = cutTagName.indexOf('_')) != -1) {
className += "." + cutTagName.substring(0, linePos);
cutTagName = cutTagName.substring(linePos + 1);
}
// Add the className
className += "." + Character.toUpperCase(cutTagName.charAt(0))
+ cutTagName.substring(1) + "Tag";
// Get the tag class
Class tagClass;
try {
tagClass = Class.forName(className);
}
catch (ClassNotFoundException exc) {
throw new RegainException("Class for tag " + namespace + ":" + tagName
+ " not found: " + className, exc);
}
// Create the tag instance
SharedTag tag;
try {
tag = (SharedTag) tagClass.newInstance();
}
catch (Exception exc) {
throw new RegainException("Creating tag instance for tag " + namespace
+ ":" + tagName + " could not be created: " + className, exc);
}
// Set the params
int pos = 0;