本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
示例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]");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}