【发布时间】:2011-06-17 11:08:49
【问题描述】:
谁能帮我把这个 java sn-p 翻译成 perl/Moose 术语?尝试理解 java 对象语法/逻辑,我只知道 perl。
基于 cmets 的编辑:sn-p 来自 xwiki 包 - http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents... 它太大了,无法分析,那么剩下的代码呢?有可能(仅用于解释 - 忽略 @lines?'@something' 的一般含义是什么?
@Component("hello")
public class HelloWorldScriptService implements ScriptService
{
@Requirement
private HelloWorld helloWorld;
public String greet()
{
return this.helloWorld.sayHello();
}
}
正在寻找类似下一个 perl 片段的内容,但不知道“@Component、@Requirement - 等:(
package HelloWorldScriptService;
use Moose;
sub greet {
return $self->
}
是否存在一些用 perl-ish 术语解释 java 的文档? (至少,一些基础知识)
【问题讨论】:
-
注解@Component 和@Requirement 不是Java 库的一部分。为了转码,你必须看看他们应该做什么。如果有帮助,它们看起来就像 Spring 注释。
-
@Component 可能是 spring,但 @Requirement 不是。同意您需要告诉我们这些注释的来源!
-
啊,所以。好的,thanx - 重新编辑我的问题。