com.sun.org.apache.xalan.internal.res.XSLMessages Java Examples

The following examples show how to use com.sun.org.apache.xalan.internal.res.XSLMessages. 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: NodeSet.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy NodeList members into this nodelist, adding in
 * document order.  If a node is null, don't add it.
 *
 * @param nodelist List of nodes to be added
 * @param support The XPath runtime context.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  int nChildren = nodelist.getLength();

  for (int i = 0; i < nChildren; i++)
  {
    Node node = nodelist.item(i);

    if (null != node)
    {
      addNodeInDocOrder(node, support);
    }
  }
}
 
Example #2
Source File: VariableStack.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a local variable or parameter in the current stack frame.
 *
 *
 * @param xctxt The XPath context, which must be passed in order to
 * lazy evaluate variables.
 *
 * @param index Local variable index relative to the current stack
 * frame bottom.
 *
 * @return The value of the variable.
 *
 * @throws TransformerException
 */
public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK)
        throws TransformerException
{

  index += _currentFrameBottom;

  XObject val = _stackFrames[index];

  if(null == val)
    throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
                   xctxt.getSAXLocator());
    // "Variable accessed before it is bound!", xctxt.getSAXLocator());

  // Lazy execution of variables.
  if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
    return (_stackFrames[index] = val.execute(xctxt));

  return destructiveOK ? val : val.getFresh();
}
 
Example #3
Source File: NodeSet.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy NodeList members into this nodelist, adding in
 * document order.  Null references are not added.
 *
 * @param iterator NodeIterator which yields the nodes to be added.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public void addNodes(NodeIterator iterator)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  if (null != iterator)  // defensive to fix a bug that Sanjiva reported.
  {
    Node obj;

    while (null != (obj = iterator.nextNode()))
    {
      addElement(obj);
    }
  }

  // checkDups();
}
 
Example #4
Source File: Compiler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Warn the user of an problem.
 *
 * @param msg An error msgkey that corresponds to one of the constants found
 *            in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
 *            a key for a format string.
 * @param args An array of arguments represented in the format string, which
 *             may be null.
 *
 * @throws TransformerException if the current ErrorListoner determines to
 *                              throw an exception.
 */
public void warn(String msg, Object[] args) throws TransformerException
{

  java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args);

  if (null != m_errorHandler)
  {
    m_errorHandler.warning(new TransformerException(fmsg, m_locator));
  }
  else
  {
    System.out.println(fmsg
                        +"; file "+m_locator.getSystemId()
                        +"; line "+m_locator.getLineNumber()
                        +"; column "+m_locator.getColumnNumber());
  }
}
 
Example #5
Source File: NodeSet.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Copy NodeList members into this nodelist, adding in
 * document order.  If a node is null, don't add it.
 *
 * @param nodelist List of nodes to be added
 * @param support The XPath runtime context.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  int nChildren = nodelist.getLength();

  for (int i = 0; i < nChildren; i++)
  {
    Node node = nodelist.item(i);

    if (null != node)
    {
      addNodeInDocOrder(node, support);
    }
  }
}
 
Example #6
Source File: NodeSetDTM.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Copy NodeList members into this nodelist, adding in
 * document order.  Null references are not added.
 *
 * @param iterator DTMIterator which yields the nodes to be added.
 * @throws RuntimeException thrown if this NodeSetDTM is not of
 * a mutable type.
 */
public void addNodes(DTMIterator iterator)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

  if (null != iterator)  // defensive to fix a bug that Sanjiva reported.
  {
    int obj;

    while (DTM.NULL != (obj = iterator.nextNode()))
    {
      addElement(obj);
    }
  }

  // checkDups();
}
 
Example #7
Source File: XObject.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Tell the user of an error, and probably throw an
 * exception.
 *
 * @param msg Error message to issue
 * @param args Arguments to use in the message
 *
 * @throws javax.xml.transform.TransformerException
 */
protected void error(String msg, Object[] args)
        throws javax.xml.transform.TransformerException
{

  String fmsg = XSLMessages.createXPATHMessage(msg, args);

  // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR,
  //                                      m_support.ERROR,
  //                                      null,
  //                                      null, fmsg, 0, 0);
  // if(shouldThrow)
  {
    throw new XPathException(fmsg, this);
  }
}
 
Example #8
Source File: XPathParser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Warn the user of a problem.
 *
 * @param msg An error msgkey that corresponds to one of the constants found
 *            in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
 *            a key for a format string.
 * @param args An array of arguments represented in the format string, which
 *             may be null.
 *
 * @throws TransformerException if the current ErrorListoner determines to
 *                              throw an exception.
 */
