{
throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
"' contains one or more illegal characters ('//', '*', '|' or '.')." );
}
StringTokenizer pathTokenizer = new StringTokenizer( topicPath.getLocalPart(), "/" );
TopicSet topicSet = topicSpace;
boolean resolvedPath = true;
while ( pathTokenizer.hasMoreTokens() )
{
String name = pathTokenizer.nextToken();
if ( ! topicSet.containsTopic( name ) )
{
resolvedPath = false;
break;
}
topicSet = topicSet.getTopic( name );
}
if ( resolvedPath ) { matchedTopics.add( topicSet ); }
return matchedTopics;
}