use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSString in project webtools.sourceediting by eclipse.
the class FnLowerCase method expected_args.
/**
* Calculate the expected arguments.
*
* @return The expected arguments.
*/
public static synchronized Collection expected_args() {
if (_expected_args == null) {
_expected_args = new ArrayList();
_expected_args.add(new SeqType(new XSString(), SeqType.OCC_QMARK));
}
return _expected_args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSString in project webtools.sourceediting by eclipse.
the class FnLowerCase method lower_case.
/**
* Convert arguments to lower case.
*
* @param args
* are converted to lower case.
* @throws DynamicError
* Dynamic error.
* @return The result of converting the arguments to lower case.
*/
public static ResultSequence lower_case(Collection args) throws DynamicError {
Collection cargs = Function.convert_arguments(args, expected_args());
ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
if (arg1.empty()) {
return new XSString("");
}
String str = ((XSString) arg1.first()).value();
return new XSString(str.toLowerCase());
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSString in project webtools.sourceediting by eclipse.
the class FnMatches method expected_args.
/**
* Obtain a list of expected arguments.
*
* @return Result of operation.
*/
public static synchronized Collection expected_args() {
if (_expected_args == null) {
_expected_args = new ArrayList();
SeqType arg = new SeqType(new XSString(), SeqType.OCC_QMARK);
_expected_args.add(arg);
_expected_args.add(new SeqType(new XSString(), SeqType.OCC_NONE));
_expected_args.add(new SeqType(new XSString(), SeqType.OCC_NONE));
}
return _expected_args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSString in project webtools.sourceediting by eclipse.
the class FnNormalizeSpace method normalize_space.
/**
* Normalize space in the arguments.
*
* @param args
* are used to obtain space from, in order to be normalized.
* @throws DynamicError
* Dynamic error.
* @return The result of normalizing the space in the arguments.
*/
public static ResultSequence normalize_space(Collection args, EvaluationContext ec) throws DynamicError {
Collection cargs = Function.convert_arguments(args, expected_args());
ResultSequence arg1 = null;
if (cargs.isEmpty()) {
// support for arity = 0
arg1 = getResultSetForArityZero(ec);
} else {
arg1 = (ResultSequence) cargs.iterator().next();
}
String str = "";
if (!arg1.empty()) {
str = ((XSString) arg1.first()).value();
}
return new XSString(normalize(str));
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSString in project webtools.sourceediting by eclipse.
the class FnStringJoin method expected_args.
/**
* Calculate the expected arguments.
*
* @return The expected arguments.
*/
public static synchronized Collection expected_args() {
if (_expected_args == null) {
_expected_args = new ArrayList();
_expected_args.add(new SeqType(new XSString(), SeqType.OCC_STAR));
_expected_args.add(new SeqType(new XSString(), SeqType.OCC_NONE));
}
return _expected_args;
}
Aggregations