Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathContext.selectSingleNode()


        try {
            JXPathContext jxContext = JXPathContext.newContext(contextObj);
            setup(setup, jxContext, modeConf);

            return jxContext.selectSingleNode(name);
        } catch (Exception e) {
            throw new ConfigurationException("Module does not support <" + name + ">" + "attribute.", e);
        }
    }
View Full Code Here


        try {
            JXPathContext jxContext = JXPathContext.newContext(contextObj);
            setup(setup, jxContext, modeConf);

            return jxContext.selectSingleNode(name);
        } catch (Exception e) {
            throw new ConfigurationException("Module does not support <" + name + ">" + "attribute.", e);
        }
    }
View Full Code Here

        }

        try {
            JXPathContext jxContext = JXPathContext.newContext(contextObj);
            setup(setup, jxContext, modeConf);
            return jxContext.selectSingleNode(name);
        } catch (Exception e) {
            throw new ConfigurationException("Module does not support <" + name + ">" + "attribute.", e);
        }
    }
View Full Code Here

        JXPathContext context = JXPathContext.newContext(root);
        for (JavaSourceTokenType tokenType : POSSIBLE_CLASS_DECLARATION_TYPES) {
            try {
                final String tokenName = tokenType.name();
                final Element element = (Element) context.selectSingleNode("/" + JAVA_SOURCE_ROOT_ELEMENT_NAME + "/" + tokenName);
                if (element != null) {
                    classDeclaration = new ClassDeclarationJdom(element, getDeclarationType(tokenType), null);
                }
            }
            catch (JXPathException e) {
View Full Code Here

    private PackageDeclaration parsePackageDeclaration() {
        try {
            JXPathContext context = JXPathContext.newContext(root);
            packageDeclaration = new PackageDeclarationJdom((Element)
                                                                    context.selectSingleNode("/" + JAVA_SOURCE_ROOT_ELEMENT_NAME + "/" +
                                                                                                     JavaSourceTokenType.PACKAGE.name()));
        }
        catch (JXPathException e) {
            packageDeclaration = new PackageDeclarationJdom();
        }
View Full Code Here

    public String getSuperClassName() {
        if (superClassName == NOT_RETRIEVED) {
            JXPathContext context = JXPathContext.newContext(classDeclElement);

            final Element superClassElement = (Element)
                    context.selectSingleNode("/" + EXTENDS_CLAUSE.getName() + "//" + IDENT.getName());
            superClassName = (null == superClassElement) ? null : superClassElement.getValue();
        }
        return superClassName;
    }
View Full Code Here

        }
    }

    private String getAnnotationValueForElement(final Element element) {
        final JXPathContext context = JXPathContext.newContext(element);
        final Element expr = (Element) context.selectSingleNode("/" + JavaSourceTokenType.EXPR.name() + "/*");
        if (expr != null) {
            return expr.getText();
        }
        else {
            final List<Element> exprList = context.selectNodes("//" + JavaSourceTokenType.EXPR.name() + "/*");
 
View Full Code Here

    public CodeBlock getImplementation() {
        if (methodCodeBlock == null) {
            try {
                JXPathContext context = JXPathContext.newContext(methodDeclElement);
                Element codeBlockElement = (Element) context.selectSingleNode("/" + JavaSourceTokenType.BLOCK_SCOPE.getName());
                methodCodeBlock = CodeBlockJdom.createMethodImplementation(codeBlockElement, this, classDeclaration);
            }
            catch (JXPathException e) {
                return null;
            }
View Full Code Here

      JXPathContextReferenceImpl.addNodePointerFactory(new FuzzyXMLNodePointerFactory());
    }
   
    public static FuzzyXMLNode selectSingleNode(FuzzyXMLElement element,String xpath){
        JXPathContext ctx = JXPathContext.newContext(element);
        return (FuzzyXMLNode)ctx.selectSingleNode(xpath);
    }

    @SuppressWarnings("unchecked")
    public static FuzzyXMLNode[] selectNodes(FuzzyXMLElement element,String xpath){
        JXPathContext ctx = JXPathContext.newContext(element);
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.