• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XSLMessages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



XSLMessages类属于com.sun.org.apache.xalan.internal.res包,在下文中一共展示了XSLMessages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: evaluate

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入依赖的package包/类
/**
 * The dyn:evaluate function evaluates a string as an XPath expression and returns
 * the resulting value, which might be a boolean, number, string, node set, result
 * tree fragment or external object. The sole argument is the string to be evaluated.
 * <p>
 * If the expression string passed as the second argument is an invalid XPath
 * expression (including an empty string), this function returns an empty node set.
 * <p>
 * You should only use this function if the expression must be constructed dynamically,
 * otherwise it is much more efficient to use the expression literally.
 *
 * @param myContext The ExpressionContext passed by the extension processor
 * @param xpathExpr The XPath expression string
 *
 * @return The evaluation result
 */
public static XObject evaluate(ExpressionContext myContext, String xpathExpr)
  throws SAXNotSupportedException
{
  if (myContext instanceof XPathContext.XPathExpressionContext)
  {
    XPathContext xctxt = null;
    try
    {
      xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
      XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(),
                                     xctxt.getNamespaceContext(),
                                     XPath.SELECT);

      return dynamicXPath.execute(xctxt, myContext.getContextNode(),
                                  xctxt.getNamespaceContext());
    }
    catch (TransformerException e)
    {
      return new XNodeSet(xctxt.getDTMManager());
    }
  }
  else
    throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate "
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:ExsltDynamic.java


示例2: 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


示例3: error

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

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

  TransformerException te = new TransformerException(fmsg, m_sourceLocator);
  if (null != ehandler)
  {
    // TO DO: Need to get stylesheet Locator from here.
    ehandler.fatalError(te);
  }
  else
  {
    // System.err.println(fmsg);
    throw te;
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:XPathParser.java


示例4: 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>DTM.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 NodeSetDTM is not of
 * a cached type, and hence doesn't know what the previous node was.
 */
public int previousNode()
{

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

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

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


示例5: 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


示例6: 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:VariableStack.java


示例7: addNodes

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 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:NodeSet.java


示例8: warn

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


示例9: setRoot

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入依赖的package包/类
/**
 * Set the root node of the TreeWalker.
 * (Not part of the DOM2 TreeWalker interface).
 *
 * @param root The context node of this step.
 */
public void setRoot(int root)
{
  // %OPT% Get this directly from the lpi.
  XPathContext xctxt = wi().getXPathContext();
  m_dtm = xctxt.getDTM(root);
  m_traverser = m_dtm.getAxisTraverser(m_axis);
  m_isFresh = true;
  m_foundLast = false;
  m_root = root;
  m_currentNode = root;

  if (DTM.NULL == root)
  {
    throw new RuntimeException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
  }

  resetProximityPositions();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AxesWalker.java


示例10: 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


示例11: compile

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入依赖的package包/类
/**
 * <p>Compile an XPath expression for later evaluation.</p>
 *
 * <p>If <code>expression</code> contains any {@link XPathFunction}s,
 * they must be available via the {@link XPathFunctionResolver}.
 * An {@link XPathExpressionException} will be thrown if the <code>XPathFunction</code>
 * cannot be resovled with the <code>XPathFunctionResolver</code>.</p>
 *
 * <p>If <code>expression</code> is <code>null</code>, a <code>NullPointerException</code> is thrown.</p>
 *
 * @param expression The XPath expression.
 *
 * @return Compiled XPath expression.

 * @throws XPathExpressionException If <code>expression</code> cannot be compiled.
 * @throws NullPointerException If <code>expression</code> is <code>null</code>.
 */
public XPathExpression compile(String expression)
    throws XPathExpressionException {
    if ( expression == null ) {
        String fmsg = XSLMessages.createXPATHMessage(
                XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
                new Object[] {"XPath expression"} );
        throw new NullPointerException ( fmsg );
    }
    try {
        com.sun.org.apache.xpath.internal.XPath xpath = new XPath (expression, null,
                prefixResolver, com.sun.org.apache.xpath.internal.XPath.SELECT );
        // Can have errorListener
        XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath,
                prefixResolver, functionResolver, variableResolver,
                featureSecureProcessing, useServiceMechanism, featureManager );
        return ximpl;
    } catch ( javax.xml.transform.TransformerException te ) {
        throw new XPathExpressionException ( te ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:XPathImpl.java


示例12: error

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

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


  if (null != m_errorHandler)
  {
    m_errorHandler.fatalError(new TransformerException(fmsg, m_locator));
  }
  else
  {

    // System.out.println(te.getMessage()
    //                    +"; file "+te.getSystemId()
    //                    +"; line "+te.getLineNumber()
    //                    +"; column "+te.getColumnNumber());
    throw new TransformerException(fmsg, (SAXSourceLocator)m_locator);
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:Compiler.java


示例13: 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)
        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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:VariableStack.java


示例14: execute

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


示例15: warn

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


示例16: warn

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


示例17: reportWrongNumberArgs

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入依赖的package包/类
/**
 * Constructs and throws a WrongNumberArgException with the appropriate
 * message for this function object.  This class supports an arbitrary
 * number of arguments, so this method must never be called.
 *
 * @throws WrongNumberArgsException
 */
protected void reportWrongNumberArgs() throws WrongNumberArgsException {
  String fMsg = XSLMessages.createXPATHMessage(
      XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
      new Object[]{ "Programmer's assertion:  the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." });

  throw new RuntimeException(fMsg);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:FuncExtFunction.java


示例18: XStringForChars

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入依赖的package包/类
/**
 * Construct a XNodeSet object.
 *
 * @param val FastStringBuffer object this will wrap, must be non-null.
 * @param start The start position in the array.
 * @param length The number of characters to read from the array.
 */
public XStringForChars(char[] val, int start, int length)
{
  super(val);
  m_start = start;
  m_length = length;
  if(null == val)
    throw new IllegalArgumentException(
                        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FASTSTRINGBUFFER_CANNOT_BE_NULL, null)); //"The FastStringBuffer argument can not be null!!");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XStringForChars.java


示例19: XStringForFSB

import com.sun.org.apache.xalan.internal.res.XSLMessages; //导入依赖的package包/类
/**
 * Construct a XNodeSet object.
 *
 * @param val FastStringBuffer object this will wrap, must be non-null.
 * @param start The start position in the array.
 * @param length The number of characters to read from the array.
 */
public XStringForFSB(FastStringBuffer val, int start, int length)
{

  super(val);

  m_start = start;
  m_length = length;

  if (null == val)
    throw new IllegalArgumentException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FASTSTRINGBUFFER_CANNOT_BE_NULL, null));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XStringForFSB.java


示例20: 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:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:XRTreeFragSelectWrapper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TabbedPanel类代码示例发布时间:2022-05-23
下一篇:
Java StreamHost类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap