Java Code Examples for com.sun.org.apache.xpath.internal.patterns.NodeTest#WILD

The following examples show how to use com.sun.org.apache.xpath.internal.patterns.NodeTest#WILD . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpMap.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 2
Source File: OpMap.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 3
Source File: OpMap.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 4
Source File: OpMap.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 5
Source File: OpMap.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 6
Source File: OpMap.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 7
Source File: OpMap.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get the namespace of the step.
 *
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return The step's namespace, NodeTest.WILD, or null for null namespace.
 */
public String getStepNS(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepNS.argLenOfStep: "+argLenOfStep);
  if (argLenOfStep == 3)
  {
    int index = m_opMap.elementAt(opPosOfStep + 4);

    if (index >= 0)
      return (String) m_tokenQueue.elementAt(index);
    else if (OpCodes.ELEMWILDCARD == index)
      return NodeTest.WILD;
    else
      return null;
  }
  else
    return null;
}
 
Example 8
Source File: DescendantIterator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.  This is the default implementation for
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();

  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);

  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;

  // System.out.print(" (DescendantIterator) ");

  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}
 
Example 9
Source File: OpMap.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return (String) m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 10
Source File: OpMap.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return (String) m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 11
Source File: DescendantIterator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.  This is the default implementation for
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();

  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);

  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;

  // System.out.print(" (DescendantIterator) ");

  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}
 
Example 12
Source File: OpMap.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return (String) m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 13
Source File: OpMap.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 14
Source File: OpMap.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return (String) m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 15
Source File: OpMap.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return (String) m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 16
Source File: DescendantIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.  This is the default implementation for
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();

  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);

  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;

  // System.out.print(" (DescendantIterator) ");

  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}
 
Example 17
Source File: DescendantIterator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.  This is the default implementation for
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();

  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);

  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;

  // System.out.print(" (DescendantIterator) ");

  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}
 
Example 18
Source File: OpMap.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the local name of the step.
 * @param opPosOfStep The position of the FROM_XXX step.
 *
 * @return OpCodes.EMPTY, OpCodes.ELEMWILDCARD, or the local name.
 */
public String getStepLocalName(int opPosOfStep)
{

  int argLenOfStep = getArgLengthOfStep(opPosOfStep);

  // System.out.println("getStepLocalName.argLenOfStep: "+argLenOfStep);
  int index;

  switch (argLenOfStep)
  {
  case 0 :
    index = OpCodes.EMPTY;
    break;
  case 1 :
    index = OpCodes.ELEMWILDCARD;
    break;
  case 2 :
    index = m_opMap.elementAt(opPosOfStep + 4);
    break;
  case 3 :
    index = m_opMap.elementAt(opPosOfStep + 5);
    break;
  default :
    index = OpCodes.EMPTY;
    break;  // Should assert error
  }

  // int index = (argLenOfStep == 3) ? m_opMap[opPosOfStep+5]
  //                                  : ((argLenOfStep == 1) ? -3 : -2);
  if (index >= 0)
    return (String) m_tokenQueue.elementAt(index).toString();
  else if (OpCodes.ELEMWILDCARD == index)
    return NodeTest.WILD;
  else
    return null;
}
 
Example 19
Source File: DescendantIterator.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.  This is the default implementation for
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();

  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);

  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;

  // System.out.print(" (DescendantIterator) ");

  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}
 
Example 20
Source File: DescendantIterator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.  This is the default implementation for
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();

  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);

  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;

  // System.out.print(" (DescendantIterator) ");

  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}