com.sun.org.apache.xpath.internal.NodeSetDTM Java Examples

The following examples show how to use com.sun.org.apache.xpath.internal.NodeSetDTM. 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: XNodeSetForDOM.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeIter;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj = new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #2
Source File: XNodeSet.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Construct a XNodeSet object for one node.
 *
 * @param n Node to add to the new XNodeSet object
 */
public XNodeSet(int n, DTMManager dtmMgr)
{

  super(new NodeSetDTM(dtmMgr));
  m_dtmMgr = dtmMgr;

  if (DTM.NULL != n)
  {
    ((NodeSetDTM) m_obj).addNode(n);
    m_last = 1;
  }
  else
      m_last = 0;
}
 
Example #3
Source File: XObject.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Cast result object to a nodelist. Always issues an error.
 *
 * @return The object as a NodeSetDTM.
 *
 * @throws javax.xml.transform.TransformerException
 */
public NodeSetDTM mutableNodeset()
        throws javax.xml.transform.TransformerException
{

  error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
        new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");

  return (NodeSetDTM) m_obj;
}
 
Example #4
Source File: XNodeSetForDOM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
  m_dtmMgr = dtmMgr;
  m_origObj = node;
  int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
  setObject(new NodeSetDTM(dtmMgr));
  ((NodeSetDTM) m_obj).addNode(dtmHandle);
}
 
Example #5
Source File: NodeSequence.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see DTMIterator#getLength()
 */
public int getLength()
{
  IteratorCache cache = getCache();

      if(cache != null)
      {
      // Nodes from the iterator are cached
      if (cache.isComplete()) {
          // All of the nodes from the iterator are cached
          // so just return the number of nodes in the cache
          NodeVector nv = cache.getVector();
          return nv.size();
      }

      // If this NodeSequence wraps a mutable nodeset, then
      // m_last will not reflect the size of the nodeset if
      // it has been mutated...
      if (m_iter instanceof NodeSetDTM)
      {
          return m_iter.getLength();
      }

              if(-1 == m_last)
              {
                      int pos = m_next;
                      runTo(-1);
                      m_next = pos;
              }
          return m_last;
      }
      else
      {
              return (-1 == m_last) ? (m_last = m_iter.getLength()) : m_last;
      }
}
 
Example #6
Source File: XNodeSetForDOM.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
  m_dtmMgr = dtmMgr;
  m_origObj = node;
  int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
  setObject(new NodeSetDTM(dtmMgr));
  ((NodeSetDTM) m_obj).addNode(dtmHandle);
}
 
Example #7
Source File: XNodeSetForDOM.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeList;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #8
Source File: XNodeSetForDOM.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
  m_dtmMgr = dtmMgr;
  m_origObj = node;
  int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
  setObject(new NodeSetDTM(dtmMgr));
  ((NodeSetDTM) m_obj).addNode(dtmHandle);
}
 
Example #9
Source File: XNodeSetForDOM.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeList;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #10
Source File: XNodeSetForDOM.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeIter;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj = new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #11
Source File: XObject.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Cast result object to a nodelist. Always issues an error.
 *
 * @return The object as a NodeSetDTM.
 *
 * @throws javax.xml.transform.TransformerException
 */
public NodeSetDTM mutableNodeset()
        throws javax.xml.transform.TransformerException
{

  error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
        new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");

  return (NodeSetDTM) m_obj;
}
 
Example #12
Source File: XNodeSet.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a XNodeSet object for one node.
 *
 * @param n Node to add to the new XNodeSet object
 */
public XNodeSet(int n, DTMManager dtmMgr)
{

  super(new NodeSetDTM(dtmMgr));
  m_dtmMgr = dtmMgr;

  if (DTM.NULL != n)
  {
    ((NodeSetDTM) m_obj).addNode(n);
    m_last = 1;
  }
  else
      m_last = 0;
}
 
Example #13
Source File: XNodeSetForDOM.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
  m_dtmMgr = dtmMgr;
  m_origObj = node;
  int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
  setObject(new NodeSetDTM(dtmMgr));
  ((NodeSetDTM) m_obj).addNode(dtmHandle);
}
 
Example #14
Source File: XNodeSetForDOM.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeList;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #15
Source File: NodeSequence.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * @see DTMIterator#getLength()
 */
public int getLength()
{
  IteratorCache cache = getCache();

      if(cache != null)
      {
      // Nodes from the iterator are cached
      if (cache.isComplete()) {
          // All of the nodes from the iterator are cached
          // so just return the number of nodes in the cache
          NodeVector nv = cache.getVector();
          return nv.size();
      }

      // If this NodeSequence wraps a mutable nodeset, then
      // m_last will not reflect the size of the nodeset if
      // it has been mutated...
      if (m_iter instanceof NodeSetDTM)
      {
          return m_iter.getLength();
      }

              if(-1 == m_last)
              {
                      int pos = m_next;
                      runTo(-1);
                      m_next = pos;
              }
          return m_last;
      }
      else
      {
              return (-1 == m_last) ? (m_last = m_iter.getLength()) : m_last;
      }
}
 
Example #16
Source File: XObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Cast result object to a nodelist. Always issues an error.
 *
 * @return The object as a NodeSetDTM.
 *
 * @throws javax.xml.transform.TransformerException
 */
public NodeSetDTM mutableNodeset()
        throws javax.xml.transform.TransformerException
{

  error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
        new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");

  return (NodeSetDTM) m_obj;
}
 
