当前位置: 首页>>代码示例>>Java>>正文


Java Function类代码示例

本文整理汇总了Java中elemental2.core.Function的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Function类属于elemental2.core包,在下文中一共展示了Function类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: copyHook

import elemental2.core.Function; //导入依赖的package包/类
/**
 * Copy the given hook function from the Java instance to the options we pass to Vue
 * @param hookFunctionName The name of the hook function to copy
 */
private void copyHook(String hookFunctionName)
{
    Function hookFunction =
        (Function) ((JsPropertyMap) vuegwt$javaDirectiveInstance).get(hookFunctionName);
    if (hookFunction == null)
        return;

    // Filter empty function inherited from VueDirective
    String body = getFunctionBody(hookFunction);
    if ("".equals(body))
        return;

    set(hookFunctionName, hookFunction);
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:19,代码来源:VueDirectiveOptions.java

示例2: asFunction

import elemental2.core.Function; //导入依赖的package包/类
@JsOverlay
public final Function asFunction() {
    return Js.uncheckedCast(this);
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:5,代码来源:RunSoon.java

示例3: callConstructor

import elemental2.core.Function; //导入依赖的package包/类
/**
 * Call our {@link VueComponent} constructor. Pass injected parameters if needed.
 * @param component {@link VueComponent} to process
 * @param createdMethodBuilder Builder for our Create method
 */
private void callConstructor(TypeElement component, MethodSpec.Builder createdMethodBuilder)
{
    createdMethodBuilder.addStatement("$T javaConstructor = $T.getJavaConstructor($T.class)",
        Function.class,
        VueGWT.class,
        componentJsTypeName(component));

    createdMethodBuilder.addStatement("javaConstructor.apply(this)");
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:15,代码来源:ComponentJsTypeGenerator.java

示例4: getFunctionBody

import elemental2.core.Function; //导入依赖的package包/类
private String getFunctionBody(Function jsFunction)
{
    JsString jsString = cast(jsFunction.toString());

    // Get content between first { and last }
    JsString m = cast(jsString.match(new JsRegExp("\\{([\\s\\S]*)\\}", "m"))[1]);
    // Strip comments
    return m.replace(new JsRegExp("^\\s*\\/\\/.*$", "mg"), "").trim();
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:10,代码来源:VueDirectiveOptions.java

示例5: wrapMethod

import elemental2.core.Function; //导入依赖的package包/类
/**
 * Proxy a method call to be warned when it called. This requires the
 * function to be JsInterop (name shouldn't change at runtime). This used to
 * observe Java Collections/Map. It won't be necessary in future versions of
 * Vue.js based on ES6 proxies.
 * @param object The object to observe
 * @param methodName The name of the method to proxify
 * @param afterMethodCall A callback called each time after the method has
 * been executed
 * @param <T> Type of the object the we Proxy
 */
public static <T> void wrapMethod(T object, String methodName,
    AfterMethodCall<T> afterMethodCall)
{
    Function method = (Function) ((JsPropertyMap) object).get(methodName);

    WrappingFunction wrappingFunction = args -> {
        Object result = method.apply(object, args);
        afterMethodCall.execute(object, methodName, result, args);
        return result;
    };

    ((JsPropertyMap) object).set(methodName, wrappingFunction);
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:25,代码来源:VueGWTTools.java

示例6: initRenderFunctions

import elemental2.core.Function; //导入依赖的package包/类
/**
 * Initialise the render functions from our template.
 */
@JsOverlay
private void initRenderFunctions()
{
    this.set("render", new Function(componentTemplate.getRenderFunction()));

    JsArray<Object> staticRenderFns = new JsArray<>();
    for (String staticRenderFunction : componentTemplate.getStaticRenderFunctions())
    {
        staticRenderFns.push(new Function(staticRenderFunction));
    }
    this.setStaticRenderFns(staticRenderFns);
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:16,代码来源:VueComponentOptions.java

示例7: addMethod

import elemental2.core.Function; //导入依赖的package包/类
@JsOverlay
public final VueComponentOptions addMethod(String name, Function method)
{
    if (this.methods == null)
        this.methods = (JsPropertyMap<Function>) new JsObject();

    this.methods.set(name, method);
    return this;
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:10,代码来源:VueComponentOptions.java

示例8: getJavaComponentMethod

import elemental2.core.Function; //导入依赖的package包/类
/**
 * Get the given java method from the {@link ComponentTemplate}.
 * @param javaMethodName Name of the Java method to retrieve
 * @return The JS function that represent our Java method.
 */
@JsOverlay
private Function getJavaComponentMethod(String javaMethodName)
{
    return (Function) componentJavaPrototype.get(javaMethodName);
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:11,代码来源:VueComponentOptions.java

示例9: getMethods

import elemental2.core.Function; //导入依赖的package包/类
@JsOverlay
public final JsPropertyMap<Function> getMethods()
{
    return methods;
}
 
开发者ID:Axellience,项目名称:vue-gwt,代码行数:6,代码来源:VueComponentOptions.java

示例10: set

import elemental2.core.Function; //导入依赖的package包/类
@JsProperty(name = "set")
Function set();
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:3,代码来源:JsObjectDescriptor.java

示例11: curryThisIn1

import elemental2.core.Function; //导入依赖的package包/类
public static native <This, Arg1> Function curryThisIn1(In2<This, Arg1> task)
/*-{
         return @JsFunctionSupport::maybeEnter(*)(function(){
           [email protected]::in(Ljava/lang/Object;Ljava/lang/Object;)(this, arguments[0]);
         });
 }-*/;
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:7,代码来源:JsFunctionSupport.java

示例12: setImmediate

import elemental2.core.Function; //导入依赖的package包/类
@JsProperty(name = "setImmediate")
public native Function setImmediate();
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:3,代码来源:RunSoon.java

示例13: runNow

import elemental2.core.Function; //导入依赖的package包/类
@JsProperty(name = "runNow")
public native Function runNow();
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:3,代码来源:RunSoon.java

示例14: clearImmediate

import elemental2.core.Function; //导入依赖的package包/类
@JsProperty(name = "clearImmediate")
public native Function clearImmediate();
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:3,代码来源:RunSoon.java

示例15: setStyle

import elemental2.core.Function; //导入依赖的package包/类
/**
 * Changes styles of GeoJSON vector layers with the given style function.
 *
 * @param style the style function
 * @return the L class
 */
@JsMethod
public native L setStyle(Function style);
 
开发者ID:gwidgets,项目名称:gwty-leaflet,代码行数:9,代码来源:GeoJSON.java


注:本文中的elemental2.core.Function类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。