Examples of format()


Examples of org.apache.sis.measure.RangeFormat.format()

    public String toString(final Locale locale) {
        if (locale == null || locale == Locale.ROOT) {
            return toString();
        }
        final RangeFormat format = new RangeFormat(locale, getElementType());
        return format.format(this);
    }

    /**
     * Builds, caches and returns the unlocalized string representation of this range.
     */
 
View Full Code Here

Examples of org.apache.sis.util.collection.TreeTableFormat.format()

     */
    @Debug
    static String format(final TreeTable table) {
        final TreeTableFormat format = new TreeTableFormat(null, null);
        format.setColumnSeparatorPattern("?[ ] ← ");
        return format.format(table);
    }
}
View Full Code Here

Examples of org.apache.struts2.json.annotations.JSON.format()

        } else if (clazz.equals(Date.class)) {
            try {
                JSON json = method.getAnnotation(JSON.class);

                DateFormat formatter = new SimpleDateFormat(
                        (json != null) && (json.format().length() > 0) ? json.format() : this.dateFormat);
                return formatter.parse((String) value);
            } catch (ParseException e) {
                LOG.error(e.getMessage(), e);
                throw new JSONException("Unable to parse date from: " + value);
            }
View Full Code Here

Examples of org.apache.tapestry.form.TranslatedFieldSupport.format()

        expect(form.getElementId(comp)).andReturn("suggest");
        expect(form.isRewinding()).andReturn(false).anyTimes();

        form.setFormFieldUpdating(true);
       
        expect(translator.format(comp, null)).andReturn("r2d2");
        translator.renderContributions(comp, writer, cycle);
        validator.renderContributions(comp, writer, cycle);

        expect(cycle.getEngine()).andReturn(cengine);
        expect(cengine.getOutputEncoding()).andReturn("utf-8");
View Full Code Here

Examples of org.apache.tapestry.form.translator.DateTranslator.format()

        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "min:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _minDate))
                        + ","
                        + "format:"
                        + JSONObject.quote(Strftime.convertToPosixFormat(translator.getPattern()))
                        + "}]"));
       
View Full Code Here

Examples of org.apache.tapestry.form.translator.NumberTranslator.format()

    {
        String ret = null;
        NumberTranslator translator = (NumberTranslator)super.getFieldTranslator(field, NumberTranslator.class);

        if (translator != null)
            ret = translator.format(field, locale, new Double(_max));
        else
            ret = String.valueOf(_max);

        return ret;
    }
View Full Code Here

Examples of org.apache.tapestry.form.translator.Translator.format()

        delegateControl.setReturnValue(false);
       
        field.getTranslator();
        fieldControl.setReturnValue(translator);
       
        translator.format(field, object);
        translatorControl.setReturnValue(expected);
       
        replayControls();
       
        String result = support.format(field, object);
View Full Code Here

Examples of org.apache.tapestry.ioc.MessageFormatter.format()

    {
        Messages messages = _source.getValidationMessages(Locale.ENGLISH);

        MessageFormatter formatter = messages.getFormatter("required");

        assertEquals(formatter.format("My Field"), "You must provide a value for My Field.");
    }

    @Test
    public void messages_instances_are_cached()
    {
View Full Code Here

Examples of org.apache.tapestry.ioc.Messages.format()

    public void builtin_message()
    {
        Messages messages = _source.getValidationMessages(Locale.ENGLISH);

        assertEquals(
                messages.format("required", "My Field"),
                "You must provide a value for My Field.");
    }

    @Test
    public void contributed_message()
View Full Code Here

Examples of org.apache.tapestry5.ioc.MessageFormatter.format()

    @Test
    public void get_formatter()
    {
        MessageFormatter mf = messages.getFormatter("result");

        assertEquals(mf.format("great"), "The result is 'great'.");
    }

    @Test
    public void formatters_are_cached()
    {
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.