Package org.beanio.types
Class URLTypeHandler
- java.lang.Object
-
- org.beanio.types.URLTypeHandler
-
- All Implemented Interfaces:
TypeHandler
public class URLTypeHandler extends java.lang.Object implements TypeHandler
A type handler forURL
values.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from interface org.beanio.types.TypeHandler
NIL
-
-
Constructor Summary
Constructors Constructor Description URLTypeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(java.lang.Object value)
Formats aURL
by callingtoString()
.java.lang.Class<?>
getType()
ReturnsURL
.java.lang.Object
parse(java.lang.String text)
Parses aURL
using its constructorURL(String)
.
-
-
-
Method Detail
-
parse
public java.lang.Object parse(java.lang.String text) throws TypeConversionException
Parses aURL
using its constructorURL(String)
.- Specified by:
parse
in interfaceTypeHandler
- Parameters:
text
- the text to parse- Returns:
- the parsed
URL
or null iftext
is null or an empty string - Throws:
TypeConversionException
- if the text cannot be parsed
-
format
public java.lang.String format(java.lang.Object value)
Formats aURL
by callingtoString()
. Ifvalue
is null,null
is returned.- Specified by:
format
in interfaceTypeHandler
- Parameters:
value
- theURL
to format- Returns:
- the formatted text
-
getType
public java.lang.Class<?> getType()
ReturnsURL
.- Specified by:
getType
in interfaceTypeHandler
- Returns:
- the class type supported by this handler
-
-