This class provides a way to handle the errors which may exist in some XML documents. For example a URL in the document may be malformed, causing a {@link MalformedURLException}to be thrown. If this error is not handled, it will cause the (un)marshalling of the entire document to fail. An application may want to change this behavior by replacing URLs that are known to be erroneous by fixed versions of those URLs. Example:
{@preformat java}class URLFixer extends ValueConverter @Override public URL toURL(MarshalContext context, URI uri) throws MalformedURLException { try { return super.toURL(context, uri); } catch (MalformedURLException e) { if (uri.equals(KNOWN_ERRONEOUS_URI) { return FIXED_URL; } else { throw e; } } } } } See the {@link XML#CONVERTER} javadoc for an example of registering a custom{@code ValueConverter} to a (un)marshaller. @author Martin Desruisseaux (Geomatys) @since 0.3 (derived from geotk-3.07) @version 0.3 @moduleTypically, a ValueConverter will select a particular {@link org.apache.tapestry.coerce.TypeConverter}to perform the conversion. The {@link org.apache.tapestry.coerce.ValueConverterImpl}implementation also makes use of built-in {@link java.beans.PropertyEditor}s. @author Howard M. Lewis Ship @since 4.0
Values
. This is generally used to convert different values according to their names.
@see org.araneaframework.backend.list.memorybased.expression.Value
@see org.araneaframework.uilib.list.util.Converter
|
|
|
|
|
|
|
|