Package com.envoisolutions.sxc.builder

Examples of com.envoisolutions.sxc.builder.ParserBuilder


   
    public void compileEventHandler(String expr, XPathEventHandler eventHandler) {
        String varName = "obj" + vars.size();
        vars.put(varName, eventHandler);
       
        ParserBuilder xpathBuilder = parserBldr;
        try {
            org.jaxen.saxpath.XPathReader reader = XPathReaderFactory.createReader();
           
            JaxenHandler handler = new JaxenHandler();
            reader.setXPathHandler(handler);
            reader.parse(expr);
           
            XPathExpr path = handler.getXPathExpr(true);
           
            Object o = handleExpression(parserBldr, path.getRootExpr());
            if (o instanceof ExpressionState) {
                ExpressionState exp = (ExpressionState) o;
                JVar var = exp.getVar();
                ParserBuilder builder = exp.getBuilder();
                JBlock block = builder.getBody().getBlock();
               
                xpathBuilder = builder.newState(block._if(var)._then());
            } else {
                xpathBuilder = (ParserBuilder) o;
            }
        } catch (SAXPathException e) {
            throw new XPathException(e);
View Full Code Here


   
    public void compileEventHandler(String expr, XPathEventHandler eventHandler) {
        String varName = "obj" + vars.size();
        vars.put(varName, eventHandler);
       
        ParserBuilder xpathBuilder = parserBldr;
        JBlock block;
        try {
            org.jaxen.saxpath.XPathReader reader = XPathReaderFactory.createReader();
           
            JaxenHandler handler = new JaxenHandler();
            reader.setXPathHandler(handler);
            reader.parse(expr);
           
            XPathExpr path = handler.getXPathExpr(true);
           
            Object o = handleExpression(parserBldr, path.getRootExpr());
            if (o instanceof ExpressionState) {
                ExpressionState exp = (ExpressionState) o;
                JVar var = exp.getVar();
                ParserBuilder builder = exp.getBuilder();
                block = builder.getBody().getBlock();
               
                block = block._if(var)._then();
            } else {
                xpathBuilder = (ParserBuilder) o;
                block = xpathBuilder.getBody().getBlock();
View Full Code Here

        Object leftObj = handleExpression(parent, expr.getLHS());
        ExpressionState right = (ExpressionState) handleExpression(parent, expr.getRHS());
       
        JVar leftVar;
        JVar rightVar;
        ParserBuilder parent2;
        if (leftObj instanceof ParserBuilder) {
            // We've got an attribute.. i.e. [@foo='bar']
            ParserBuilder attBuilder = (ParserBuilder) leftObj;
            leftVar = attBuilder.as(String.class);
            rightVar = attBuilder.passParentVariable(right.getVar());
            parent2 = attBuilder;
        } else {
            leftVar = ((ExpressionState) leftObj).getVar();
            rightVar = right.getVar();
            parent2 = parent;
View Full Code Here

            } else if (prop instanceof RuntimeAttributePropertyInfo) {
                // Handle an attribute
                RuntimeAttributePropertyInfo propAt = (RuntimeAttributePropertyInfo) prop;
                RuntimeNonElement target = propAt.getTarget();

                ParserBuilder attBuilder = classBuilder.expectAttribute(propAt.getXmlName());
                JVar propVar = attBuilder.passParentVariable(beanVar);
               
                if (propAt.isCollection()) {
                  logger.info("Reader: attribute lists are not supported yet!");
                } else {
                    handlePropertyAttribute(attBuilder, propVar, beanClass, propAt, target, set);
View Full Code Here

            } else if (prop instanceof RuntimeAttributePropertyInfo) {
                // Handle an attribute
                RuntimeAttributePropertyInfo propAt = (RuntimeAttributePropertyInfo) prop;
                RuntimeNonElement target = propAt.getTarget();

                ParserBuilder attBuilder = classBuilder.expectAttribute(propAt.getXmlName());
                JVar propVar = attBuilder.passParentVariable(beanVar);
               
                if (propAt.isCollection()) {
                  logger.info("Reader: attribute lists are not supported yet!");
                } else {
                    handlePropertyAttribute(attBuilder, propVar, beanClass, propAt, target, set);
View Full Code Here

   
    public void compileEventHandler(String expr, XPathEventHandler eventHandler) {
        String varName = "obj" + vars.size();
        vars.put(varName, eventHandler);
       
        ParserBuilder xpathBuilder = parserBldr;
        try {
            org.jaxen.saxpath.XPathReader reader = XPathReaderFactory.createReader();
           
            JaxenHandler handler = new JaxenHandler();
            reader.setXPathHandler(handler);
            reader.parse(expr);
           
            XPathExpr path = handler.getXPathExpr(true);
           
            Object o = handleExpression(parserBldr, path.getRootExpr());
            if (o instanceof ExpressionState) {
                ExpressionState exp = (ExpressionState) o;
                JVar var = exp.getVar();
                ParserBuilder builder = exp.getBuilder();
                JBlock block = builder.getBody().getBlock();
               
                xpathBuilder = builder.newState(block._if(var)._then());
            } else {
                xpathBuilder = (ParserBuilder) o;
            }
        } catch (SAXPathException e) {
            throw new XPathException(e);
View Full Code Here

   
    public void compileEventHandler(String expr, XPathEventHandler eventHandler) {
        String varName = "obj" + vars.size();
        vars.put(varName, eventHandler);
       
        ParserBuilder xpathBuilder = parserBldr;
        try {
            org.jaxen.saxpath.XPathReader reader = XPathReaderFactory.createReader();
           
            JaxenHandler handler = new JaxenHandler();
            reader.setXPathHandler(handler);
            reader.parse(expr);
           
            XPathExpr path = handler.getXPathExpr(true);
           
            Object o = handleExpression(parserBldr, path.getRootExpr());
            if (o instanceof ExpressionState) {
                ExpressionState exp = (ExpressionState) o;
                JVar var = exp.getVar();
                ParserBuilder builder = exp.getBuilder();
                JBlock block = builder.getBody().getBlock();
               
                xpathBuilder = builder.newState(block._if(var)._then());
            } else {
                xpathBuilder = (ParserBuilder) o;
            }
        } catch (SAXPathException e) {
            throw new XPathException(e);
View Full Code Here

TOP

Related Classes of com.envoisolutions.sxc.builder.ParserBuilder

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.