本文整理汇总了Java中org.cubeengine.dirigent.context.Arguments.create方法的典型用法代码示例。如果您正苦于以下问题:Java Arguments.create方法的具体用法?Java Arguments.create怎么用?Java Arguments.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cubeengine.dirigent.context.Arguments
的用法示例。
在下文中一共展示了Arguments.create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toArgs
import org.cubeengine.dirigent.context.Arguments; //导入方法依赖的package包/类
public static Arguments toArgs(Object... args)
{
List<String> values = new ArrayList<String>();
Map<String, String> params = new HashMap<String, String>();
for (final Object arg : args)
{
if (arg instanceof String)
{
values.add((String)arg);
}
else
{
String[] pair = (String[])arg;
params.put(pair[0].toLowerCase(), pair[1]);
}
}
return Arguments.create(values, params);
}
示例2: parseArguments
import org.cubeengine.dirigent.context.Arguments; //导入方法依赖的package包/类
private static Arguments parseArguments(State s)
{
List<String> values = null;
Map<String, String> params = null;
while (is(s, SECTION_SEP))
{
// skip SECTION_SEP
++s.offset;
final String name = readUntil(s, PARAM_NAME_FOLLOW, false);
if (is(s, VALUE_SEP))
{
// skip VALUE_SEP
++s.offset;
if (name.isEmpty())
{
return null;
}
else
{
if (params == null)
{
params = new HashMap<String, String>(1);
}
params.put(name.toLowerCase(), readUntil(s, SECTION_FOLLOW, false));
}
}
else
{
if (values == null)
{
values = new ArrayList<String>(1);
}
values.add(name);
}
}
return Arguments.create(values, params);
}
示例3: testInvokerWithArguments
import org.cubeengine.dirigent.context.Arguments; //导入方法依赖的package包/类
@Test
public void testInvokerWithArguments()
{
final String msg = "blub";
final Arguments arguments = Arguments.create(singletonList("arg"), null);
final Component component = new WithArguments().process(msg, Contexts.EMPTY, arguments);
Assert.assertTrue(component instanceof TextComponent);
Assert.assertEquals(msg + arguments, ((TextComponent)component).getText());
}
示例4: testInvokerWithContextAndArguments
import org.cubeengine.dirigent.context.Arguments; //导入方法依赖的package包/类
@Test
public void testInvokerWithContextAndArguments()
{
final String msg = "blub";
final Locale locale = Locale.GERMANY;
final Arguments arguments = Arguments.create(singletonList("arg"), null);
final Component component = new WithContextAndArguments().process(msg, Contexts.createContext(locale), arguments);
Assert.assertTrue(component instanceof TextComponent);
Assert.assertEquals(msg + locale + arguments, ((TextComponent)component).getText());
}
示例5: testInvokerWithArgumentsAndContext
import org.cubeengine.dirigent.context.Arguments; //导入方法依赖的package包/类
@Test
public void testInvokerWithArgumentsAndContext()
{
final String msg = "blub";
final Locale locale = Locale.GERMANY;
final Arguments arguments = Arguments.create(singletonList("arg"), null);
final Component component = new WithArgumentsAndContext().process(msg, Contexts.createContext(locale), arguments);
Assert.assertTrue(component instanceof TextComponent);
Assert.assertEquals(msg + arguments + locale, ((TextComponent)component).getText());
}