Examples of JXPathContext


Examples of org.apache.commons.jxpath.JXPathContext

            new Integer(1),
            "/nestedBean/int");
    }

    public void testRelativeContextAbsolutePath() {
        JXPathContext relative =
            context.getRelativeContext(context.getPointer("nestedBean"));
       
        assertXPathValueAndPointer(relative,
            "/integers[2]",
            new Integer(2),
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

            new Integer(2),
            "/integers[2]");
    }

    public void testRelativeContextParent() {
        JXPathContext relative =
            context.getRelativeContext(context.getPointer("nestedBean"));
       
        assertXPathValueAndPointer(relative,
            "../integers[2]",
            new Integer(2),
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

        ValidationResult vres = new ValidationResult();

        if (patterns!=null) {
            // create the JXPathContext
            // which will be used to validate each rule
            JXPathContext jxpContext = JXPathContext.newContext(jbean);

            Iterator iter = patterns.iterator();

            while (iter.hasNext()) {
                Pattern resultPattern = evalPattern(jxpContext,
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

            Rule nextFailedRule = new Rule();

            nextFailedRule.setContext(ptr.asPath());

            // switch to the context of the rule
            JXPathContext localJxpContext = JXPathContext.newContext(jxpContext,
                                                ptr.getValue());

            // evaluate asserts
            Iterator assertIter = rule.getAssert().iterator();
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

        Element root = doc.createElement("root");
        Element schemaElement = doc.getDocumentElement();

        schemaPrefix_ = schemaElement.getPrefix();
        root.appendChild(schemaElement);
        JXPathContext jxpContext = JXPathContext.newContext(root);

        jxpContext.setLenient(false);

        // Bind sch:schema element

        // schema title
        String title = (String) jxpContext.getValue("/schema/title",
                                                    String.class);

        schema.setTitle(title);
        logger.debug("Schema title: "+schema.getTitle());
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

        ValidationResult vres = new ValidationResult();

        if (patterns!=null) {
            // create the JXPathContext
            // which will be used to validate each rule
            JXPathContext jxpContext = JXPathContext.newContext(jbean);

            Iterator iter = patterns.iterator();

            while (iter.hasNext()) {
                Pattern resultPattern = evalPattern(jxpContext,
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

            Rule nextFailedRule = new Rule();

            nextFailedRule.setContext(ptr.asPath());

            // switch to the context of the rule
            JXPathContext localJxpContext = JXPathContext.newContext(jxpContext,
                                                ptr.getValue());

            // evaluate asserts
            Iterator assertIter = rule.getAssert().iterator();
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

        Element root = doc.createElement("root");
        Element schemaElement = doc.getDocumentElement();

        schemaPrefix_ = schemaElement.getPrefix();
        root.appendChild(schemaElement);
        JXPathContext jxpContext = JXPathContext.newContext(root);

        jxpContext.setLenient(false);

        // Bind sch:schema element

        // schema title
        String title = (String) jxpContext.getValue("/schema/title",
                                                    String.class);

        schema.setTitle(title);
        logger.debug("Schema title: "+schema.getTitle());
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

        JXPathIntrospector.registerDynamicClass(HttpContext.class, CocoonContextHandler.class);
    }
   
    public final JXPathContext getVariableContext() {
        if (variableContext == null) {
            JXPathContext parentContext = getRequestContext();
            variableContext = factory.newContext(parentContext, null);
        }
        return variableContext;
    }
View Full Code Here

Examples of org.apache.commons.jxpath.JXPathContext

     * Returns a JXPathContext bound to the "request" scope. Caches that context
     * within the request itself.
     */
    public final JXPathContext getRequestContext() {
        Request request = ObjectModelHelper.getRequest(objectModel);
        JXPathContext context = (JXPathContext) request.getAttribute(Constants.JXPATH_CONTEXT);
        if (context == null) {
            Context cocoonContext = ObjectModelHelper.getContext(objectModel);
            JXPathContext parentContext = null;
            Session session = request.getSession(false);
            if (session != null) {
                parentContext = getSessionContext(session, cocoonContext);
            } else {
                parentContext = getApplicationContext(cocoonContext);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.