Search in sources :

Example 11 with FunctionLib

use of lucee.transformer.library.function.FunctionLib in project Lucee by lucee.

the class GetFunctionKeywords method call.

public static Array call(PageContext pc) throws PageException {
    synchronized (keywords) {
        if (keywords == null) {
            Set<String> set = new HashSet<String>();
            FunctionLib[] flds;
            flds = ((ConfigImpl) pc.getConfig()).getFLDs(pc.getCurrentTemplateDialect());
            Map<String, FunctionLibFunction> functions;
            Iterator<FunctionLibFunction> it;
            FunctionLibFunction flf;
            String[] arr;
            for (int i = 0; i < flds.length; i++) {
                functions = flds[i].getFunctions();
                it = functions.values().iterator();
                while (it.hasNext()) {
                    flf = it.next();
                    if (flf.getStatus() != TagLib.STATUS_HIDDEN && flf.getStatus() != TagLib.STATUS_UNIMPLEMENTED && !ArrayUtil.isEmpty(flf.getKeywords())) {
                        arr = flf.getKeywords();
                        if (arr != null)
                            for (int y = 0; y < arr.length; y++) {
                                set.add(arr[y].toLowerCase());
                            }
                    }
                }
            }
            keywords = Caster.toArray(set);
            ArraySort.call(pc, keywords, "textnocase");
        // }
        }
    }
    return keywords;
}
Also used : FunctionLibFunction(lucee.transformer.library.function.FunctionLibFunction) FunctionLib(lucee.transformer.library.function.FunctionLib) HashSet(java.util.HashSet)

Aggregations

FunctionLib (lucee.transformer.library.function.FunctionLib)11 FunctionLibFunction (lucee.transformer.library.function.FunctionLibFunction)6 Resource (lucee.commons.io.res.Resource)3 ExtensionResourceFilter (lucee.commons.io.res.filter.ExtensionResourceFilter)2 ConfigWebImpl (lucee.runtime.config.ConfigWebImpl)2 TagLib (lucee.transformer.library.tag.TagLib)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 lucee.aprint (lucee.aprint)1 CompressResource (lucee.commons.io.res.type.compress.CompressResource)1 MappingImpl (lucee.runtime.MappingImpl)1 ExpressionException (lucee.runtime.exp.ExpressionException)1 BIF (lucee.runtime.ext.function.BIF)1 BIFProxy (lucee.runtime.functions.BIFProxy)1 LString (lucee.runtime.interpreter.ref.literal.LString)1 Key (lucee.runtime.type.Collection.Key)1 Query (lucee.runtime.type.Query)1