Package org.jaxen.saxpath

Examples of org.jaxen.saxpath.XPathReader


        }
    }

    public void testValidExplicit() throws SAXPathException
    {
        XPathReader reader = XPathReaderFactory.createReader( "org.jaxen.test.MockXPathReader" );
        assertNotNull( reader );
        assertSame( MockXPathReader.class, reader.getClass() );
    }
View Full Code Here


     */
    protected BaseXPath(String xpathExpr) throws JaxenException
    {
        try
        {
            XPathReader reader = XPathReaderFactory.createReader();
            JaxenHandler handler = new JaxenHandler();
            reader.setXPathHandler( handler );
            reader.parse( xpathExpr );
            this.xpath = handler.getXPathExpr();
        }
        catch (org.jaxen.saxpath.XPathSyntaxException e)
        {
            throw new org.jaxen.XPathSyntaxException( e );
View Full Code Here

     *          interface
     */
    public static XPathReader createReader(String className) throws SAXPathException
    {
        Class readerClass  = null;
        XPathReader reader = null;

        try
        {
            // Use the full version of Class.forName(), so as to
            // work better in sandboxed environments, such as
View Full Code Here

    private static final boolean USE_HANDLER = false;
    public static Pattern parse(String text) throws JaxenException, org.jaxen.saxpath.SAXPathException
    {
        if ( USE_HANDLER )
        {
            XPathReader reader = XPathReaderFactory.createReader();
            PatternHandler handler = new PatternHandler();      
           
            handler.setXPathFactory( new DefaultXPathFactory() );           
            reader.setXPathHandler( handler );
            reader.parse( text );
           
            return handler.getPattern();
        }
        else
        {
            XPathReader reader = XPathReaderFactory.createReader();
            JaxenHandler handler = new JaxenHandler();
           
            handler.setXPathFactory( new DefaultXPathFactory() );           
            reader.setXPathHandler( handler );
            reader.parse( text );

            Pattern pattern = convertExpr( handler.getXPathExpr().getRootExpr() );
            return pattern.simplify();
        }
    }
View Full Code Here

        if (xpathStr.length() == 0) {
            throw new CompilationException(__msgs.errXPathSyntax(xpathStr));
        }

        try {
            XPathReader reader = XPathReaderFactory.createReader();
            JaxenBpelHandler handler = new JaxenBpelHandler(_bpelNsURI, out, source.getNamespaceContext(),
                    _compilerContext);
            reader.setXPathHandler(handler);

            reader.parse(xpathStr);
            out.xpath = xpathStr;
        } catch (CompilationExceptionWrapper e) {
            CompilationException ce = e.getCompilationException();
            if (ce == null) {
                ce = new CompilationException(__msgs.errUnexpectedCompilationError(e.getMessage()), e);
View Full Code Here

     */
    protected BaseXPath(String xpathExpr) throws JaxenException
    {
        try
        {
            XPathReader reader = XPathReaderFactory.createReader();
            JaxenHandler handler = new JaxenHandler();
            reader.setXPathHandler( handler );
            reader.parse( xpathExpr );
            this.xpath = handler.getXPathExpr();
        }
        catch (org.jaxen.saxpath.XPathSyntaxException e)
        {
            throw new org.jaxen.XPathSyntaxException( e );
View Full Code Here

    private static final boolean USE_HANDLER = false;
    public static Pattern parse(String text) throws JaxenException, org.jaxen.saxpath.SAXPathException
    {
        if ( USE_HANDLER )
        {
            XPathReader reader = XPathReaderFactory.createReader();
            PatternHandler handler = new PatternHandler();      
           
            handler.setXPathFactory( new DefaultXPathFactory() );           
            reader.setXPathHandler( handler );
            reader.parse( text );
           
            return handler.getPattern();
        }
        else
        {
            XPathReader reader = XPathReaderFactory.createReader();
            JaxenHandler handler = new JaxenHandler();
           
            handler.setXPathFactory( new DefaultXPathFactory() );           
            reader.setXPathHandler( handler );
            reader.parse( text );

            Pattern pattern = convertExpr( handler.getXPathExpr().getRootExpr() );
            return pattern.simplify();
        }
    }
View Full Code Here

           
        String path = null;

        try
        {
            XPathReader reader = XPathReaderFactory.createReader();
           
            JaxenHandler handler = new JaxenHandler();
           
            handler.setXPathFactory( new DefaultXPathFactory() );
           
            reader.setXPathHandler( handler );

            for ( int i = 0; i < paths.length; i++ ) {
                path = paths[i];
               
                // System.err.println("-----------------");
                // System.err.println( "parsing: " + path );
                // System.err.println("-----------------");

                reader.parse(path);

                XPathExpr xpath = handler.getXPathExpr(false);

                // System.err.println("-----------------");
                // System.err.println( xpath.toString() );
View Full Code Here

    public void testBogusPaths()
    {
        try
        {
            XPathReader reader = XPathReaderFactory.createReader();
           
            JaxenHandler handler = new JaxenHandler();
           
            handler.setXPathFactory( new DefaultXPathFactory() );
           
            reader.setXPathHandler( handler );
           
            for ( int i = 0; i < bogusPaths.length; i++ ) {
                String path = bogusPaths[i];
               
                System.err.println("-----------------");
                System.err.println( "parsing bogus path : " + path );
                System.err.println("-----------------");

                try
                {                   
                    reader.parse(path);

                    XPathExpr xpath = handler.getXPathExpr(false);

                    System.err.println( "Parsed as: " + xpath );
                   
View Full Code Here

    {
        System.setProperty( XPathReaderFactory.DRIVER_PROPERTY,
                            "" );
        try
        {
            XPathReader reader = XPathReaderFactory.createReader();

            assertNotNull( reader );
        }
        catch (org.jaxen.saxpath.SAXPathException e)
        {
View Full Code Here

TOP

Related Classes of org.jaxen.saxpath.XPathReader

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.