Browse Source

增加资源文件的存放示例

pull/3/head
richie 6 years ago
parent
commit
1f11299d04
  1. 1
      plugin-function/plugin.xml
  2. 2
      plugin-function/src/main/java/com/fr/plugin/MyAbs.java
  3. 10
      plugin-function/src/main/java/com/fr/plugin/MyLocaleFinder.java
  4. 1
      plugin-function/src/main/resources/com/fr/plugin/demo.properties
  5. 1
      plugin-function/src/main/resources/com/fr/plugin/demo_zh_CN.properties

1
plugin-function/plugin.xml

@ -13,5 +13,6 @@
]]></change-notes>
<extra-core>
<FunctionDefineProvider class="com.fr.plugin.MyAbs" name="MyAbs" description="求绝对值,支持数组。"/>
<LocaleFinder class="com.fr.plugin.MyLocaleFinder"/>
</extra-core>
</plugin>

2
plugin-function/src/main/java/com/fr/plugin/MyAbs.java

@ -12,7 +12,7 @@ import com.fr.stable.Primitive;
@EnableMetrics
public class MyAbs extends AbstractFunction {
@Focus(id = "com.fr.plugin.function.test", text = "Function description", source = Original.PLUGIN)
@Focus(id = "com.fr.plugin.function.test", text = "Plugin-Test_Function_Abs", source = Original.PLUGIN)
public Object run(Object[] args) {
int len = ArrayUtils.getLength(args);
if (len == 0) {

10
plugin-function/src/main/java/com/fr/plugin/MyLocaleFinder.java

@ -0,0 +1,10 @@
package com.fr.plugin;
import com.fr.stable.fun.impl.AbstractLocaleFinder;
public class MyLocaleFinder extends AbstractLocaleFinder {
@Override
public String find() {
return "com/fr/plugin/demo";
}
}

1
plugin-function/src/main/resources/com/fr/plugin/demo.properties

@ -0,0 +1 @@
Plugin-Test_Function_Abs=Test ABS

1
plugin-function/src/main/resources/com/fr/plugin/demo_zh_CN.properties

@ -0,0 +1 @@
Plugin-Test_Function_Abs=测试ABS函数
Loading…
Cancel
Save