Examples of format()


Examples of org.jnode.shell.syntax.OptionSyntax.format()

    @org.junit.Test
    public void testFormat() {
        Test test = new Test();
        Syntax syntax1 = new OptionSyntax("fileArg", "file", 'f');
        Assert.assertEquals("--file | -f <fileArg>", syntax1.format(test.getArgumentBundle()));
        Syntax syntax2 = new OptionSyntax("intArg", "int");
        Assert.assertEquals("--int <intArg>", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new OptionSyntax("intArg", 'i');
        Assert.assertEquals("-i <intArg>", syntax3.format(test.getArgumentBundle()));
        Syntax syntax4 = new OptionSyntax("flagArg", "xxx", 'x');
View Full Code Here

Examples of org.jnode.shell.syntax.PowersetSyntax.format()

    public void testFormat() {
        ArgumentBundle bundle = new Test().getArgumentBundle();
        Syntax syntax1 =
                new PowersetSyntax(new OptionSyntax("intArg", 'i'),
                        new OptionSyntax("fileArg", 'f'));
        Assert.assertEquals("[ ( -i <intArg> ) | ( -f <fileArg> ) ] ...", syntax1.format(bundle));
    }

    @org.junit.Test
    public void testOne() throws Exception {
        TestShell shell = new TestShell();
View Full Code Here

Examples of org.jnode.shell.syntax.RepeatSyntax.format()

    @org.junit.Test
    public void testFormat() {
        Test test = new Test();
        Syntax syntax1 = new RepeatSyntax(new ArgumentSyntax("arg1"));
        Assert.assertEquals("[ <arg1> ... ]", syntax1.format(test.getArgumentBundle()));
        Syntax syntax2 = new RepeatSyntax(new ArgumentSyntax("arg1"), 1, Integer.MAX_VALUE);
        Assert.assertEquals("<arg1> ...", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new RepeatSyntax(new ArgumentSyntax("arg1"), 1, 2);
        Assert.assertEquals("<arg1> ...2", syntax3.format(test.getArgumentBundle()));
        Syntax syntax4 = new RepeatSyntax(new ArgumentSyntax("arg1"), 3, 6);
View Full Code Here

Examples of org.jnode.shell.syntax.SequenceSyntax.format()

    @org.junit.Test
    public void testFormat() {
        Test test = new Test();
        Syntax syntax1 = new SequenceSyntax(new ArgumentSyntax("fileArg"));
        Assert.assertEquals("<fileArg>", syntax1.format(test.getArgumentBundle()));
        Syntax syntax2 =
                new SequenceSyntax(new RepeatSyntax(new ArgumentSyntax("fileArg")),
                        new ArgumentSyntax("intArg"));
        Assert.assertEquals("[ <fileArg> ... ] <intArg>", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new SequenceSyntax();
View Full Code Here

Examples of org.jnode.shell.syntax.Syntax.format()

    @org.junit.Test
    public void testFormat() {
        Test test = new Test();
        Syntax syntax1 = new OptionSyntax("fileArg", "file", 'f');
        Assert.assertEquals("--file | -f <fileArg>", syntax1.format(test.getArgumentBundle()));
        Syntax syntax2 = new OptionSyntax("intArg", "int");
        Assert.assertEquals("--int <intArg>", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new OptionSyntax("intArg", 'i');
        Assert.assertEquals("-i <intArg>", syntax3.format(test.getArgumentBundle()));
        Syntax syntax4 = new OptionSyntax("flagArg", "xxx", 'x');
View Full Code Here

Examples of org.jruby.util.RubyDateFormat.format()

    @JRubyMethod(name = "strftime", required = 1)
    public RubyString strftime(IRubyObject format) {
        final RubyDateFormat rubyDateFormat = new RubyDateFormat("-", Locale.US);
        rubyDateFormat.applyPattern(format.toString());
        rubyDateFormat.setDateTime(dt);
        String result = rubyDateFormat.format(null);
        return getRuntime().newString(result);
    }
   
    @JRubyMethod(name = ">=", required = 1)
    public IRubyObject op_ge(ThreadContext context, IRubyObject other) {
View Full Code Here

Examples of org.jsmpp.util.RelativeTimeFormatter.format()

        // 6. Submit the short message
        String messageId = session.submitShortMessage("CMT",
                TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
                "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
                "628176504657", new ESMClass(), (byte)0, (byte)1
                timeFormatter.format(new Date()), null,
                new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0,
                dataCoding,
                (byte)0, data);
    }
}
View Full Code Here

Examples of org.jsmpp.util.TimeFormatter.format()

        // 6. Submit the short message
        String messageId = session.submitShortMessage("CMT",
                TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
                "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
                "628176504657", new ESMClass(), (byte)0, (byte)1
                timeFormatter.format(new Date()), null,
                new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0,
                dataCoding,
                (byte)0, data);
    }
}
View Full Code Here

Examples of org.jvnet.localizer.ResourceBundleHolder.format()

        String key = i.displayName();
        if (key.length()==0return c.getSimpleName()+"."+e.getName();
        try {
            ResourceBundleHolder rb = ResourceBundleHolder.get(
                    c.getClassLoader().loadClass(c.getPackage().getName() + ".Messages"));
            return rb.format(key);
        } catch (ClassNotFoundException x) {
            LOGGER.log(WARNING, "Failed to load "+x.getMessage()+" for "+e.toString(),x);
            return key;
        } catch (MissingResourceException x) {
            LOGGER.log(WARNING, "Could not find key '" + key + "' in " + c.getPackage().getName() + ".Messages", x);
View Full Code Here

Examples of org.jwall.tools.TimeFormat.format()

                s.append( "</i>, value: " );
                s.append( ct.getValue() );
            }
           
            s.append( "</i>, expires: <i>" );
            s.append( fmt.format( ct.getLifeTime().longValue() ) );
            s.append( "</i></html>" );
            setText( s.toString() );
            setIcon( WebPolicyEditor.getIcon( "org.jwall.web.policy.CreateToken" ) );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.