Package org.apache.ws.notification.topics.expression

Examples of org.apache.ws.notification.topics.expression.InvalidTopicExpressionException


        if ( topicPath.getLocalPart().indexOf( "/" ) != -1 ||
             topicPath.getLocalPart().indexOf( "*" ) != -1 ||
             topicPath.getLocalPart().indexOf( "|" ) != -1 ||
             topicPath.getLocalPart().indexOf( "." ) != -1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
                    "' contains one or more illegal characters ('/', '*', '|' or '.')." );
        }
        String name = topicPath.getLocalPart();
        Topic topic = topicSpace.getTopic( name );
        if ( topic != null )
View Full Code Here


            List matchedTopics = evaluateTopicPath( topicSpaceSet, topicPath );
            allMatchedTopics.addAll( matchedTopics );
        }
        if ( topicSpaceSet.isFixed() && allMatchedTopics.isEmpty() )
        {
            throw new InvalidTopicExpressionException( "Full topic expression '" + expr +
                    "' does not match any topics, and the target topic set is fixed." );
        }
        return (Topic[]) allMatchedTopics.toArray( new Topic[0] );
    }
View Full Code Here

    {
        List matchedTopics = new ArrayList();
        TopicSpace topicSpace = getTopicSpace( topicSpaceSet, topicPath );
        if ( topicPath.getLocalPart().indexOf( "///" ) != -1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
                    "' contains an empty path component." );
        }
        PathTokenizer pathTokenizer = new PathTokenizer( topicPath.getLocalPart() );
        List topicSetsToSearch = new ArrayList();
        topicSetsToSearch.add( topicSpace );
        boolean atFirstToken = true;
        while ( pathTokenizer.hasMoreTokens() )
        {
            String pathToken = pathTokenizer.nextToken();
            matchedTopics.clear();
            for ( int i = 0; i < topicSetsToSearch.size(); i++ )
            {
                TopicSet topicSetToSearch = (TopicSet) topicSetsToSearch.get( i );
                boolean recurse = pathToken.startsWith( "/" );
                String name = recurse ? pathToken.substring( 1 ) : pathToken;
                matchedTopics.addAll( findTopics( topicSetToSearch, name, recurse ) );
            }
            if ( atFirstToken && matchedTopics.isEmpty() )
            {
                throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
                        "' refers to a root topic that is not defined in the referenced topic space." );
            }
            topicSetsToSearch.clear();
            topicSetsToSearch.addAll( matchedTopics );
            atFirstToken = false;
View Full Code Here

                {
                    newPos += 2;
                }
                if ( m_path.charAt( newPos ) == '.' )
                {
                    throw new InvalidTopicExpressionException(
                            "'.' may not be used as the first component of a topic path." );
                }
            }
            else
            {
View Full Code Here

            InvalidTopicExpressionException,
            TopicExpressionException
    {
        if ( topicExpression == null )
        {
            throw new InvalidTopicExpressionException"nullArgument"+"topicExpression"  );
        }

        if ( topicExpression.getDialect() == null )
        {
            throw new org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException(
View Full Code Here

            throw new TopicExpressionException( "This evaluator requires the TopicExpression content to be a String." );
        }
        String expr = (String) topicExpr.getContent();
        if ( StringUtils.isEmpty( expr ) || !StringUtils.containsNone( expr, " \t\n\r\f" ) )
        {
            throw new InvalidTopicExpressionException( "Full topic expression contains whitespace." );
        }
        return expr;
    }
View Full Code Here

            prefix = "";
            localPart = topicPath;
        }
        else if ( i == 0 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' starts with a colon." );
        }
        else if ( i == topicPath.length() - 1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' ends with a colon." );
        }
        else
        {
            prefix = topicPath.substring( 0, i );
            localPart = topicPath.substring( i + 1 );
            if ( localPart.indexOf( ':' ) != -1 )
            {
                throw new InvalidTopicExpressionException( "Local part of topic path '" + topicPath + "' contains a colon." );
            }
        }
        String nsURI = nsContext.getNamespaceURI( prefix );
        return new QName( nsURI, localPart, prefix );
    }
View Full Code Here

            throw new TopicExpressionException( "This evaluator requires the TopicExpression content to be a String." );
        }
        String expr = (String) topicExpr.getContent();
        if ( StringUtils.isEmpty( expr ) || !StringUtils.containsNone( expr, " \t\n\r\f" ) )
        {
            throw new InvalidTopicExpressionException( "Full topic expression contains whitespace." );
        }
        return expr;
    }
View Full Code Here

            prefix = "";
            localPart = topicPath;
        }
        else if ( i == 0 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' starts with a colon." );
        }
        else if ( i == topicPath.length() - 1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' ends with a colon." );
        }
        else
        {
            prefix = topicPath.substring( 0, i );
            localPart = topicPath.substring( i + 1 );
            if ( localPart.indexOf( ':' ) != -1 )
            {
                throw new InvalidTopicExpressionException( "Local part of topic path '" + topicPath + "' contains a colon." );
            }
        }
        String nsURI = nsContext.getNamespaceURI( prefix );
        return new QName( nsURI, localPart, prefix );
    }
View Full Code Here

        if ( topicPath.getLocalPart().indexOf( "//" ) != -1 ||
             topicPath.getLocalPart().indexOf( "*" ) != -1 ||
             topicPath.getLocalPart().indexOf( "|" ) != -1 ||
             topicPath.getLocalPart().indexOf( "." ) != -1 )
        {
            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;
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.topics.expression.InvalidTopicExpressionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.