当前位置: 首页>>代码示例>>Java>>正文


Java XPathReader.parse方法代码示例

本文整理汇总了Java中org.jaxen.saxpath.base.XPathReader.parse方法的典型用法代码示例。如果您正苦于以下问题:Java XPathReader.parse方法的具体用法?Java XPathReader.parse怎么用?Java XPathReader.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jaxen.saxpath.base.XPathReader的用法示例。


在下文中一共展示了XPathReader.parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAssocTypeQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createAssocTypeQNameQuery(String queryText) throws SAXPathException
{
    // This was broken and using only FIELD_PRIMARYASSOCTYPEQNAME
    // The field was also not indexed correctly.
    // We do both for backward compatability ...
    BooleanQuery booleanQuery = new BooleanQuery();

    XPathReader reader = new XPathReader();
    SolrXPathHandler handler = new SolrXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse("//" + queryText);
    SolrPathQuery pathQuery = handler.getQuery();
    pathQuery.setPathField(FIELD_ASSOCTYPEQNAME);

    booleanQuery.add(new SolrCachingPathQuery(pathQuery), Occur.SHOULD);
    booleanQuery.add(createPrimaryAssocTypeQNameQuery(queryText), Occur.SHOULD);

    return getNonEmptyBooleanQuery(booleanQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:22,代码来源:SolrQueryParser.java

示例2: createAssocTypeQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createAssocTypeQNameQuery(String queryText) throws SAXPathException
{
    // This was broken and using only FIELD_PRIMARYASSOCTYPEQNAME
    // The field was also not indexed correctly.
    // We do both for backward compatability ...
    BooleanQuery booleanQuery = new BooleanQuery();

    XPathReader reader = new XPathReader();
    LuceneXPathHandler handler = new LuceneXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse("//" + queryText);
    PathQuery query = handler.getQuery();
    query.setPathField(FIELD_PATH);
    query.setQnameField(FIELD_ASSOCTYPEQNAME);

    booleanQuery.add(query, Occur.SHOULD);
    booleanQuery.add(createPrimaryAssocTypeQNameQuery(queryText), Occur.SHOULD);

    return booleanQuery;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:23,代码来源:LuceneQueryParser.java

示例3: createQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createQNameQuery(String queryText) throws SAXPathException
{
    XPathReader reader = new XPathReader();
    LuceneXPathHandler handler = new LuceneXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse(queryText);
    PathQuery query = handler.getQuery();
    // if it matches all docs
    if ((query.getPathStructuredFieldPositions().size() == 0) && (query.getQNameStructuredFieldPositions().size() == 2))
    {
        if (query.getQNameStructuredFieldPositions().get(0).getTermText().equals(PathTokenFilter.NO_NS_TOKEN_TEXT))
        {
            return createTermQuery(FIELD_QNAME, queryText);
        }
    }

    return createPathQuery("//" + queryText, false);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:21,代码来源:LuceneQueryParser.java

示例4: getPathQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
static Query getPathQuery(String path) throws SAXPathException
{
    ApplicationContext ac = ApplicationContextHelper.getApplicationContext();
    XPathReader reader = new XPathReader();
    LuceneXPathHandler handler = new LuceneXPathHandler();
    handler.setNamespacePrefixResolver((NamespaceService) ac.getBean("namespaceService"));
    handler.setDictionaryService((DictionaryService) ac.getBean("dictionaryService"));
    reader.setXPathHandler(handler);
    reader.parse(path);
    PathQuery pathQuery = handler.getQuery();
    pathQuery.setRepeats(false);
    return pathQuery;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:IndexInfo.java

示例5: main

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
/**
 * @param args String[]
 * @throws SAXPathException
 */
public static void main(String[] args) throws SAXPathException
{
    XPathReader reader = new XPathReader();
    reader.setXPathHandler(new DebugXPathHandler());
    reader
            .parse("/ns:one[@woof='dog']/two/./../two[functionTest(@a, @b, $woof:woof)]/three/*/four//*/five/six[@exists1 and @exists2]");
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:DebugXPathHandler.java

示例6: isValidXpathQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
/**
 * Validation Xpath query
 * 
 * @param query xpath query
 * @return true if xpath query valid
 */
public boolean isValidXpathQuery(String query)
{
    try
    {
        XPathReader reader = new XPathReader();
        reader.parse(query);
    }
    catch (Exception e)
    {
        return false;
    }
    return true;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:Search.java

示例7: createPathQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createPathQuery(String queryText, boolean withRepeats) throws SAXPathException
{
	XPathReader reader = new XPathReader();
	SolrXPathHandler handler = new SolrXPathHandler();
	handler.setNamespacePrefixResolver(namespacePrefixResolver);
	handler.setDictionaryService(dictionaryService);
	reader.setXPathHandler(handler);
	reader.parse(queryText);
	SolrPathQuery pathQuery = handler.getQuery();
	pathQuery.setRepeats(withRepeats);
	return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:13,代码来源:Solr4QueryParser.java

示例8: createQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createQNameQuery(String queryText) throws SAXPathException
{
	XPathReader reader = new XPathReader();
	SolrXPathHandler handler = new SolrXPathHandler();
	handler.setNamespacePrefixResolver(namespacePrefixResolver);
	handler.setDictionaryService(dictionaryService);
	reader.setXPathHandler(handler);
	reader.parse("//" + queryText);
	SolrPathQuery pathQuery = handler.getQuery();
	return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:12,代码来源:Solr4QueryParser.java

示例9: createPrimaryAssocQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createPrimaryAssocQNameQuery(String queryText) throws SAXPathException
{
	XPathReader reader = new XPathReader();
	SolrXPathHandler handler = new SolrXPathHandler();
	handler.setNamespacePrefixResolver(namespacePrefixResolver);
	handler.setDictionaryService(dictionaryService);
	reader.setXPathHandler(handler);
	reader.parse("//" + queryText);
	SolrPathQuery pathQuery = handler.getQuery();
	pathQuery.setPathField(FIELD_PRIMARYASSOCQNAME);
	return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:13,代码来源:Solr4QueryParser.java

示例10: createPrimaryAssocTypeQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createPrimaryAssocTypeQNameQuery(String queryText) throws SAXPathException
{
	XPathReader reader = new XPathReader();
	SolrXPathHandler handler = new SolrXPathHandler();
	handler.setNamespacePrefixResolver(namespacePrefixResolver);
	handler.setDictionaryService(dictionaryService);
	reader.setXPathHandler(handler);
	reader.parse("//" + queryText);
	SolrPathQuery pathQuery = handler.getQuery();
	pathQuery.setPathField(FIELD_PRIMARYASSOCTYPEQNAME);
	return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:13,代码来源:Solr4QueryParser.java

示例11: createAssocTypeQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createAssocTypeQNameQuery(String queryText) throws SAXPathException
{   
	XPathReader reader = new XPathReader();
	SolrXPathHandler handler = new SolrXPathHandler();
	handler.setNamespacePrefixResolver(namespacePrefixResolver);
	handler.setDictionaryService(dictionaryService);
	reader.setXPathHandler(handler);
	reader.parse("//" + queryText);
	SolrPathQuery pathQuery = handler.getQuery();
	pathQuery.setPathField(FIELD_ASSOCTYPEQNAME);
	return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:13,代码来源:Solr4QueryParser.java

示例12: createPathQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
@Override
protected Query createPathQuery(String queryText, boolean withRepeats) throws SAXPathException
{
    XPathReader reader = new XPathReader();
    SolrXPathHandler handler = new SolrXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse(queryText);
    SolrPathQuery pathQuery = handler.getQuery();
    pathQuery.setRepeats(withRepeats);
    return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:14,代码来源:SolrQueryParser.java

示例13: createQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createQNameQuery(String queryText) throws SAXPathException
{
    XPathReader reader = new XPathReader();
    SolrXPathHandler handler = new SolrXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse("//" + queryText);
    SolrPathQuery pathQuery = handler.getQuery();
    return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:12,代码来源:SolrQueryParser.java

示例14: createPrimaryAssocQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createPrimaryAssocQNameQuery(String queryText) throws SAXPathException
{
    XPathReader reader = new XPathReader();
    SolrXPathHandler handler = new SolrXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse("//" + queryText);
    SolrPathQuery pathQuery = handler.getQuery();
    pathQuery.setPathField(FIELD_PRIMARYASSOCQNAME);
    return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:13,代码来源:SolrQueryParser.java

示例15: createPrimaryAssocTypeQNameQuery

import org.jaxen.saxpath.base.XPathReader; //导入方法依赖的package包/类
protected Query createPrimaryAssocTypeQNameQuery(String queryText) throws SAXPathException
{
    XPathReader reader = new XPathReader();
    SolrXPathHandler handler = new SolrXPathHandler();
    handler.setNamespacePrefixResolver(namespacePrefixResolver);
    handler.setDictionaryService(dictionaryService);
    reader.setXPathHandler(handler);
    reader.parse("//" + queryText);
    SolrPathQuery pathQuery = handler.getQuery();
    pathQuery.setPathField(FIELD_PRIMARYASSOCTYPEQNAME);
    return new SolrCachingPathQuery(pathQuery);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:13,代码来源:SolrQueryParser.java


注:本文中的org.jaxen.saxpath.base.XPathReader.parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。