* makes sure appropriate namespaces exist for a name. isComponent indicates the
* name is for a component type, in which case we don't create a namespace for the
* last part
*/
public Namespace initNamespaceForName(String name, boolean isComponent) {
Namespace namespace = getRootNamespace();
StringTokenizer tokens = new StringTokenizer(name, ".");
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken();
if (tokens.hasMoreTokens() || !isComponent) {
//we don't want to create a namespace for a componentName
namespace = namespace.getOrCreateChild(token);
}
}
return namespace;
}