void warn(String msg, Object[] args) throws TransformerException
{

  String fmsg = XSLMessages.createXPATHWarning(msg, args);
  ErrorListener ehandler = this.getErrorListener();

  if (null != ehandler)
  {
    // TO DO: Need to get stylesheet Locator from here.
    ehandler.warning(new TransformerException(fmsg, m_sourceLocator));
  }
  else
  {
    // Should never happen.
    System.err.println(fmsg);
  }
}
 
Example #9
Source File: XPath.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Warn the user of an problem.
 *
 * @param xctxt The XPath runtime context.
 * @param sourceNode Not used.
 * @param msg An error msgkey that corresponds to one of the constants found
 *            in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
 *            a key for a format string.
 * @param args An array of arguments represented in the format string, which
 *             may be null.
 *
 * @throws TransformerException if the current ErrorListoner determines to
 *                              throw an exception.
 */
public void warn(
        XPathContext xctxt, int sourceNode, String msg, Object[] args)
          throws javax.xml.transform.TransformerException
{

  String fmsg = XSLMessages.createXPATHWarning(msg, args);
  ErrorListener ehandler = xctxt.getErrorListener();

  if (null != ehandler)
  {

    // TO DO: Need to get stylesheet Locator from here.
    ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator()));
  }
}
 
Example #10
Source File: XObject.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Tell the user of an error, and probably throw an
 * exception.
 *
 * @param msg Error message to issue
 * @param args Arguments to use in the message
 *
 * @throws javax.xml.transform.TransformerException
 */
protected void error(String msg, Object[] args)
        throws javax.xml.transform.TransformerException
{

  String fmsg = XSLMessages.createXPATHMessage(msg, args);

  // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR,
  //                                      m_support.ERROR,
  //                                      null,
  //                                      null, fmsg, 0, 0);
  // if(shouldThrow)
  {
    throw new XPathException(fmsg, this);
  }
}
 
Example #11
Source File: NodeSet.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy NodeList members into this nodelist, adding in
 * document order.  If a node is null, don't add it.
 *
 * @param nodelist List of nodes which should now be referenced by
 * this NodeSet.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public void addNodes(NodeList nodelist)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  if (null != nodelist)  // defensive to fix a bug that Sanjiva reported.
  {
    int nChildren = nodelist.getLength();

    for (int i = 0; i < nChildren; i++)
    {
      Node obj = nodelist.item(i);

      if (null != obj)
      {
        addElement(obj);
      }
    }
  }

  // checkDups();
}
 
Example #12
Source File: VariableStack.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get a local variable or parameter in the current stack frame.
 *
 *
 * @param xctxt The XPath context, which must be passed in order to
 * lazy evaluate variables.
 *
 * @param index Local variable index relative to the current stack
 * frame bottom.
 *
 * @return The value of the variable.
 *
 * @throws TransformerException
 */
public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK)
        throws TransformerException
{

  index += _currentFrameBottom;

  XObject val = _stackFrames[index];

  if(null == val)
    throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
                   xctxt.getSAXLocator());
    // "Variable accessed before it is bound!", xctxt.getSAXLocator());

  // Lazy execution of variables.
  if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
    return (_stackFrames[index] = val.execute(xctxt));

  return destructiveOK ? val : val.getFresh();
}
 
Example #13
Source File: XPath.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Warn the user of an problem.
 *
 * @param xctxt The XPath runtime context.
 * @param sourceNode Not used.
 * @param msg An error msgkey that corresponds to one of the constants found
 *            in {@link com.sun.org.apache.xpath.internal.res.XPATHErrorResources}, which is
 *            a key for a format string.
 * @param args An array of arguments represented in the format string, which
 *             may be null.
 *
 * @throws TransformerException if the current ErrorListoner determines to
 *                              throw an exception.
 */
public void warn(
        XPathContext xctxt, int sourceNode, String msg, Object[] args)
          throws javax.xml.transform.TransformerException
{

  String fmsg = XSLMessages.createXPATHWarning(msg, args);
  ErrorListener ehandler = xctxt.getErrorListener();

  if (null != ehandler)
  {

    // TO DO: Need to get stylesheet Locator from here.
    ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator()));
  }
}
 
