Java Code Examples for com.sun.org.apache.xml.internal.dtm.DTMFilter#SHOW_ALL

The following examples show how to use com.sun.org.apache.xml.internal.dtm.DTMFilter#SHOW_ALL . 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: StepPattern.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate the local name or psuedo name of the node that this pattern will test,
 * for hash table lookup optimization.
 *
 * @see com.sun.org.apache.xpath.internal.compiler.PsuedoNames
 */
public void calcTargetString()
{

  int whatToShow = getWhatToShow();

  switch (whatToShow)
  {
  case DTMFilter.SHOW_COMMENT :
    m_targetString = PsuedoNames.PSEUDONAME_COMMENT;
    break;
  case DTMFilter.SHOW_TEXT :
  case DTMFilter.SHOW_CDATA_SECTION :
  case (DTMFilter.SHOW_TEXT | DTMFilter.SHOW_CDATA_SECTION) :
    m_targetString = PsuedoNames.PSEUDONAME_TEXT;
    break;
  case DTMFilter.SHOW_ALL :
    m_targetString = PsuedoNames.PSEUDONAME_ANY;
    break;
  case DTMFilter.SHOW_DOCUMENT :
  case DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT :
    m_targetString = PsuedoNames.PSEUDONAME_ROOT;
    break;
  case DTMFilter.SHOW_ELEMENT :
    if (this.WILD == m_name)
      m_targetString = PsuedoNames.PSEUDONAME_ANY;
    else
      m_targetString = m_name;
    break;
  default :
    m_targetString = PsuedoNames.PSEUDONAME_ANY;
    break;
  }
}
 
