本文整理汇总了Java中org.apache.xpath.XPath.getExpression方法的典型用法代码示例。如果您正苦于以下问题:Java XPath.getExpression方法的具体用法?Java XPath.getExpression怎么用?Java XPath.getExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xpath.XPath
的用法示例。
在下文中一共展示了XPath.getExpression方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAnalysisBits
import org.apache.xpath.XPath; //导入方法依赖的package包/类
/**
* Get the analysis bits for this walker, as defined in the WalkerFactory.
* @return One of WalkerFactory#BIT_DESCENDANT, etc.
*/
public int getAnalysisBits()
{
org.apache.xalan.templates.ElemVariable vvar = getElemVariable();
if(null != vvar)
{
XPath xpath = vvar.getSelect();
if(null != xpath)
{
Expression expr = xpath.getExpression();
if(null != expr && expr instanceof PathComponent)
{
return ((PathComponent)expr).getAnalysisBits();
}
}
}
return WalkerFactory.BIT_FILTER;
}
示例2: setSelect
import org.apache.xpath.XPath; //导入方法依赖的package包/类
/**
* Set the "select" attribute.
*
* @param xpath The XPath expression for the "select" attribute.
*/
public void setSelect(XPath xpath)
{
m_selectExpression = xpath.getExpression();
// The following line is part of the codes added to fix bug#16889
// Store xpath which will be needed when firing Selected Event
m_xpath = xpath;
}
示例3: setTemplate
import org.apache.xpath.XPath; //导入方法依赖的package包/类
/**
* Add a template to the table of named templates and/or the table of templates
* with match patterns. This routine should
* be called in decreasing order of precedence but it checks nonetheless.
*
* @param template
*/
public void setTemplate(ElemTemplate template)
{
XPath matchXPath = template.getMatch();
if (null == template.getName() && null == matchXPath)
{
template.error(XSLTErrorResources.ER_NEED_NAME_OR_MATCH_ATTRIB,
new Object[]{ "xsl:template" });
}
if (null != template.getName())
{
ElemTemplate existingTemplate = (ElemTemplate) m_namedTemplates.get(template.getName());
if (null == existingTemplate)
{
m_namedTemplates.put(template.getName(), template);
}
else
{
int existingPrecedence =
existingTemplate.getStylesheetComposed().getImportCountComposed();
int newPrecedence = template.getStylesheetComposed().getImportCountComposed();
if (newPrecedence > existingPrecedence)
{
// This should never happen
m_namedTemplates.put(template.getName(), template);
}
else if (newPrecedence == existingPrecedence)
template.error(XSLTErrorResources.ER_DUPLICATE_NAMED_TEMPLATE,
new Object[]{ template.getName() });
}
}
if (null != matchXPath)
{
Expression matchExpr = matchXPath.getExpression();
if (matchExpr instanceof StepPattern)
{
insertPatternInTable((StepPattern) matchExpr, template);
}
else if (matchExpr instanceof UnionPattern)
{
UnionPattern upat = (UnionPattern) matchExpr;
StepPattern[] pats = upat.getPatterns();
int n = pats.length;
for (int i = 0; i < n; i++)
{
insertPatternInTable(pats[i], template);
}
}
else
{
// TODO: assert error
}
}
}