當前位置: 首頁>>代碼示例>>Java>>正文


Java XPathReader.setXPathHandler方法代碼示例

本文整理匯總了Java中org.jaxen.saxpath.base.XPathReader.setXPathHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java XPathReader.setXPathHandler方法的具體用法?Java XPathReader.setXPathHandler怎麽用?Java XPathReader.setXPathHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jaxen.saxpath.base.XPathReader的用法示例。


在下文中一共展示了XPathReader.setXPathHandler方法的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: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: createPrimaryAssocTypeQNameQuery

import org.jaxen.saxpath.base.XPathReader; //導入方法依賴的package包/類
protected Query createPrimaryAssocTypeQNameQuery(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();
    query.setPathField(FIELD_PATH);
    query.setQnameField(FIELD_PRIMARYASSOCTYPEQNAME);
    return query;
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:14,代碼來源:LuceneQueryParser.java


注:本文中的org.jaxen.saxpath.base.XPathReader.setXPathHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。