Example #14
Source File: FuncCurrent.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  SubContextList subContextList = xctxt.getCurrentNodeList();
  int currentNode = DTM.NULL;

  if (null != subContextList) {
      if (subContextList instanceof PredicatedNodeTest) {
          LocPathIterator iter = ((PredicatedNodeTest)subContextList)
                                                        .getLocPathIterator();
          currentNode = iter.getCurrentContextNode();
       } else if(subContextList instanceof StepPattern) {
         throw new RuntimeException(XSLMessages.createMessage(
            XSLTErrorResources.ER_PROCESSOR_ERROR,null));
       }
  } else {
      // not predicate => ContextNode == CurrentNode
      currentNode = xctxt.getContextNode();
  }
  return new XNodeSet(currentNode, xctxt.getDTMManager());
}
 
Example #15
Source File: JAXPExtensionsProvider.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Is the extension function available?
 */

public boolean functionAvailable(String ns, String funcName)
      throws javax.xml.transform.TransformerException {
  try {
    if ( funcName == null ) {
        String fmsg = XSLMessages.createXPATHMessage(
            XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
            new Object[] {"Function Name"} );
        throw new NullPointerException ( fmsg );
    }
    //Find the XPathFunction corresponding to namespace and funcName
    javax.xml.namespace.QName myQName = new QName( ns, funcName );
    javax.xml.xpath.XPathFunction xpathFunction =
        resolver.resolveFunction ( myQName, 0 );
    if (  xpathFunction == null ) {
        return false;
    }
    return true;
  } catch ( Exception e ) {
    return false;
  }


}
 
Example #16
Source File: XObject.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Tell the user of an error, and probably throw an
 * exception.
 *
 * @param msg Error message to issue
 * @param args Arguments to use in the message
 *
 * @throws javax.xml.transform.TransformerException
 */
protected void error(String msg, Object[] args)
        throws javax.xml.transform.TransformerException
{

  String fmsg = XSLMessages.createXPATHMessage(msg, args);

  // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR,
  //                                      m_support.ERROR,
  //                                      null,
  //                                      null, fmsg, 0, 0);
  // if(shouldThrow)
  {
    throw new XPathException(fmsg, this);
  }
}
 
Example #17
Source File: VariableStack.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Get a local variable or parameter in the current stack frame.
 *
 *
 * @param xctxt The XPath context, which must be passed in order to
 * lazy evaluate variables.
 *
 * @param index Local variable index relative to the current stack
 * frame bottom.
 *
 * @return The value of the variable.
 *
 * @throws TransformerException
 */
public XObject getLocalVariable(XPathContext xctxt, int index)
        throws TransformerException
{

  index += _currentFrameBottom;

  XObject val = _stackFrames[index];

  if(null == val)
    throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
                   xctxt.getSAXLocator());
    // "Variable accessed before it is bound!", xctxt.getSAXLocator());

  // Lazy execution of variables.
  if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
    return (_stackFrames[index] = val.execute(xctxt));

  return val;
}
 
Example #18
Source File: XPath.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Tell the user of an assertion error, and probably throw an
 * exception.
 *
 * @param b  If false, a runtime exception will be thrown.
 * @param msg The assertion message, which should be informative.
 *
 * @throws RuntimeException if the b argument is false.
 */
public void assertion(boolean b, String msg)
{

  if (!b)
  {
    String fMsg = XSLMessages.createXPATHMessage(
      XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
      new Object[]{ msg });

    throw new RuntimeException(fMsg);
  }
}
 
Example #19
Source File: OpMap.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Given a location step position, return the end position, i.e. the
 * beginning of the next step.
 *
 * @param opPos the position of a location step.
 * @return the position of the next location step.
 */
public int getNextStepPos(int opPos)
{

  int stepType = getOp(opPos);

  if ((stepType >= OpCodes.AXES_START_TYPES)
          && (stepType <= OpCodes.AXES_END_TYPES))
  {
    return getNextOpPos(opPos);
  }
  else if ((stepType >= OpCodes.FIRST_NODESET_OP)
           && (stepType <= OpCodes.LAST_NODESET_OP))
  {
    int newOpPos = getNextOpPos(opPos);

    while (OpCodes.OP_PREDICATE == getOp(newOpPos))
    {
      newOpPos = getNextOpPos(newOpPos);
    }

    stepType = getOp(newOpPos);

    if (!((stepType >= OpCodes.AXES_START_TYPES)
          && (stepType <= OpCodes.AXES_END_TYPES)))
    {
      return OpCodes.ENDOP;
    }

    return newOpPos;
  }
  else
  {
    throw new RuntimeException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNKNOWN_STEP, new Object[]{String.valueOf(stepType)}));
    //"Programmer's assertion in getNextStepPos: unknown stepType: " + stepType);
  }
}
 
