public class FormatNumber2 extends SystemFunction implements XSLTFunction
operation
argument
locationId, staticProperties
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Constructor and Description |
---|
FormatNumber2() |
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
adjustToDecimal(double value,
int precision)
Convert a double to a BigDecimal.
|
void |
checkArguments(StaticContext env)
Method called during static type checking
|
String |
evaluateAsString(XPathContext context)
Evaluate in a context where a string is wanted
|
Item |
evaluateItem(XPathContext c)
Evaluate in a general context
|
void |
fixup(DecimalSymbols dfs)
Fixup: this is a callback from the DecimalFormatManager used once the xsl:decimal-format
element is identified
|
Expression |
preEvaluate(StaticContext env)
preEvaluate: this method suppresses compile-time evaluation by doing nothing.
|
addContextDocumentArgument, computeCardinality, computeSpecialProperties, display, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, main, makeSystemFunction, setDetails, useContextItemAsDefault
checkArgumentCount, getDisplayName, getFunctionNameCode, getNumberOfArguments, iterateSubExpressions, optimize, promote, setArguments, setFunctionNameCode, simplify, simplifyArguments, typeCheck
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, dynamicError, effectiveBooleanValue, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, iterate, markTailFunctionCalls, process, resetStaticProperties, setLocationId, setParentExpression, suppressValidation, typeError, typeError
public void checkArguments(StaticContext env) throws XPathException
SystemFunction
checkArguments
in class SystemFunction
XPathException
public void fixup(DecimalSymbols dfs)
public Expression preEvaluate(StaticContext env) throws XPathException
preEvaluate
in class FunctionCall
XPathException
public String evaluateAsString(XPathContext context) throws XPathException
evaluateAsString
in interface Expression
evaluateAsString
in class ComputedExpression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic Item evaluateItem(XPathContext c) throws XPathException
evaluateItem
in interface Expression
evaluateItem
in class ComputedExpression
c
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic static BigDecimal adjustToDecimal(double value, int precision)
value
- the double to be convertedprecision
- 2 for a double, 1 for a float