Example 2
Source File: OneStepIteratorForward.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a OneStepIterator object that will just traverse the self axes.
 *
 * @param axis One of the com.sun.org.apache.xml.internal.dtm.Axis integers.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIteratorForward(int axis)
{
  super(null);

  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 3
Source File: OneStepIterator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a OneStepIterator object.
 *
 * @param iterator The DTM iterator which this iterator will use.
 * @param axis One of Axis.Child, etc., or -1 if the axis is unknown.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIterator(DTMAxisIterator iterator, int axis)
        throws javax.xml.transform.TransformerException
{
  super(null);

  m_iterator = iterator;
  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 4
Source File: OneStepIteratorForward.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a OneStepIterator object that will just traverse the self axes.
 *
 * @param axis One of the com.sun.org.apache.xml.internal.dtm.Axis integers.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIteratorForward(int axis)
{
  super(null);

  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 5
Source File: DescendantIterator.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Create a DescendantIterator object.
 *
 */
public DescendantIterator()
{
  super(null);
  m_axis = Axis.DESCENDANTSORSELFFROMROOT;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 6
Source File: DescendantIterator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a DescendantIterator object.
 *
 */
public DescendantIterator()
{
  super(null);
  m_axis = Axis.DESCENDANTSORSELFFROMROOT;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 7
Source File: DescendantIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a DescendantIterator object.
 *
 */
public DescendantIterator()
{
  super(null);
  m_axis = Axis.DESCENDANTSORSELFFROMROOT;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 8
Source File: DescendantIterator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a DescendantIterator object.
 *
 */
public DescendantIterator()
{
  super(null);
  m_axis = Axis.DESCENDANTSORSELFFROMROOT;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 9
Source File: OneStepIterator.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Create a OneStepIterator object.
 *
 * @param iterator The DTM iterator which this iterator will use.
 * @param axis One of Axis.Child, etc., or -1 if the axis is unknown.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIterator(DTMAxisIterator iterator, int axis)
        throws javax.xml.transform.TransformerException
{
  super(null);

  m_iterator = iterator;
  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 10
Source File: OneStepIteratorForward.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a OneStepIterator object that will just traverse the self axes.
 *
 * @param axis One of the com.sun.org.apache.xml.internal.dtm.Axis integers.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIteratorForward(int axis)
{
  super(null);

  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 11
Source File: OneStepIterator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a OneStepIterator object.
 *
 * @param iterator The DTM iterator which this iterator will use.
 * @param axis One of Axis.Child, etc., or -1 if the axis is unknown.
 *
 * @throws javax.xml.transform.TransformerException
 */
public OneStepIterator(DTMAxisIterator iterator, int axis)
        throws javax.xml.transform.TransformerException
{
  super(null);

  m_iterator = iterator;
  m_axis = axis;
  int whatToShow = DTMFilter.SHOW_ALL;
  initNodeTest(whatToShow);
}
 
Example 12
Source File: ContextMatchStepPattern.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Construct a ContextMatchStepPattern.
 *
 */
public ContextMatchStepPattern(int axis, int paxis)
{
  super(DTMFilter.SHOW_ALL, axis, paxis);
}
 
Example 13
Source File: StepPattern.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Get the string represenentation of this step for diagnostic purposes.
 *
 *
 * @return A string representation of this step, built by reverse-engineering
 * the contained info.
 */
public String toString()
{

  StringBuffer buf = new StringBuffer();

  for (StepPattern pat = this; pat != null; pat = pat.m_relativePathPattern)
  {
    if (pat != this)
      buf.append("/");

    buf.append(Axis.getNames(pat.m_axis));
    buf.append("::");

    if (0x000005000 == pat.m_whatToShow)
    {
      buf.append("doc()");
    }
    else if (DTMFilter.SHOW_BYFUNCTION == pat.m_whatToShow)
    {
      buf.append("function()");
    }
    else if (DTMFilter.SHOW_ALL == pat.m_whatToShow)
    {
      buf.append("node()");
    }
    else if (DTMFilter.SHOW_TEXT == pat.m_whatToShow)
    {
      buf.append("text()");
    }
    else if (DTMFilter.SHOW_PROCESSING_INSTRUCTION == pat.m_whatToShow)
    {
      buf.append("processing-instruction(");

      if (null != pat.m_name)
      {
        buf.append(pat.m_name);
      }

      buf.append(")");
    }
    else if (DTMFilter.SHOW_COMMENT == pat.m_whatToShow)
    {
      buf.append("comment()");
    }
    else if (null != pat.m_name)
    {
      if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
      {
        buf.append("@");
      }

      if (null != pat.m_namespace)
      {
        buf.append("{");
        buf.append(pat.m_namespace);
        buf.append("}");
      }

      buf.append(pat.m_name);
    }
    else if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
    {
      buf.append("@");
    }
    else if ((DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT)
             == pat.m_whatToShow)
    {
      buf.append("doc-root()");
    }
    else
    {
      buf.append('?').append(Integer.toHexString(pat.m_whatToShow));
    }

    if (null != pat.m_predicates)
    {
      for (int i = 0; i < pat.m_predicates.length; i++)
      {
        buf.append("[");
        buf.append(pat.m_predicates[i]);
        buf.append("]");
      }
    }
  }

  return buf.toString();
}
 
Example 14
Source File: StepPattern.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * Get the string represenentation of this step for diagnostic purposes.
 *
 *
 * @return A string representation of this step, built by reverse-engineering
 * the contained info.
 */
public String toString()
{

  StringBuffer buf = new StringBuffer();

  for (StepPattern pat = this; pat != null; pat = pat.m_relativePathPattern)
  {
    if (pat != this)
      buf.append("/");

    buf.append(Axis.getNames(pat.m_axis));
    buf.append("::");

    if (0x000005000 == pat.m_whatToShow)
    {
      buf.append("doc()");
    }
    else if (DTMFilter.SHOW_BYFUNCTION == pat.m_whatToShow)
    {
      buf.append("function()");
    }
    else if (DTMFilter.SHOW_ALL == pat.m_whatToShow)
    {
      buf.append("node()");
    }
    else if (DTMFilter.SHOW_TEXT == pat.m_whatToShow)
    {
      buf.append("text()");
    }
    else if (DTMFilter.SHOW_PROCESSING_INSTRUCTION == pat.m_whatToShow)
    {
      buf.append("processing-instruction(");

      if (null != pat.m_name)
      {
        buf.append(pat.m_name);
      }

      buf.append(")");
    }
    else if (DTMFilter.SHOW_COMMENT == pat.m_whatToShow)
    {
      buf.append("comment()");
    }
    else if (null != pat.m_name)
    {
      if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
      {
        buf.append("@");
      }

      if (null != pat.m_namespace)
      {
        buf.append("{");
        buf.append(pat.m_namespace);
        buf.append("}");
      }

      buf.append(pat.m_name);
    }
    else if (DTMFilter.SHOW_ATTRIBUTE == pat.m_whatToShow)
    {
      buf.append("@");
    }
    else if ((DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT)
             == pat.m_whatToShow)
    {
      buf.append("doc-root()");
    }
    else
    {
      buf.append('?').append(Integer.toHexString(pat.m_whatToShow));
    }

    if (null != pat.m_predicates)
    {
      for (int i = 0; i < pat.m_predicates.length; i++)
      {
        buf.append("[");
        buf.append(pat.m_predicates[i]);
        buf.append("]");
      }
    }
  }

  return buf.toString();
}
 
Example 15
Source File: ContextMatchStepPattern.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Construct a ContextMatchStepPattern.
 *
 */
public ContextMatchStepPattern(int axis, int paxis)
{
  super(DTMFilter.SHOW_ALL, axis, paxis);
}
 
Example 16
Source File: ContextMatchStepPattern.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Construct a ContextMatchStepPattern.
 *
 */
public ContextMatchStepPattern(int axis, int paxis)
{
  super(DTMFilter.SHOW_ALL, axis, paxis);
}
 
Example 17
Source File: Compiler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
   * Get a {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what
   * to show for a given node test.
   *
   * @param opPos the op map position for the location step.
   *
   * @return {@link org.w3c.dom.traversal.NodeFilter} bit set that tells what
   *         to show for a given node test.
   */
  public int getWhatToShow(int opPos)
  {

    int axesType = getOp(opPos);
    int testType = getOp(opPos + 3);

    // System.out.println("testType: "+testType);
    switch (testType)
    {
    case OpCodes.NODETYPE_COMMENT :
      return DTMFilter.SHOW_COMMENT;
    case OpCodes.NODETYPE_TEXT :
//      return DTMFilter.SHOW_TEXT | DTMFilter.SHOW_COMMENT;
      return DTMFilter.SHOW_TEXT | DTMFilter.SHOW_CDATA_SECTION ;
    case OpCodes.NODETYPE_PI :
      return DTMFilter.SHOW_PROCESSING_INSTRUCTION;
    case OpCodes.NODETYPE_NODE :
//      return DTMFilter.SHOW_ALL;
      switch (axesType)
      {
      case OpCodes.FROM_NAMESPACE:
        return DTMFilter.SHOW_NAMESPACE;
      case OpCodes.FROM_ATTRIBUTES :
      case OpCodes.MATCH_ATTRIBUTE :
        return DTMFilter.SHOW_ATTRIBUTE;
      case OpCodes.FROM_SELF:
      case OpCodes.FROM_ANCESTORS_OR_SELF:
      case OpCodes.FROM_DESCENDANTS_OR_SELF:
        return DTMFilter.SHOW_ALL;
      default:
        if (getOp(0) == OpCodes.OP_MATCHPATTERN)
          return ~DTMFilter.SHOW_ATTRIBUTE
                  & ~DTMFilter.SHOW_DOCUMENT
                  & ~DTMFilter.SHOW_DOCUMENT_FRAGMENT;
        else
          return ~DTMFilter.SHOW_ATTRIBUTE;
      }
    case OpCodes.NODETYPE_ROOT :
      return DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT;
    case OpCodes.NODETYPE_FUNCTEST :
      return NodeTest.SHOW_BYFUNCTION;
    case OpCodes.NODENAME :
      switch (axesType)
      {
      case OpCodes.FROM_NAMESPACE :
        return DTMFilter.SHOW_NAMESPACE;
      case OpCodes.FROM_ATTRIBUTES :
      case OpCodes.MATCH_ATTRIBUTE :
        return DTMFilter.SHOW_ATTRIBUTE;

      // break;
      case OpCodes.MATCH_ANY_ANCESTOR :
      case OpCodes.MATCH_IMMEDIATE_ANCESTOR :
        return DTMFilter.SHOW_ELEMENT;

      // break;
      default :
        return DTMFilter.SHOW_ELEMENT;
      }
    default :
      // System.err.println("We should never reach here.");
      return DTMFilter.SHOW_ALL;
    }
  }
 
Example 18
Source File: NodeSetDTM.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 *  This attribute determines which node types are presented via the
 * iterator. The available set of constants is defined in the
 * <code>DTMFilter</code> interface. For NodeSetDTMs, the mask has been
 * hardcoded to show all nodes except EntityReference nodes, which have
 * no equivalent in the XPath data model.
 *
 * @return integer used as a bit-array, containing flags defined in
 * the DOM's DTMFilter class. The value will be
 * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
 * only entity references are suppressed.
 */
public int getWhatToShow()
{
  return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
}
 
Example 19
Source File: NodeSetDTM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 *  This attribute determines which node types are presented via the
 * iterator. The available set of constants is defined in the
 * <code>DTMFilter</code> interface. For NodeSetDTMs, the mask has been
 * hardcoded to show all nodes except EntityReference nodes, which have
 * no equivalent in the XPath data model.
 *
 * @return integer used as a bit-array, containing flags defined in
 * the DOM's DTMFilter class. The value will be
 * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
 * only entity references are suppressed.
 */
public int getWhatToShow()
{
  return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
}
 
Example 20
Source File: NodeSetDTM.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 *  This attribute determines which node types are presented via the
 * iterator. The available set of constants is defined in the
 * <code>DTMFilter</code> interface. For NodeSetDTMs, the mask has been
 * hardcoded to show all nodes except EntityReference nodes, which have
 * no equivalent in the XPath data model.
 *
 * @return integer used as a bit-array, containing flags defined in
 * the DOM's DTMFilter class. The value will be
 * <code>SHOW_ALL & ~SHOW_ENTITY_REFERENCE</code>, meaning that
 * only entity references are suppressed.
 */
public int getWhatToShow()
{
  return DTMFilter.SHOW_ALL & ~DTMFilter.SHOW_ENTITY_REFERENCE;
}