Example #20
Source File: NodeSetDTM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the current position in the node set.
 * @param i Must be a valid index.
 * @throws RuntimeException thrown if this NodeSetDTM is not of
 * a cached type, and thus doesn't permit indexed access.
 */
public void setCurrentPos(int i)
{

  if (!m_cacheNodes)
    throw new RuntimeException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!");

  m_next = i;
}
 
Example #21
Source File: XPathImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Object getResultAsType( XObject resultObject, QName returnType )
    throws javax.xml.transform.TransformerException {
    // XPathConstants.STRING
    if ( returnType.equals( XPathConstants.STRING ) ) {
        return resultObject.str();
    }
    // XPathConstants.NUMBER
    if ( returnType.equals( XPathConstants.NUMBER ) ) {
        return new Double ( resultObject.num());
    }
    // XPathConstants.BOOLEAN
    if ( returnType.equals( XPathConstants.BOOLEAN ) ) {
        return new Boolean( resultObject.bool());
    }
    // XPathConstants.NODESET ---ORdered, UNOrdered???
    if ( returnType.equals( XPathConstants.NODESET ) ) {
        return resultObject.nodelist();
    }
    // XPathConstants.NODE
    if ( returnType.equals( XPathConstants.NODE ) ) {
        NodeIterator ni = resultObject.nodeset();
        //Return the first node, or null
        return ni.nextNode();
    }
    String fmsg = XSLMessages.createXPATHMessage(
            XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
            new Object[] { returnType.toString()});
    throw new IllegalArgumentException( fmsg );
}
 
Example #22
Source File: XRTreeFragSelectWrapper.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Cast result object to a number.
 *
 * @return The result tree fragment as a number or NaN
 */
public double num()
  throws javax.xml.transform.TransformerException
{

      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"num() not supported by XRTreeFragSelectWrapper!");
}
 
Example #23
Source File: NodeSet.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Set the current position in the node set.
 * @param i Must be a valid index.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a cached type, and thus doesn't permit indexed access.
 */
public void setCurrentPos(int i)
{

  if (!m_cacheNodes)
    throw new RuntimeException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");

  m_next = i;
}
 
Example #24
Source File: NodeSetDTM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Inserts the specified node in this vector at the specified index.
 * Each component in this vector with an index greater or equal to
 * the specified index is shifted upward to have an index one greater
 * than the value it had previously.
 * @throws RuntimeException thrown if this NodeSetDTM is not of
 * a mutable type.
 */
public void removeAllElements()
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

  super.removeAllElements();
}
 
Example #25
Source File: NodeSet.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Inserts the specified node in this vector at the specified index.
 * Each component in this vector with an index greater or equal to
 * the specified index is shifted upward to have an index one greater
 * than the value it had previously.
 *
 * @param value Node to insert
 * @param at Position where to insert
 */
public void insertElementAt(Node value, int at)
{
  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  if (null == m_map)
  {
    m_map = new Node[m_blocksize];
    m_mapSize = m_blocksize;
  }
  else if ((m_firstFree + 1) >= m_mapSize)
  {
    m_mapSize += m_blocksize;

    Node newMap[] = new Node[m_mapSize];

    System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);

    m_map = newMap;
  }

  if (at <= (m_firstFree - 1))
  {
    System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at);
  }

  m_map[at] = value;

  m_firstFree++;
}
 
Example #26
Source File: XStringForFSB.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Construct a XNodeSet object.
 *
 * @param val String object this will wrap.
 */
private XStringForFSB(String val)
{

  super(val);

  throw new IllegalArgumentException(
    XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FSB_CANNOT_TAKE_STRING, null)); // "XStringForFSB can not take a string for an argument!");
}
 
Example #27
Source File: NodeSet.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add a node to the NodeSet. Not all types of NodeSets support this
 * operation
 *
 * @param n Node to be added
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public void addNode(Node n)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  this.addElement(n);
}
 
Example #28
Source File: NodeSetDTM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Append a Node onto the vector.
 *
 * @param value The node to be added.
 * @throws RuntimeException thrown if this NodeSetDTM is not of
 * a mutable type.
 */
public void addElement(int value)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

  super.addElement(value);
}
 
Example #29
Source File: NodeSet.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Remove a node.
 *
 * @param n Node to be added
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public void removeNode(Node n)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

  this.removeElement(n);
}
 
Example #30
Source File: XStringForChars.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Construct a XNodeSet object.
 *
 * @param val String object this will wrap.
 */
private XStringForChars(String val)
{
  super(val);
  throw new IllegalArgumentException(
                    XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XSTRINGFORCHARS_CANNOT_TAKE_STRING, null)); //"XStringForChars can not take a string for an argument!");
}