• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Expression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.org.apache.xpath.internal.Expression的典型用法代码示例。如果您正苦于以下问题:Java Expression类的具体用法?Java Expression怎么用?Java Expression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Expression类属于com.sun.org.apache.xpath.internal包,在下文中一共展示了Expression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
  if (!super.deepEquals(expr))
        return false;

  PredicatedNodeTest pnt = (PredicatedNodeTest) expr;
  if (null != m_predicates)
  {

    int n = m_predicates.length;
    if ((null == pnt.m_predicates) || (pnt.m_predicates.length != n))
          return false;
    for (int i = 0; i < n; i++)
    {
      if (!m_predicates[i].deepEquals(pnt.m_predicates[i]))
            return false;
    }
  }
  else if (null != pnt.m_predicates)
          return false;

  return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:PredicatedNodeTest.java


示例2: setPredicateCount

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Set the number of predicates that this walker has.  This does more
 * that one would think, as it creates a new predicate array of the
 * size of the count argument, and copies count predicates into the new
 * one from the old, and then reassigns the predicates value.  All this
 * to keep from having to have a predicate count value.
 *
 * @param count The number of predicates, which must be equal or less
 *               than the existing count.
 */
public void setPredicateCount(int count)
{
  if(count > 0)
  {
    Expression[] newPredicates = new Expression[count];
    for (int i = 0; i < count; i++)
    {
      newPredicates[i] = m_predicates[i];
    }
    m_predicates = newPredicates;
  }
  else
    m_predicates = null;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:PredicatedNodeTest.java


示例3: getCompiledPredicates

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Compile a zero or more predicates for a given match pattern.
 *
 * @param opPos The position of the first predicate the m_opMap array.
 *
 * @return reference to array of {@link com.sun.org.apache.xpath.internal.Expression} instances.
 *
 * @throws TransformerException if a error occurs creating the Expression.
 */
public Expression[] getCompiledPredicates(int opPos)
        throws TransformerException
{

  int count = countPredicates(opPos);

  if (count > 0)
  {
    Expression[] predicates = new Expression[count];

    compilePredicates(opPos, predicates);

    return predicates;
  }

  return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:Compiler.java


示例4: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
      if(!super.deepEquals(expr))
              return false;

      if(null != m_arg1)
      {
              if(null == ((Function2Args)expr).m_arg1)
                      return false;

              if(!m_arg1.deepEquals(((Function2Args)expr).m_arg1))
                      return false;
      }
      else if(null != ((Function2Args)expr).m_arg1)
              return false;

      return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:Function2Args.java


示例5: fixupVariables

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * This function is used to fixup variables from QNames to stack frame
 * indexes at stylesheet build time.
 * @param vars List of QNames that correspond to variables.  This list
 * should be searched backwards for the first qualified name that
 * corresponds to the variable reference qname.  The position of the
 * QName in the vector from the start of the vector will be its position
 * in the stack frame (but variables above the globalsTop value will need
 * to be offset to the current stack frame).
 * NEEDSDOC @param globalsSize
 */
public void fixupVariables(java.util.Vector vars, int globalsSize)
{

  if (null != m_argVec)
  {
    int nArgs = m_argVec.size();

    for (int i = 0; i < nArgs; i++)
    {
      Expression arg = (Expression) m_argVec.elementAt(i);

      arg.fixupVariables(vars, globalsSize);
    }
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:FuncExtFunction.java


示例6: addIterator

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Add an iterator to the union list.
 *
 * @param expr non-null reference to a location path iterator.
 */
public void addIterator(DTMIterator expr)
{

  // Increase array size by only 1 at a time.  Fix this
  // if it looks to be a problem.
  if (null == m_iterators)
  {
    m_iterators = new DTMIterator[1];
    m_iterators[0] = expr;
  }
  else
  {
    DTMIterator[] exprs = m_iterators;
    int len = m_iterators.length;

    m_iterators = new DTMIterator[len + 1];

    System.arraycopy(exprs, 0, m_iterators, 0, len);

    m_iterators[len] = expr;
  }
  expr.nextNode();
  if(expr instanceof Expression)
      ((Expression)expr).exprSetParent(this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:UnionPathIterator.java


示例7: setExpression

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see ExpressionOwner#setExpression(Expression)
 */
public void setExpression(Expression exp)
{

    if(!(exp instanceof LocPathIterator))
    {
            // Yuck.  Need FilterExprIter.  Or make it so m_exprs can be just
            // plain expressions?
            WalkingIterator wi = new WalkingIterator(getPrefixResolver());
            FilterExprWalker few = new FilterExprWalker(wi);
            wi.setFirstWalker(few);
            few.setInnerExpression(exp);
            wi.exprSetParent(UnionPathIterator.this);
            few.exprSetParent(wi);
            exp.exprSetParent(few);
            exp = wi;
    }
    else
            exp.exprSetParent(UnionPathIterator.this);
    m_exprs[m_index] = (LocPathIterator)exp;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:UnionPathIterator.java


示例8: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
      if(!super.deepEquals(expr))
              return false;

      if(null != m_arg0)
      {
              if(null == ((FunctionOneArg)expr).m_arg0)
                      return false;

              if(!m_arg0.deepEquals(((FunctionOneArg)expr).m_arg0))
                      return false;
      }
      else if(null != ((FunctionOneArg)expr).m_arg0)
              return false;

      return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:FunctionOneArg.java


示例9: setArg

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Set an argument expression for a function.  This method is called by the
 * XPath compiler.
 *
 * @param arg non-null expression that represents the argument.
 * @param argNum The argument number index.
 *
 * @throws WrongNumberArgsException If the argNum parameter is greater than 1.
 */
public void setArg(Expression arg, int argNum)
        throws WrongNumberArgsException
{

  // System.out.println("argNum: "+argNum);
  if (argNum == 0)
    super.setArg(arg, argNum);
  else if (1 == argNum)
  {
    m_arg1 = arg;
    arg.exprSetParent(this);
  }
  else
                reportWrongNumberArgs();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:Function2Args.java


示例10: setArg

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Set an argument expression for a function.  This method is called by the
 * XPath compiler.
 *
 * @param arg non-null expression that represents the argument.
 * @param argNum The argument number index.
 *
 * @throws WrongNumberArgsException If the argNum parameter is greater than 0.
 */
public void setArg(Expression arg, int argNum)
        throws WrongNumberArgsException
{

  if (0 == argNum)
  {
    m_arg0 = arg;
    arg.exprSetParent(this);
  }
  else
    reportWrongNumberArgs();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:FunctionOneArg.java


示例11: setPredicates

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Set the predicates for this match pattern step.
 *
 *
 * @param predicates An array of expressions that define predicates
 *                   for this step.
 */
public void setPredicates(Expression[] predicates)
{

  m_predicates = predicates;
  if(null != predicates)
  {
      for(int i = 0; i < predicates.length; i++)
      {
              predicates[i].exprSetParent(this);
      }
  }

  calcScore();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:StepPattern.java


示例12: compileUnary

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Bottle-neck compilation of a unary operation.
 *
 * @param unary The parent unary operation.
 * @param opPos The position in the op map of the parent operation.
 *
 * @return The unary argument.
 *
 * @throws TransformerException if syntax or other error occurs.
 */
private Expression compileUnary(UnaryOperation unary, int opPos)
        throws TransformerException
{

  int rightPos = getFirstChildPos(opPos);

  unary.setRight(compile(rightPos));

  return unary;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:Compiler.java


示例13: execute

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * For support of literal objects in xpaths.
 *
 * @param xctxt The XPath execution context.
 *
 * @return the result of executing the select expression
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt)
        throws javax.xml.transform.TransformerException
{
       XObject m_selected;
   m_selected = ((Expression)m_obj).execute(xctxt);
   m_selected.allowDetachToRelease(m_allowRelease);
   if (m_selected.getType() == CLASS_STRING)
     return m_selected;
   else
     return new XString(m_selected.str());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:XRTreeFragSelectWrapper.java


示例14: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
      if(!super.deepEquals(expr))
              return false;

      if(m_axis != ((OneStepIteratorForward)expr).m_axis)
              return false;

      return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:OneStepIteratorForward.java


示例15: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
      if(!isSameClass(expr))
              return false;

      NodeTest nt = (NodeTest)expr;

      if(null != nt.m_name)
      {
              if(null == m_name)
                      return false;
              else if(!nt.m_name.equals(m_name))
                      return false;
      }
      else if(null != m_name)
              return false;

      if(null != nt.m_namespace)
      {
              if(null == m_namespace)
                      return false;
              else if(!nt.m_namespace.equals(m_namespace))
                      return false;
      }
      else if(null != m_namespace)
              return false;

      if(m_whatToShow != nt.m_whatToShow)
              return false;

      if(m_isTotallyWild != nt.m_isTotallyWild)
              return false;

      return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:NodeTest.java


示例16: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
  if (!super.deepEquals(expr))
            return false;

  AxesWalker walker = (AxesWalker)expr;
  if(this.m_axis != walker.m_axis)
    return false;

  return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:AxesWalker.java


示例17: matchPattern

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Compile an entire match pattern expression.
 *
 * @param opPos The current position in the m_opMap array.
 *
 * @return reference to {@link com.sun.org.apache.xpath.internal.patterns.UnionPattern} instance.
 *
 * @throws TransformerException if a error occurs creating the Expression.
 */
protected Expression matchPattern(int opPos) throws TransformerException
{
  locPathDepth++;
  try
  {
    // First, count...
    int nextOpPos = opPos;
    int i;

    for (i = 0; getOp(nextOpPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++)
    {
      nextOpPos = getNextOpPos(nextOpPos);
    }

    if (i == 1)
      return compile(opPos);

    UnionPattern up = new UnionPattern();
    StepPattern[] patterns = new StepPattern[i];

    for (i = 0; getOp(opPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++)
    {
      nextOpPos = getNextOpPos(opPos);
      patterns[i] = (StepPattern) compile(opPos);
      opPos = nextOpPos;
    }

    up.setPatterns(patterns);

    return up;
  }
  finally
  {
    locPathDepth--;
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:46,代码来源:Compiler.java


示例18: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
      if(!isSameClass(expr))
              return false;

      if(!m_right.deepEquals(((UnaryOperation)expr).m_right))
              return false;

      return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:UnaryOperation.java


示例19: deepEquals

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * @see Expression#deepEquals(Expression)
 */
public boolean deepEquals(Expression expr)
{
      if(!super.deepEquals(expr))
              return false;

      if(m_axis != ((OneStepIterator)expr).m_axis)
              return false;

      return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:OneStepIterator.java


示例20: locationPath

import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
 * Compile a location path.  The LocPathIterator itself may create
 * {@link com.sun.org.apache.xpath.internal.axes.AxesWalker} children.
 *
 * @param opPos The current position in the m_opMap array.
 *
 * @return reference to {@link com.sun.org.apache.xpath.internal.axes.LocPathIterator} instance.
 *
 * @throws TransformerException if a error occurs creating the Expression.
 */
public Expression locationPath(int opPos) throws TransformerException
{
  locPathDepth++;
  try
  {
    DTMIterator iter = WalkerFactory.newDTMIterator(this, opPos, (locPathDepth == 0));
    return (Expression)iter; // cast OK, I guess.
  }
  finally
  {
    locPathDepth--;
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:Compiler.java



注:本文中的com.sun.org.apache.xpath.internal.Expression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ISharedImages类代码示例发布时间:2022-05-21
下一篇:
Java TiC类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap