Search in sources :

Example 1 with FunctionLibrary

use of org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary in project webtools.sourceediting by eclipse.

the class DefaultStaticContext method make_atomic.

/**
 * Creates an atomic from a specific type name initialized with a default
 * value.
 *
 * @param name
 *            name of type to create
 * @return Atomic type of desired type.
 */
public AnyAtomicType make_atomic(QName name) {
    String ns = name.namespace();
    if (!_functions.containsKey(ns))
        return null;
    FunctionLibrary fl = (FunctionLibrary) _functions.get(ns);
    if (!(fl instanceof ConstructorFL))
        return null;
    ConstructorFL cfl = (ConstructorFL) fl;
    return cfl.atomic_type(name);
}
Also used : FnFunctionLibrary(org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary) FunctionLibrary(org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary) ConstructorFL(org.eclipse.wst.xml.xpath2.processor.internal.function.ConstructorFL)

Example 2 with FunctionLibrary

use of org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary in project webtools.sourceediting by eclipse.

the class SeqType method make_atomic.

private AnyAtomicType make_atomic(StaticContext sc, QName qname) {
    String ns = qname.namespace();
    Map functionLibraries = sc.getFunctionLibraries();
    if (!functionLibraries.containsKey(ns))
        return null;
    FunctionLibrary fl = (FunctionLibrary) functionLibraries.get(ns);
    if (!(fl instanceof ConstructorFL))
        return null;
    ConstructorFL cfl = (ConstructorFL) fl;
    return cfl.atomic_type(qname);
}
Also used : FunctionLibrary(org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary) ConstructorFL(org.eclipse.wst.xml.xpath2.processor.internal.function.ConstructorFL) Map(java.util.Map)

Example 3 with FunctionLibrary

use of org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary in project webtools.sourceediting by eclipse.

the class DefaultStaticContext method function_exists.

/**
 * Check for existance of function.
 *
 * @param name
 *            function name.
 * @param arity
 *            arity of function.
 * @return true if function exists. False otherwise.
 */
public boolean function_exists(QName name, int arity) {
    String ns = name.namespace();
    if (!_functions.containsKey(ns))
        return false;
    FunctionLibrary fl = (FunctionLibrary) _functions.get(ns);
    return fl.function_exists(name, arity);
}
Also used : FnFunctionLibrary(org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary) FunctionLibrary(org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary)

Example 4 with FunctionLibrary

use of org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary in project webtools.sourceediting by eclipse.

the class DefaultStaticContext method function.

public Function function(QName name, int arity) {
    String ns = name.namespace();
    if (!_functions.containsKey(ns))
        return null;
    FunctionLibrary fl = (FunctionLibrary) _functions.get(ns);
    return fl.function(name, arity);
}
Also used : FnFunctionLibrary(org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary) FunctionLibrary(org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary)

Aggregations

FunctionLibrary (org.eclipse.wst.xml.xpath2.processor.internal.function.FunctionLibrary)4 FnFunctionLibrary (org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary)3 ConstructorFL (org.eclipse.wst.xml.xpath2.processor.internal.function.ConstructorFL)2 Map (java.util.Map)1