Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cocoon.forms.datatype.convertor
Interface Convertor

All Known Implementing Classes:
  BeanConvertor, CharConvertor, DummyStringConvertor, EnumConvertor, FormattingDateConvertor, FormattingDecimalConvertor, HtmlCleaningConvertor, Icu4jDateConvertor, MillisDateConvertor, PlainBooleanConvertor, PlainDecimalConvertor, PlainDoubleConvertor, PlainFloatConvertor, PlainIntegerConvertor, PlainLongConvertor

public interface Convertor

The purpose of a Convertor is to convert between Object and String representations of the same thing. For example, convert `Long`s or `Date`s to strings, and vice versa. The behaviour of this conversion process can depend on the user's Locale.

If you need to do mass conversion of a lot of values, it may be beneficial to pass a `Convertor.FormatCache` object to the convert methods. Some convertors need to build and configure parser or formatting objects, which can be expensive if it needs to be done repeatedly.

Version:
  $Id: Convertor.java 587759 2007-10-24 03:00:37Z vgritsenko $

Nested Class Summary
`static interface` | `Convertor.FormatCache`

Method Summary
`ConversionResult` | `convertFromString(String value, Locale locale, Convertor.FormatCache formatCache)` Converts string representation into the object of convertor's type.
`String` | `convertToString(Object value, Locale locale, Convertor.FormatCache formatCache)`
`void` | `generateSaxFragment(ContentHandler contentHandler, Locale locale)` Generates a bit of information about this convertor (optional).
`Class` | `getTypeClass()`

Method Detail

### convertFromString

    public ConversionResult convertFromString(String value,
                                              Locale locale,
                                              Convertor.FormatCache formatCache)

  Converts string representation into the object of convertor's type.

  Parameters:
    `formatCache` - can be null if not needed

### convertToString

    public String convertToString(Object value,
                                  Locale locale,
                                  Convertor.FormatCache formatCache)

### getTypeClass

    public Class getTypeClass()

### generateSaxFragment

    public void generateSaxFragment(ContentHandler contentHandler,
                                    Locale locale)
                             throws SAXException

  Generates a bit of information about this convertor (optional).

  Throws:
    `SAXException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.