Example #17
Source File: XNodeSetForDOM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeList;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #18
Source File: XNodeSetForDOM.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
  m_dtmMgr = dtmMgr;
  m_origObj = node;
  int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
  setObject(new NodeSetDTM(dtmMgr));
  ((NodeSetDTM) m_obj).addNode(dtmHandle);
}
 
Example #19
Source File: XObject.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Cast result object to a nodelist. Always issues an error.
 *
 * @return The object as a NodeSetDTM.
 *
 * @throws javax.xml.transform.TransformerException
 */
public NodeSetDTM mutableNodeset()
        throws javax.xml.transform.TransformerException
{

  error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
        new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");

  return (NodeSetDTM) m_obj;
}
 
Example #20
Source File: NodeSequence.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see DTMIterator#getLength()
 */
public int getLength()
{
  IteratorCache cache = getCache();

      if(cache != null)
      {
      // Nodes from the iterator are cached
      if (cache.isComplete()) {
          // All of the nodes from the iterator are cached
          // so just return the number of nodes in the cache
          NodeVector nv = cache.getVector();
          return nv.size();
      }

      // If this NodeSequence wraps a mutable nodeset, then
      // m_last will not reflect the size of the nodeset if
      // it has been mutated...
      if (m_iter instanceof NodeSetDTM)
      {
          return m_iter.getLength();
      }

              if(-1 == m_last)
              {
                      int pos = m_next;
                      runTo(-1);
                      m_next = pos;
              }
          return m_last;
      }
      else
      {
              return (-1 == m_last) ? (m_last = m_iter.getLength()) : m_last;
      }
}
 
Example #21
Source File: XNodeSet.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a XNodeSet object for one node.
 *
 * @param n Node to add to the new XNodeSet object
 */
public XNodeSet(int n, DTMManager dtmMgr)
{

  super(new NodeSetDTM(dtmMgr));
  m_dtmMgr = dtmMgr;

  if (DTM.NULL != n)
  {
    ((NodeSetDTM) m_obj).addNode(n);
    m_last = 1;
  }
  else
      m_last = 0;
}
 
Example #22
Source File: XObject.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Cast result object to a nodelist. Always issues an error.
 *
 * @return The object as a NodeSetDTM.
 *
 * @throws javax.xml.transform.TransformerException
 */
public NodeSetDTM mutableNodeset()
        throws javax.xml.transform.TransformerException
{

  error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
        new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");

  return (NodeSetDTM) m_obj;
}
 
Example #23
Source File: XNodeSetForDOM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeIter;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj = new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #24
Source File: XNodeSetForDOM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeList;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #25
Source File: XNodeSet.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a XNodeSet object for one node.
 *
 * @param n Node to add to the new XNodeSet object
 */
public XNodeSet(int n, DTMManager dtmMgr)
{

  super(new NodeSetDTM(dtmMgr));
  m_dtmMgr = dtmMgr;

  if (DTM.NULL != n)
  {
    ((NodeSetDTM) m_obj).addNode(n);
    m_last = 1;
  }
  else
      m_last = 0;
}
 
Example #26
Source File: NodeSequence.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see DTMIterator#getLength()
 */
public int getLength()
{
  IteratorCache cache = getCache();

      if(cache != null)
      {
      // Nodes from the iterator are cached
      if (cache.isComplete()) {
          // All of the nodes from the iterator are cached
          // so just return the number of nodes in the cache
          NodeVector nv = cache.getVector();
          return nv.size();
      }

      // If this NodeSequence wraps a mutable nodeset, then
      // m_last will not reflect the size of the nodeset if
      // it has been mutated...
      if (m_iter instanceof NodeSetDTM)
      {
          return m_iter.getLength();
      }

              if(-1 == m_last)
              {
                      int pos = m_next;
                      runTo(-1);
                      m_next = pos;
              }
          return m_last;
      }
      else
      {
              return (-1 == m_last) ? (m_last = m_iter.getLength()) : m_last;
      }
}
 
Example #27
Source File: XNodeSet.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Construct a XNodeSet object for one node.
 *
 * @param n Node to add to the new XNodeSet object
 */
public XNodeSet(int n, DTMManager dtmMgr)
{

  super(new NodeSetDTM(dtmMgr));
  m_dtmMgr = dtmMgr;

  if (DTM.NULL != n)
  {
    ((NodeSetDTM) m_obj).addNode(n);
    m_last = 1;
  }
  else
      m_last = 0;
}
 
Example #28
Source File: XObject.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Cast result object to a nodelist. Always issues an error.
 *
 * @return The object as a NodeSetDTM.
 *
 * @throws javax.xml.transform.TransformerException
 */
public NodeSetDTM mutableNodeset()
        throws javax.xml.transform.TransformerException
{

  error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
        new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeSetDTM!");

  return (NodeSetDTM) m_obj;
}
 
Example #29
Source File: XNodeSetForDOM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeIter;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj = new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}
 
Example #30
Source File: XNodeSetForDOM.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)
{
  m_dtmMgr = xctxt.getDTMManager();
  m_origObj = nodeList;

  // JKESS 20020514: Longer-term solution is to force
  // folks to request length through an accessor, so we can defer this
  // retrieval... but that requires an API change.
  // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
  m_last=nsdtm.getLength();
  setObject(nsdtm);
}