Meteor.methods
foo: ->
// this.connection is the DDP connection
SomePackage.bar()
我希望能够访问我的包connection
函数中的bar
,而不会让调用者(我的包的用户)将连接作为参数传递。
答案 0 :(得分:0)
是://Define the first @StringDef interface
@StringDef({X_COLOR , O_COLOR})
@Retention(RetentionPolicy.SOURCE)
public @interface ColorPreference{}
public static final String X_COLOR = "x_color";
public static final String O_COLOR = "O_color";
//Define the second @StringDef interface
@StringDef({PLAYER_X , PLAYER_Y})
@Retention(RetentionPolicy.SOURCE)
public @interface PlayerPreferences{};
public static final String PLAYER_X = "player_x";
public static final String PLAYER_Y = "player_y";