Class BasicTypeFormatter<T>
- java.lang.Object
-
- us.codecraft.webmagic.model.formatter.BasicTypeFormatter<T>
-
- All Implemented Interfaces:
ObjectFormatter<T>
- Direct Known Subclasses:
BasicTypeFormatter.BooleanFormatter
,BasicTypeFormatter.ByteFormatter
,BasicTypeFormatter.CharactorFormatter
,BasicTypeFormatter.DoubleFormatter
,BasicTypeFormatter.FloatFormatter
,BasicTypeFormatter.IntegerFormatter
,BasicTypeFormatter.LongFormatter
,BasicTypeFormatter.ShortFormatter
public abstract class BasicTypeFormatter<T> extends java.lang.Object implements ObjectFormatter<T>
- Since:
- 0.3.2
- Author:
- code4crafter@gmail.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicTypeFormatter.BooleanFormatter
static class
BasicTypeFormatter.ByteFormatter
static class
BasicTypeFormatter.CharactorFormatter
static class
BasicTypeFormatter.DoubleFormatter
static class
BasicTypeFormatter.FloatFormatter
static class
BasicTypeFormatter.IntegerFormatter
static class
BasicTypeFormatter.LongFormatter
static class
BasicTypeFormatter.ShortFormatter
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<BasicClassDetector>
basicClassDetector
static java.util.List<java.lang.Class<? extends ObjectFormatter>>
basicTypeFormatters
-
Constructor Summary
Constructors Constructor Description BasicTypeFormatter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>
detectBasicClass(java.lang.Class<?> type)
T
format(java.lang.String raw)
protected abstract T
formatTrimmed(java.lang.String raw)
void
initParam(java.lang.String[] extra)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface us.codecraft.webmagic.model.formatter.ObjectFormatter
clazz
-
-
-
-
Field Detail
-
basicTypeFormatters
public static final java.util.List<java.lang.Class<? extends ObjectFormatter>> basicTypeFormatters
-
basicClassDetector
public static final java.util.List<BasicClassDetector> basicClassDetector
-
-
Method Detail
-
initParam
public void initParam(java.lang.String[] extra)
- Specified by:
initParam
in interfaceObjectFormatter<T>
-
format
public T format(java.lang.String raw) throws java.lang.Exception
- Specified by:
format
in interfaceObjectFormatter<T>
- Throws:
java.lang.Exception
-
formatTrimmed
protected abstract T formatTrimmed(java.lang.String raw) throws java.lang.Exception
- Throws:
java.lang.Exception
-
detectBasicClass
public static java.lang.Class<?> detectBasicClass(java.lang.Class<?> type)
-
-