当前位置: 首页>>代码示例>>Java>>正文


Java XSLMessages.createXPATHMessage方法代码示例

本文整理汇总了Java中com.sun.org.apache.xalan.internal.res.XSLMessages.createXPATHMessage方法的典型用法代码示例。如果您正苦于以下问题:Java XSLMessages.createXPATHMessage方法的具体用法?Java XSLMessages.createXPATHMessage怎么用?Java XSLMessages.createXPATHMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xalan.internal.res.XSLMessages的用法示例。


在下文中一共展示了XSLMessages.createXPATHMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: error

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:XObject.java

示例2: getLocalVariable

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:VariableStack.java

示例3: addNodes

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:NodeSetDTM.java

示例4: addNodes

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:NodeSet.java

示例5: error

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * Tell the user of an error, and probably throw an
 * exception.
 *
 * @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 error(
        XPathContext xctxt, int sourceNode, String msg, Object[] args)
          throws javax.xml.transform.TransformerException
{

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

  if (null != ehandler)
  {
    ehandler.fatalError(new TransformerException(fmsg,
                            (SAXSourceLocator)xctxt.getSAXLocator()));
  }
  else
  {
    SourceLocator slocator = xctxt.getSAXLocator();
    System.out.println(fmsg + "; file " + slocator.getSystemId()
                       + "; line " + slocator.getLineNumber() + "; column "
                       + slocator.getColumnNumber());
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:XPath.java

示例6: previousNode

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 *  Returns the previous node in the set and moves the position of the
 * iterator backwards in the set.
 * @return  The previous <code>Node</code> in the set being iterated over,
 *   or<code>null</code> if there are no more members in that set.
 * @throws DOMException
 *    INVALID_STATE_ERR: Raised if this method is called after the
 *   <code>detach</code> method was invoked.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a cached type, and hence doesn't know what the previous node was.
 */
public Node previousNode() throws DOMException
{

  if (!m_cacheNodes)
    throw new RuntimeException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!");

  if ((m_next - 1) > 0)
  {
    m_next--;

    return this.elementAt(m_next);
  }
  else
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:NodeSet.java

示例7: setElementAt

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * Sets the component at the specified index of this vector to be the
 * specified object. The previous component at that position is discarded.
 *
 * The index must be a value greater than or equal to 0 and less
 * than the current size of the vector.
 *
 * @param node Node to set
 * @param index Index of where to set the node
 */
public void setElementAt(Node node, int index)
{
  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;
  }

  m_map[index] = node;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:NodeSet.java

示例8: num

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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!");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:XRTreeFragSelectWrapper.java

示例9: setCurrentPos

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:NodeSet.java

示例10: removeAllElements

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:NodeSetDTM.java

示例11: addNode

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:NodeSet.java

示例12: addNodesInDocOrder

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * Copy NodeList members into this nodelist, adding in
 * document order.  If a node is null, don't add it.
 *
 * @param iterator NodeIterator which yields the 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(NodeIterator iterator, XPathContext support)
{

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

  Node node;

  while (null != (node = iterator.nextNode()))
  {
    addNodeInDocOrder(node, support);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:NodeSet.java

示例13: assertion

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * 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, java.lang.String msg)
{

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

    throw new RuntimeException(fMsg);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Compiler.java

示例14: addNodeInDocOrder

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * Add the node into a vector of nodes where it should occur in
 * document order.
 * @param node The node to be added.
 * @param test true if we should test for doc order
 * @param support The XPath runtime context.
 * @return insertIndex.
 * @throws RuntimeException thrown if this NodeSetDTM is not of
 * a mutable type.
 */
public int addNodeInDocOrder(int node, boolean test, XPathContext support)
{

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

  int insertIndex = -1;

  if (test)
  {

    // This needs to do a binary search, but a binary search
    // is somewhat tough because the sequence test involves
    // two nodes.
    int size = size(), i;

    for (i = size - 1; i >= 0; i--)
    {
      int child = elementAt(i);

      if (child == node)
      {
        i = -2;  // Duplicate, suppress insert

        break;
      }

      DTM dtm = support.getDTM(node);
      if (!dtm.isNodeAfter(node, child))
      {
        break;
      }
    }

    if (i != -2)
    {
      insertIndex = i + 1;

      insertElementAt(node, insertIndex);
    }
  }
  else
  {
    insertIndex = this.size();

    boolean foundit = false;

    for (int i = 0; i < insertIndex; i++)
    {
      if (i == node)
      {
        foundit = true;

        break;
      }
    }

    if (!foundit)
      addElement(node);
  }

  // checkDups();
  return insertIndex;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:75,代码来源:NodeSetDTM.java

示例15: addNodeInDocOrder

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入方法依赖的package包/类
/**
 * Add the node into a vector of nodes where it should occur in
 * document order.
 * @param node The node to be added.
 * @param support The XPath runtime context.
 *
 * @return The index where it was inserted.
 * @throws RuntimeException thrown if this NodeSet is not of
 * a mutable type.
 */
public int addNodeInDocOrder(Node node, XPathContext support)
{

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

  return addNodeInDocOrder(node, true, support);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:NodeSet.java


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