public class Callback extends Object
Constructor and Description |
---|
Callback() |
Modifier and Type | Method and Description |
---|---|
static int |
booleanFromString(CharSequence s)
Convert a string to a boolean value, using the XML Schema rules (including
whitespace trimming)
|
static long |
doubleToIntegerOrError(double value)
Convert a double to a integer number, throwing an exception if value is equal to NaN or infinity
|
static XPathException |
makeJavaInvocationException(Exception err,
JavaExtensionFunctionCall call)
Construct (but do not throw) an exception wrapping an exception thrown by a Java extension function
|
static String |
makeMessageFromTemplate(String messageTemplate,
CharSequence param0)
Expand a message template containing one variable string
|
static XPathException |
makeMultipleItemsException(CardinalityChecker expression,
XPathContext context)
Construct an exception reporting that a sequence of more than item was found where a single item
was expected
|
static XPathException |
makeNonComparableException(AtomicValue av0,
AtomicValue av1,
String systemId,
int lineNumber)
Construct (but don't throw) an exception reporting that two atomic values are not comparable
|
static XPathException |
makeXmlNamespaceException(String prefix,
String namespace,
boolean isXSLT,
String systemId,
int lineNumber)
Construct (but do not throw) an exception reporting that the namespace prefix "xml" and the XML namespace
URI can only be used as a pair
|
static XPathException |
makeXPathException(String message,
String errorCode,
String systemId,
int lineNumber,
boolean isTypeError)
Construct (but do not throw) an XPath exception.
|
static double |
stringToNumberOrNaN(StringToDouble s2d,
CharSequence string)
Convert a string to a double number, returning NaN if the string is not numeric
|
public static String makeMessageFromTemplate(String messageTemplate, CharSequence param0)
messageTemplate
- the message template in which a placeholder for the inserted
string is indicated by the characters "{$1}"param0
- the variable string to be inserted into the messagepublic static XPathException makeNonComparableException(AtomicValue av0, AtomicValue av1, String systemId, int lineNumber)
av0
- the first atomic valueav1
- the second atomic valuesystemId
- the module containing the comparisonlineNumber
- the line number of the comparison within this modulepublic static XPathException makeXmlNamespaceException(String prefix, String namespace, boolean isXSLT, String systemId, int lineNumber)
prefix
- the prefix that was actually usednamespace
- the namespace URI that was actually usedisXSLT
- true if this is XSLT code, false if XQuery (affects the error code produced)systemId
- the module in which the error occurredlineNumber
- the line number where the error occurredpublic static XPathException makeJavaInvocationException(Exception err, JavaExtensionFunctionCall call)
err
- the exception thrown by the called extension functioncall
- the extension function call in which the error occurredpublic static XPathException makeMultipleItemsException(CardinalityChecker expression, XPathContext context)
expression
- the cardinality checker that detects the error. This is re-evaluated to include
the first few items of the sequence in the error messagecontext
- the dynamic contextpublic static XPathException makeXPathException(String message, String errorCode, String systemId, int lineNumber, boolean isTypeError)
message
- the error messageerrorCode
- the local part of the error codesystemId
- the URI of the module in which the error occurslineNumber
- the line within the module where the error occurspublic static double stringToNumberOrNaN(StringToDouble s2d, CharSequence string)
s2d
- the string to double converter to be usedstring
- the string to be convertedpublic static long doubleToIntegerOrError(double value) throws XPathException
value
- - The double type that is required to convertXPathException
- if the supplied value is NaN or infinitypublic static int booleanFromString(CharSequence s)
s
- the input stringCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.