Search in sources :

Example 1 with FunctionName

use of org.apache.tapestry5.clojure.FunctionName in project tapestry-5 by apache.

the class ModuleInitsManager method addInitialization.

public void addInitialization(InitializationPriority priority, String moduleName, String functionName, JSONArray arguments) {
    assert priority != null;
    assert InternalUtils.isNonBlank(moduleName);
    String name = functionName == null ? moduleName : moduleName + ":" + functionName;
    if ((arguments == null || arguments.length() == 0)) {
        if (pureInits.contains(name)) {
            // the first priority wins.
            return;
        }
        pureInits.add(name);
        InternalUtils.addToMapList(inits, priority, name);
    } else {
        JSONArray init = new JSONArray();
        init.put(name);
        init.putAll(arguments);
        InternalUtils.addToMapList(inits, priority, init);
    }
    initCount++;
}
Also used : JSONArray(org.apache.tapestry5.json.JSONArray)

Example 2 with FunctionName

use of org.apache.tapestry5.clojure.FunctionName in project tapestry-5 by apache.

the class AnnotationMapper method mapMethod.

@Override
public Symbol mapMethod(String namespace, Method method) {
    FunctionName annotation = method.getAnnotation(FunctionName.class);
    if (annotation == null) {
        return null;
    }
    String name = annotation.value();
    if (name.contains("/")) {
        return Symbol.create(name);
    }
    return Symbol.create(namespace, name);
}
Also used : FunctionName(org.apache.tapestry5.clojure.FunctionName)

Aggregations

FunctionName (org.apache.tapestry5.clojure.FunctionName)1 JSONArray (org.apache.tapestry5.json.JSONArray)1