Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #121 from adamretter/develop

[refactor] Improved deprecation status of various deprecated functions
  • Loading branch information...
commit 8d6581b7e27140f53bda065b4e4ed4d038600a65 2 parents 8b4ad79 + f7a4833
@dizzzz dizzzz authored
View
2  extensions/modules/src/org/exist/xquery/modules/math/NoParamFunctions.java
@@ -55,7 +55,7 @@
"Returns the value of pi.",
null,
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the value of pi"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#pi"
+ org.exist.xquery.functions.math.NoParamFunctions.FNS_PI
),
new FunctionSignature(
new QName("random", MathModule.NAMESPACE_URI),
View
18 extensions/modules/src/org/exist/xquery/modules/math/OneParamFunctions.java
@@ -58,21 +58,21 @@
"Returns the arc cosine of an angle, in the range of 0.0 through pi.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#acos"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_ACOS
),
new FunctionSignature(
new QName("asin", MathModule.NAMESPACE_URI),
"Returns the arc sine of an angle, in the range of -pi/2 through pi/2.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "result"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#asin"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_ASIN
),
new FunctionSignature(
new QName("atan", MathModule.NAMESPACE_URI),
"Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#atan"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_ATAN
),
new FunctionSignature(
new QName("ceil", MathModule.NAMESPACE_URI),
@@ -85,14 +85,14 @@
"Returns the trigonometric cosine of an angle.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the cosine"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#cos"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_COS
),
new FunctionSignature(
new QName("exp", MathModule.NAMESPACE_URI),
"Calculates e (the Euler Constant) raised to the power of a value or expression",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "e (the Euler Constant) raised to the power of a value or expression"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#exp"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_EXP
),
new FunctionSignature(
new QName("floor", MathModule.NAMESPACE_URI),
@@ -105,7 +105,7 @@
"Returns the natural logarithm (base e) of a number.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the log"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#log"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_LOG
),
new FunctionSignature(
new QName("round", MathModule.NAMESPACE_URI),
@@ -118,21 +118,21 @@
"Returns the trigonometric sine of an angle.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the sine"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#sin"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_SIN
),
new FunctionSignature(
new QName("sqrt", MathModule.NAMESPACE_URI),
"Returns the correctly rounded positive square root of a number.",
new SequenceType[] { new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the square root of $x"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#sqrt"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_SQRT
),
new FunctionSignature(
new QName("tan", MathModule.NAMESPACE_URI),
"Returns the tangent of the number passed as an argument in radians.",
new SequenceType[] { new FunctionParameterSequenceType("radians", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The radians") },
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the tangent"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#tan"
+ org.exist.xquery.functions.math.OneParamFunctions.FNS_TAN
),
new FunctionSignature(
new QName("degrees", MathModule.NAMESPACE_URI),
View
4 extensions/modules/src/org/exist/xquery/modules/math/TwoParamFunctions.java
@@ -56,7 +56,7 @@
},
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the theta component of the point (r, theta) in "
+ "polar coordinates that corresponds to the point (x, y) in Cartesian coordinates."),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#atan2"
+ org.exist.xquery.functions.math.TwoParamFunctions.FNS_ATAN2
),
new FunctionSignature(
new QName("power", MathModule.NAMESPACE_URI),
@@ -66,7 +66,7 @@
new FunctionParameterSequenceType("power", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The power to raise the value to")
},
new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result"),
- "Replaced by http://www.w3.org/2005/xpath-functions/math/#pow"
+ org.exist.xquery.functions.math.TwoParamFunctions.FNS_POW
)
};
View
15 src/org/exist/xquery/functions/inspect/InspectModule.java
@@ -24,8 +24,8 @@
public class InspectModule extends BasicFunction {
- public final static FunctionSignature signatures[] = {
- new FunctionSignature(
+
+ public final static FunctionSignature FNS_INSPECT_MODULE = new FunctionSignature(
new QName("inspect-module", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
"Compiles a module from source (without importing it) and returns an XML fragment describing the " +
"module and the functions/variables contained in it.",
@@ -34,8 +34,10 @@
"The location URI of the module to inspect"),
},
new FunctionReturnSequenceType(Type.ELEMENT, Cardinality.ZERO_OR_ONE,
- "An XML fragment describing the module and all functions contained in it.")),
- new FunctionSignature(
+ "An XML fragment describing the module and all functions contained in it.")
+ );
+
+ public final static FunctionSignature FNS_INSPECT_MODULE_URI = new FunctionSignature(
new QName("inspect-module-uri", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
"Returns an XML fragment describing the " +
"module identified by the given URI and the functions/variables contained in it.",
@@ -44,8 +46,9 @@
"The location URI of the module to inspect"),
},
new FunctionReturnSequenceType(Type.ELEMENT, Cardinality.ZERO_OR_ONE,
- "An XML fragment describing the module and all functions contained in it.")),
- };
+ "An XML fragment describing the module and all functions contained in it.")
+ );
+
private static final QName MODULE_QNAME = new QName("module");
private static final QName VARIABLE_QNAME = new QName("variable");
View
10 src/org/exist/xquery/functions/inspect/InspectionModule.java
@@ -16,11 +16,11 @@
public final static FunctionDef[] functions = {
new FunctionDef(InspectFunction.SIGNATURE, InspectFunction.class),
- new FunctionDef(InspectModule.signatures[0], InspectModule.class),
- new FunctionDef(InspectModule.signatures[1], InspectModule.class),
- new FunctionDef(ModuleFunctions.signatures[0], ModuleFunctions.class),
- new FunctionDef(ModuleFunctions.signatures[1], ModuleFunctions.class),
- new FunctionDef(ModuleFunctions.signatures[2], ModuleFunctions.class)
+ new FunctionDef(InspectModule.FNS_INSPECT_MODULE, InspectModule.class),
+ new FunctionDef(InspectModule.FNS_INSPECT_MODULE_URI, InspectModule.class),
+ new FunctionDef(ModuleFunctions.FNS_MODULE_FUNCTIONS_CURRENT, ModuleFunctions.class),
+ new FunctionDef(ModuleFunctions.FNS_MODULE_FUNCTIONS_OTHER, ModuleFunctions.class),
+ new FunctionDef(ModuleFunctions.FNS_MODULE_FUNCTIONS_OTHER_URI, ModuleFunctions.class)
};
public InspectionModule(Map<String, List<? extends Object>> parameters) {
View
63 src/org/exist/xquery/functions/inspect/ModuleFunctions.java
@@ -12,36 +12,39 @@
import java.util.List;
public class ModuleFunctions extends BasicFunction {
-
- public static final FunctionSignature signatures[] = {
- new FunctionSignature(
- new QName("module-functions", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
- "Returns a sequence of function items pointing to each public function in the current module.",
- new SequenceType[] {},
- new FunctionReturnSequenceType(
- Type.FUNCTION_REFERENCE,
- Cardinality.ZERO_OR_MORE,
- "Sequence of function items containing all public functions in the current module or the empty sequence " +
- "if the module is not known in the current context.")),
- new FunctionSignature(
- new QName("module-functions", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
- "Returns a sequence of function items pointing to each public function in the specified module.",
- new SequenceType[] { new FunctionParameterSequenceType("location", Type.ANY_URI, Cardinality.EXACTLY_ONE, "The location URI of the module to be loaded.") },
- new FunctionReturnSequenceType(
- Type.FUNCTION_REFERENCE,
- Cardinality.ZERO_OR_MORE,
- "Sequence of function items containing all public functions in the module or the empty sequence " +
- "if the module is not known in the current context.")),
- new FunctionSignature(
- new QName("module-functions-by-uri", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
- "Returns a sequence of function items pointing to each public function in the specified module.",
- new SequenceType[] { new FunctionParameterSequenceType("uri", Type.ANY_URI, Cardinality.EXACTLY_ONE, "The URI of the module to be loaded.") },
- new FunctionReturnSequenceType(
- Type.FUNCTION_REFERENCE,
- Cardinality.ZERO_OR_MORE,
- "Sequence of function items containing all public functions in the module or the empty sequence " +
- "if the module is not known in the current context."))
- };
+
+ public final static FunctionSignature FNS_MODULE_FUNCTIONS_CURRENT = new FunctionSignature(
+ new QName("module-functions", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
+ "Returns a sequence of function items pointing to each public function in the current module.",
+ new SequenceType[] {},
+ new FunctionReturnSequenceType(
+ Type.FUNCTION_REFERENCE,
+ Cardinality.ZERO_OR_MORE,
+ "Sequence of function items containing all public functions in the current module or the empty sequence " +
+ "if the module is not known in the current context.")
+ );
+
+ public final static FunctionSignature FNS_MODULE_FUNCTIONS_OTHER = new FunctionSignature(
+ new QName("module-functions", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
+ "Returns a sequence of function items pointing to each public function in the specified module.",
+ new SequenceType[] { new FunctionParameterSequenceType("location", Type.ANY_URI, Cardinality.EXACTLY_ONE, "The location URI of the module to be loaded.") },
+ new FunctionReturnSequenceType(
+ Type.FUNCTION_REFERENCE,
+ Cardinality.ZERO_OR_MORE,
+ "Sequence of function items containing all public functions in the module or the empty sequence " +
+ "if the module is not known in the current context.")
+ );
+
+ public final static FunctionSignature FNS_MODULE_FUNCTIONS_OTHER_URI = new FunctionSignature(
+ new QName("module-functions-by-uri", InspectionModule.NAMESPACE_URI, InspectionModule.PREFIX),
+ "Returns a sequence of function items pointing to each public function in the specified module.",
+ new SequenceType[] { new FunctionParameterSequenceType("uri", Type.ANY_URI, Cardinality.EXACTLY_ONE, "The URI of the module to be loaded.") },
+ new FunctionReturnSequenceType(
+ Type.FUNCTION_REFERENCE,
+ Cardinality.ZERO_OR_MORE,
+ "Sequence of function items containing all public functions in the module or the empty sequence " +
+ "if the module is not known in the current context.")
+ );
public ModuleFunctions(XQueryContext context, FunctionSignature signature) {
super(context, signature);
View
28 src/org/exist/xquery/functions/math/MathModule.java
@@ -42,22 +42,22 @@
private final static FunctionDef functions[] = {
- new FunctionDef(OneParamFunctions.signature[0], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[1], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[2], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[3], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[4], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[5], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[6], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[7], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[8], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[9], OneParamFunctions.class),
- new FunctionDef(OneParamFunctions.signature[10], OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_ACOS, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_ASIN, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_ATAN, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_COS, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_EXP, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_EXP10, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_LOG, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_LOG10, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_SIN, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_SQRT, OneParamFunctions.class),
+ new FunctionDef(OneParamFunctions.FNS_TAN, OneParamFunctions.class),
- new FunctionDef(NoParamFunctions.signature[0], NoParamFunctions.class),
+ new FunctionDef(NoParamFunctions.FNS_PI, NoParamFunctions.class),
- new FunctionDef(TwoParamFunctions.signature[0], TwoParamFunctions.class),
- new FunctionDef(TwoParamFunctions.signature[1], TwoParamFunctions.class)
+ new FunctionDef(TwoParamFunctions.FNS_ATAN2, TwoParamFunctions.class),
+ new FunctionDef(TwoParamFunctions.FNS_POW, TwoParamFunctions.class)
};
public MathModule(Map<String, List<? extends Object>> parameters) {
View
16 src/org/exist/xquery/functions/math/NoParamFunctions.java
@@ -42,18 +42,16 @@
*/
public class NoParamFunctions extends BasicFunction {
- //private static final Logger logger = Logger.getLogger(NoParamFunctions.class);
+ //private static final Logger logger = Logger.getLogger(NoParamFunctions.class);
public static final String PI = "pi";
- public final static FunctionSignature signature[] = {
- new FunctionSignature(
- new QName(PI, MathModule.NAMESPACE_URI),
- "Returns the value of pi.",
- null,
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the value of pi")
- )
- };
+ public final static FunctionSignature FNS_PI = new FunctionSignature(
+ new QName(PI, MathModule.NAMESPACE_URI),
+ "Returns the value of pi.",
+ null,
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the value of pi")
+ );
/**
* @param context
View
144 src/org/exist/xquery/functions/math/OneParamFunctions.java
@@ -59,74 +59,82 @@
public static final String SQRT = "sqrt";
public static final String TAN = "tan";
- public final static FunctionSignature signature[] = {
- new FunctionSignature(
- new QName(ACOS, MathModule.NAMESPACE_URI),
- "Returns the arc cosine of the argument, the result being in the range zero to +π radians.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result")
- ),
- new FunctionSignature(
- new QName(ASIN, MathModule.NAMESPACE_URI),
- "Returns the arc sine of the argument, the result being in the range -π/2 to +π/2 radians.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "result")
- ),
- new FunctionSignature(
- new QName(ATAN, MathModule.NAMESPACE_URI),
- "Returns the arc tangent of the argument, the result being in the range -π/2 to +π/2 radians.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result")
- ),
- new FunctionSignature(
- new QName(COS, MathModule.NAMESPACE_URI),
- "Returns the cosine of the argument, expressed in radians.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the cosine")
- ),
- new FunctionSignature(
- new QName(EXP, MathModule.NAMESPACE_URI),
- "Calculates e (the Euler Constant) raised to the power of $arg",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "e (the Euler Constant) raised to the power of a value or expression")
- ),
- new FunctionSignature( // NEW
- new QName(EXP10, MathModule.NAMESPACE_URI),
- "Calculates 10 raised to the power of $arg",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "e (the Euler Constant) raised to the power of a value or expression")
- ),
- new FunctionSignature(
- new QName(LOG, MathModule.NAMESPACE_URI),
- "Returns the natural logarithm of the argument.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the log")
- ),
- new FunctionSignature( // NEW
- new QName(LOG10, MathModule.NAMESPACE_URI),
- "Returns the base-ten logarithm of the argument.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the log")
- ),
- new FunctionSignature(
- new QName(SIN, MathModule.NAMESPACE_URI),
- "Returns the sine of the argument, expressed in radians.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the sine")
- ),
- new FunctionSignature(
- new QName(SQRT, MathModule.NAMESPACE_URI),
- "Returns the non-negative square root of the argument.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the square root of $x")
- ),
- new FunctionSignature(
- new QName(TAN, MathModule.NAMESPACE_URI),
- "Returns the tangent of the argument, expressed in radians.",
- new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The radians") },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the tangent")
- ),
- };
+ public final static FunctionSignature FNS_ACOS = new FunctionSignature(
+ new QName(ACOS, MathModule.NAMESPACE_URI),
+ "Returns the arc cosine of the argument, the result being in the range zero to +π radians.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result")
+ );
+
+ public final static FunctionSignature FNS_ASIN = new FunctionSignature(
+ new QName(ASIN, MathModule.NAMESPACE_URI),
+ "Returns the arc sine of the argument, the result being in the range -π/2 to +π/2 radians.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "result")
+ );
+
+ public final static FunctionSignature FNS_ATAN = new FunctionSignature(
+ new QName(ATAN, MathModule.NAMESPACE_URI),
+ "Returns the arc tangent of the argument, the result being in the range -π/2 to +π/2 radians.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result")
+ );
+
+ public final static FunctionSignature FNS_COS = new FunctionSignature(
+ new QName(COS, MathModule.NAMESPACE_URI),
+ "Returns the cosine of the argument, expressed in radians.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the cosine")
+ );
+
+ public final static FunctionSignature FNS_EXP = new FunctionSignature(
+ new QName(EXP, MathModule.NAMESPACE_URI),
+ "Calculates e (the Euler Constant) raised to the power of $arg",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "e (the Euler Constant) raised to the power of a value or expression")
+ );
+
+ public final static FunctionSignature FNS_EXP10 = new FunctionSignature( // NEW
+ new QName(EXP10, MathModule.NAMESPACE_URI),
+ "Calculates 10 raised to the power of $arg",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "e (the Euler Constant) raised to the power of a value or expression")
+ );
+
+ public final static FunctionSignature FNS_LOG = new FunctionSignature(
+ new QName(LOG, MathModule.NAMESPACE_URI),
+ "Returns the natural logarithm of the argument.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the log")
+ );
+
+ public final static FunctionSignature FNS_LOG10 = new FunctionSignature( // NEW
+ new QName(LOG10, MathModule.NAMESPACE_URI),
+ "Returns the base-ten logarithm of the argument.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the log")
+ );
+
+ public final static FunctionSignature FNS_SIN = new FunctionSignature(
+ new QName(SIN, MathModule.NAMESPACE_URI),
+ "Returns the sine of the argument, expressed in radians.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the sine")
+ );
+
+ public final static FunctionSignature FNS_SQRT = new FunctionSignature(
+ new QName(SQRT, MathModule.NAMESPACE_URI),
+ "Returns the non-negative square root of the argument.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The input number") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the square root of $x")
+ );
+
+ public final static FunctionSignature FNS_TAN = new FunctionSignature(
+ new QName(TAN, MathModule.NAMESPACE_URI),
+ "Returns the tangent of the argument, expressed in radians.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The radians") },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the tangent")
+ );
/**
* @param context
View
46 src/org/exist/xquery/functions/math/TwoParamFunctions.java
@@ -45,33 +45,33 @@
*/
public class TwoParamFunctions extends BasicFunction {
- @SuppressWarnings("unused")
- private static final Logger logger = Logger.getLogger(TwoParamFunctions.class);
+ @SuppressWarnings("unused")
+ private static final Logger logger = Logger.getLogger(TwoParamFunctions.class);
public static final String ATAN2 = "atan2";
public static final String POW = "pow";
- public final static FunctionSignature signature[] = {
- new FunctionSignature(
- new QName(ATAN2, MathModule.NAMESPACE_URI),
- "Returns the angle in radians subtended at the origin by the point on a "
- + "plane with coordinates (x, y) and the positive x-axis, the result being in the range -π to +π.",
- new SequenceType[] {
- new FunctionParameterSequenceType("y", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The y coordinate"),
- new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The x coordinate")
- },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.")
- ),
- new FunctionSignature(
- new QName(POW, MathModule.NAMESPACE_URI),
- "Returns the result of raising the first argument to the power of the second.",
- new SequenceType[] {
- new FunctionParameterSequenceType("value", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The value"),
- new FunctionParameterSequenceType("power", Type.NUMBER, Cardinality.EXACTLY_ONE, "The power to raise the value to")
- },
- new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result")
- )
- };
+
+ public final static FunctionSignature FNS_ATAN2 = new FunctionSignature(
+ new QName(ATAN2, MathModule.NAMESPACE_URI),
+ "Returns the angle in radians subtended at the origin by the point on a "
+ + "plane with coordinates (x, y) and the positive x-axis, the result being in the range -π to +π.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("y", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The y coordinate"),
+ new FunctionParameterSequenceType("x", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The x coordinate")
+ },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.")
+ );
+
+ public final static FunctionSignature FNS_POW = new FunctionSignature(
+ new QName(POW, MathModule.NAMESPACE_URI),
+ "Returns the result of raising the first argument to the power of the second.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("value", Type.DOUBLE, Cardinality.EXACTLY_ONE, "The value"),
+ new FunctionParameterSequenceType("power", Type.NUMBER, Cardinality.EXACTLY_ONE, "The power to raise the value to")
+ },
+ new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the result")
+ );
/**
* @param context
View
2  src/org/exist/xquery/functions/response/SetHeader.java
@@ -68,7 +68,7 @@
"Set's a HTTP Header on the HTTP Response.",
new SequenceType[] { NAME_PARAM, VALUE_PARAM },
new SequenceType(Type.ITEM, Cardinality.EMPTY),
- "Moved to response module and renamed to response:set-header.");
+ SetHeader.signature);
public SetHeader( XQueryContext context )
{
View
4 src/org/exist/xquery/functions/text/KWICDisplay.java
@@ -84,7 +84,7 @@
new SequenceType[]{ TEXT_ARG, WIDTH_ARG, CALLBACK_ARG, PARAMETERS_ARG },
new FunctionReturnSequenceType(Type.NODE, Cardinality.ZERO_OR_MORE, "the results"),
"Improved kwic functionality is now provided by a separate XQuery module, see " +
- "http://exist-db.org/kwic.html."),
+ "http://www.exist-db.org/exist/apps/doc/kwic.xml."),
new FunctionSignature(
new QName("kwic-display", TextModule.NAMESPACE_URI, TextModule.PREFIX),
"This function takes a sequence of text nodes in $a, containing matches from a fulltext search. " +
@@ -107,7 +107,7 @@
new SequenceType[]{ TEXT_ARG, WIDTH_ARG, CALLBACK_ARG, RESULT_CALLBACK_ARG, PARAMETERS_ARG },
new FunctionReturnSequenceType(Type.NODE, Cardinality.ZERO_OR_MORE, "the results"),
"Improved kwic functionality is now provided by a separate XQuery module, see " +
- "http://exist-db.org/kwic.html.")
+ "http://www.exist-db.org/exist/apps/doc/kwic.xml.")
};
public KWICDisplay(XQueryContext context, FunctionSignature signature) {
View
6 src/org/exist/xquery/functions/util/BuiltinFunctions.java
@@ -30,6 +30,8 @@
import org.exist.dom.QName;
import org.exist.xquery.*;
import org.exist.xquery.functions.fn.FunOnFunctions;
+import org.exist.xquery.functions.inspect.InspectFunction;
+import org.exist.xquery.functions.inspect.ModuleFunctions;
import org.exist.xquery.value.*;
/**
@@ -68,13 +70,13 @@
"Returns a sequence of function items for each function in the current module.",
null,
new FunctionReturnSequenceType(Type.FUNCTION_REFERENCE, Cardinality.ZERO_OR_MORE, "sequence of function references"),
- "Use inspect:module-functions instead."),
+ ModuleFunctions.FNS_MODULE_FUNCTIONS_CURRENT),
new FunctionSignature(
new QName("list-functions", UtilModule.NAMESPACE_URI, UtilModule.PREFIX),
"Returns a sequence of function items for each function in the specified module.",
new SequenceType[] { new FunctionParameterSequenceType("namespace-uri", Type.STRING, Cardinality.EXACTLY_ONE, "The namespace URI of the function module") },
new FunctionReturnSequenceType(Type.FUNCTION_REFERENCE, Cardinality.ZERO_OR_MORE, "sequence of function references"),
- "Use inspect:module-functions instead.")
+ ModuleFunctions.FNS_MODULE_FUNCTIONS_OTHER)
};
public BuiltinFunctions(XQueryContext context, FunctionSignature signature) {
View
2  src/org/exist/xquery/functions/util/CatchFunction.java
@@ -64,7 +64,7 @@
new FunctionParameterSequenceType("catch-code-blocks", Type.ITEM, Cardinality.ZERO_OR_MORE, "The code blocks that will be will called if the catch matches one of the $java-classnames")
},
new FunctionReturnSequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE, "the results from the try-catch"),
- "Use the XQuery 3.0 try/catch expression in stead."
+ "Use the XQuery 3.0 try/catch expression instead."
);
/**
View
3  src/org/exist/xquery/functions/util/DescribeFunction.java
@@ -36,6 +36,7 @@
import org.exist.xquery.Module;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.functions.inspect.InspectFunction;
import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
@@ -62,7 +63,7 @@
new FunctionParameterSequenceType("function-name", Type.QNAME, Cardinality.EXACTLY_ONE, "The name of the function to get the signature of"),
},
new FunctionReturnSequenceType(Type.NODE, Cardinality.EXACTLY_ONE, "the signature of the function"),
- "Use inspect:inspect-function instead.");
+ InspectFunction.SIGNATURE);
private final static QName ANNOTATION_QNAME = new QName("annotation");
private final static QName ANNOTATION_VALUE_QNAME = new QName("value");
View
17 src/org/exist/xquery/functions/util/ModuleInfo.java
@@ -39,6 +39,7 @@
import org.exist.xquery.Module;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.functions.inspect.InspectModule;
import org.exist.xquery.value.BooleanValue;
import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.FunctionReturnSequenceType;
@@ -109,7 +110,7 @@
"Returns a short description of the module identified by the namespace URI.",
new SequenceType[] { NAMESPACE_URI_PARAMETER },
new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "the description of the active function module identified by the namespace URI"),
- "Use inspect:inspect-module-uri instead."
+ InspectModule.FNS_INSPECT_MODULE_URI
);
public final static FunctionSignature moduleInfoSig =
@@ -123,14 +124,14 @@
);
public final static FunctionSignature moduleInfoWithURISig =
- new FunctionSignature(
- new QName("get-module-info", UtilModule.NAMESPACE_URI, UtilModule.PREFIX),
- "Returns an XML fragment providing additional information about the module identified by the " +
- "namespace URI.",
- new SequenceType[] { NAMESPACE_URI_PARAMETER },
- new FunctionReturnSequenceType(Type.ELEMENT, Cardinality.EXACTLY_ONE,
+ new FunctionSignature(
+ new QName("get-module-info", UtilModule.NAMESPACE_URI, UtilModule.PREFIX),
+ "Returns an XML fragment providing additional information about the module identified by the " +
+ "namespace URI.",
+ new SequenceType[] { NAMESPACE_URI_PARAMETER },
+ new FunctionReturnSequenceType(Type.ELEMENT, Cardinality.EXACTLY_ONE,
"the description of the active function module identified by the namespace URI"),
- "Use inspect:inspect-module-uri instead."
+ InspectModule.FNS_INSPECT_MODULE_URI
);
private static final QName MODULE_QNAME = new QName("module");
Please sign in to comment.
Something went wrong with that request. Please try again.