gpt4 book ai didi

org.w3c.dom.xpath.XPathException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 01:53:05 27 4
gpt4 key购买 nike

本文整理了Java中org.w3c.dom.xpath.XPathException.<init>()方法的一些代码示例,展示了XPathException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathException.<init>()方法的具体详情如下:
包路径:org.w3c.dom.xpath.XPathException
类名称:XPathException
方法名:<init>

XPathException.<init>介绍

暂无

代码示例

代码示例来源:origin: xalan/xalan

/**
   * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
   */
  public boolean getBooleanValue() throws XPathException {
    if (getResultType() != BOOLEAN_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."            
    } else {
      try {
        return m_resultObj.bool();
      } catch (TransformerException e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: xalan/xalan

/**
   *  The value of this number result.
   * @exception XPathException
   *   TYPE_ERR: raised if <code>resultType</code> is not 
   *   <code>NUMBER_TYPE</code>.
   * @see org.w3c.dom.xpath.XPathResult#getNumberValue()
   */
  public double getNumberValue() throws XPathException {
    if (getResultType() != NUMBER_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number"
    } else {
      try {
        return m_resultObj.num();
      } catch (Exception e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }        
  }

代码示例来源:origin: xalan/xalan

/**
   * The value of this string result.
   * @exception XPathException
   *   TYPE_ERR: raised if <code>resultType</code> is not 
   *   <code>STRING_TYPE</code>.
   * 
   * @see org.w3c.dom.xpath.XPathResult#getStringValue()
   */
  public String getStringValue() throws XPathException {
    if (getResultType() != STRING_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string."
    } else {
      try {
        return m_resultObj.str();
      } catch (Exception e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: xalan/xalan

/**
   * The number of nodes in the result snapshot. Valid values for 
   * snapshotItem indices are <code>0</code> to 
   * <code>snapshotLength-1</code> inclusive.
   * @exception XPathException
   *   TYPE_ERR: raised if <code>resultType</code> is not 
   *   <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or 
   *   <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
   * 
   * @see org.w3c.dom.xpath.XPathResult#getSnapshotLength()
   */
  public int getSnapshotLength() throws XPathException {
  
    if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
      (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
        String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                        
        throw new XPathException(XPathException.TYPE_ERR,fmsg); 
//                "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
    }
      
    return m_list.getLength();
  }

代码示例来源:origin: xalan/xalan

(m_resultType != FIRST_ORDERED_NODE_TYPE)) {
    String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                        
    throw new XPathException(XPathException.TYPE_ERR,fmsg);
  result = m_resultObj.nodeset();
} catch (TransformerException te) {
  throw new XPathException(XPathException.TYPE_ERR,te.getMessage());

代码示例来源:origin: xalan/xalan

(m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                        
throw new XPathException(XPathException.TYPE_ERR, fmsg);

代码示例来源:origin: xalan/xalan

throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}               
} catch (TransformerException te) {
  throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation());

代码示例来源:origin: xalan/xalan

throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}           
throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,fmsg); // Empty XPath result object
   throw new XPathException(XPathException.TYPE_ERR, fmsg);  // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."},
  throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."},

代码示例来源:origin: xalan/xalan

throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation());
else
  throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation());

代码示例来源:origin: xalan/xalan

(m_resultType != ORDERED_NODE_ITERATOR_TYPE)) {
String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                        
throw new XPathException(XPathException.TYPE_ERR, fmsg);

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Creates an exception with the appropriate error message.
 */
public XPathException createXPathException(short type,
                      String key,
                      Object[] args) {
  try {
    return new XPathException(type, formatMessage(key, args));
  } catch (Exception e) {
    return new XPathException(type, key);
  }
}

代码示例来源:origin: org.apache.xmlgraphics/batik-dom

/**
 * Creates an exception with the appropriate error message.
 */
public XPathException createXPathException(short type,
                      String key,
                      Object[] args) {
  try {
    return new XPathException(type, formatMessage(key, args));
  } catch (Exception e) {
    return new XPathException(type, key);
  }
}

代码示例来源:origin: apache/batik

/**
 * Creates an exception with the appropriate error message.
 */
public XPathException createXPathException(short type,
                      String key,
                      Object[] args) {
  try {
    return new XPathException(type, formatMessage(key, args));
  } catch (Exception e) {
    return new XPathException(type, key);
  }
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
   * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
   */
  public boolean getBooleanValue() throws XPathException {
    if (getResultType() != BOOLEAN_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."            
    } else {
      try {
        return m_resultObj.bool();
      } catch (TransformerException e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
   * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
   */
  public boolean getBooleanValue() throws XPathException {
    if (getResultType() != BOOLEAN_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."            
    } else {
      try {
        return m_resultObj.bool();
      } catch (TransformerException e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: org.apache.karaf.bundles/org.apache.karaf.bundles.xalan-2.7.1

/**
   * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
   */
  public boolean getBooleanValue() throws XPathException {
    if (getResultType() != BOOLEAN_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."            
    } else {
      try {
        return m_resultObj.bool();
      } catch (TransformerException e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan

/**
   * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
   */
  public boolean getBooleanValue() throws XPathException {
    if (getResultType() != BOOLEAN_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."            
    } else {
      try {
        return m_resultObj.bool();
      } catch (TransformerException e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: org.apache.xalan/com.springsource.org.apache.xalan

/**
   * @see org.w3c.dom.xpath.XPathResult#getBooleanValue()
   */
  public boolean getBooleanValue() throws XPathException {
    if (getResultType() != BOOLEAN_TYPE) {
      String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});		
      throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean."            
    } else {
      try {
        return m_resultObj.bool();
      } catch (TransformerException e) {
        // Type check above should prevent this exception from occurring.
        throw new XPathException(XPathException.TYPE_ERR,e.getMessage());
      }
    }
  }

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
   * The number of nodes in the result snapshot. Valid values for 
   * snapshotItem indices are <code>0</code> to 
   * <code>snapshotLength-1</code> inclusive.
   * @exception XPathException
   *   TYPE_ERR: raised if <code>resultType</code> is not 
   *   <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or 
   *   <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
   * 
   * @see org.w3c.dom.xpath.XPathResult#getSnapshotLength()
   */
  public int getSnapshotLength() throws XPathException {
  
    if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
      (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
        String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                        
        throw new XPathException(XPathException.TYPE_ERR,fmsg); 
//                "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
    }
      
    return m_list.getLength();
  }

代码示例来源:origin: org.apache.karaf.bundles/org.apache.karaf.bundles.xalan-2.7.1

/**
   * The number of nodes in the result snapshot. Valid values for 
   * snapshotItem indices are <code>0</code> to 
   * <code>snapshotLength-1</code> inclusive.
   * @exception XPathException
   *   TYPE_ERR: raised if <code>resultType</code> is not 
   *   <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or 
   *   <code>ORDERED_NODE_SNAPSHOT_TYPE</code>.
   * 
   * @see org.w3c.dom.xpath.XPathResult#getSnapshotLength()
   */
  public int getSnapshotLength() throws XPathException {
  
    if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
      (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
        String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                        
        throw new XPathException(XPathException.TYPE_ERR,fmsg); 
//                "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
    }
      
    return m_list.getLength();
  }

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com