/** * Creates a message from the specified key and replacement * arguments, localized to the given locale. * * @param msgKey The key for the message text. * @param args The arguments to be used as replacement text * in the message created. * * @return The formatted message string. */ public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception { // BEGIN android-changed // don't localize exception messages return createXPATHMsg(XPATHBundle, msgKey, args); // END android-changed }
/** * Creates a message from the specified key and replacement * arguments, localized to the given locale. * * @param msgKey The key for the message text. * @param args The arguments to be used as replacement text * in the message created. * * @return The formatted warning string. */ public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception { if (XPATHBundle == null) XPATHBundle = loadResourceBundle(XPATH_ERROR_RESOURCES); if (XPATHBundle != null) { return createXPATHMsg(XPATHBundle, msgKey, args); } else return "Could not load any resource bundles."; }
/** * @exception DOMException * NAMESPACE_ERR: Always throws this exceptionn * * @see org.apache.xml.utils.PrefixResolver#getNamespaceForPrefix(String, Node) */ public String getNamespaceForPrefix(String prefix, Node context) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_RESOLVER, null); throw new DOMException(DOMException.NAMESPACE_ERR, fmsg); // Unable to resolve prefix with null prefix resolver. }
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
String suffix = getResourceSuffix(locale);
/** * 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(); }
/** * Creates a message from the specified key and replacement * arguments, localized to the given locale. * * @param msgKey The key for the message text. * @param args The arguments to be used as replacement text * in the message created. * * @return The formatted message string. */ public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception { if (XPATHBundle == null) XPATHBundle = loadResourceBundle(XPATH_ERROR_RESOURCES); if (XPATHBundle != null) { return createXPATHMsg(XPATHBundle, msgKey, args); } else return "Could not load any resource bundles."; }
/** * Creates a message from the specified key and replacement * arguments, localized to the given locale. * * @param msgKey The key for the message text. * @param args The arguments to be used as replacement text * in the message created. * * @return The formatted warning string. */ public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception { // BEGIN android-changed // don't localize exception messages return createXPATHMsg(XPATHBundle, msgKey, args); // END android-changed }
/** * @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()); } } }
/** * 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()); } } }