BeanIO 2.0.4

org.beanio.types
Class URLTypeHandler

java.lang.Object
  extended by org.beanio.types.URLTypeHandler
All Implemented Interfaces:
TypeHandler

public class URLTypeHandler
extends Object
implements TypeHandler

A type handler for URL values.

Since:
2.0
Author:
Kevin Seim

Field Summary
 
Fields inherited from interface org.beanio.types.TypeHandler
NIL
 
Constructor Summary
URLTypeHandler()
           
 
Method Summary
 String format(Object value)
          Formats a URL by calling toString().
 Class<?> getType()
          Returns URL.
 Object parse(String text)
          Parses a URL using its constructor URL.URL(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLTypeHandler

public URLTypeHandler()
Method Detail

parse

public Object parse(String text)
             throws TypeConversionException
Parses a URL using its constructor URL.URL(String).

Specified by:
parse in interface TypeHandler
Parameters:
text - the text to parse
Returns:
the parsed URL or null if text is null or an empty string
Throws:
TypeConversionException - if the text cannot be parsed

format

public String format(Object value)
Formats a URL by calling toString(). If value is null, null is returned.

Specified by:
format in interface TypeHandler
Parameters:
value - the URL to format
Returns:
the formatted text

getType

public Class<?> getType()
Returns URL.

Specified by:
getType in interface TypeHandler
Returns:
the class type supported by this handler

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim