public abstract class AbstractDatatypeDetector extends AbstractLoggableComponent implements DatatypeDetector
DatatypeDetector.| Modifier and Type | Field and Description |
|---|---|
private Set<String> |
customDatatypeSet |
private Set<String> |
standardDatatypeSet |
CDI_NAME| Constructor and Description |
|---|
AbstractDatatypeDetector()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isDatatype(Class<?> type)
|
boolean |
isJavaStandardDatatype(Class<?> type)
|
protected void |
registerCustomDatatype(Class<?> datatype)
This method registers a custom
Datatype so it is recognized by
isDatatype(Class). |
protected void |
registerCustomDatatype(String fullQualifiedDatatypeName)
Like
registerCustomDatatype(Class) but via fully qualified name. |
protected void |
registerDefaultDatatypes()
Registers the default datatypes.
|
protected void |
registerJavaTimeDatatypes()
Called from
registerDefaultDatatypes() to add JSR310 datatypes. |
protected void |
registerJavaUtilDateCalendarDatatypes()
|
protected void |
registerNumberDatatypes()
Called from
registerDefaultDatatypes() to add Number based datatypes. |
protected void |
registerStandardDatatype(Class<?> datatype)
This method registers a Java standard
Datatype so it is recognized by
isJavaStandardDatatype(Class). |
protected void |
registerStandardDatatype(String fullQualifiedDatatypeName)
Like
registerStandardDatatype(Class) but via fully qualified name. |
void |
setExtraDatatypes(List<String> datatypeList)
Adds a list of additional datatypes to register.
|
createLogger, doInitialize, getLoggerdoInitialized, getInitializationState, initializeprivate final Set<String> customDatatypeSet
isDatatype(Class)private final Set<String> standardDatatypeSet
isDatatype(Class)protected void registerCustomDatatype(Class<?> datatype)
Datatype so it is recognized by
isDatatype(Class). Enum datatypes as they are detected as such automatically.datatype - is the Datatype to register.protected void registerCustomDatatype(String fullQualifiedDatatypeName)
registerCustomDatatype(Class) but via fully qualified name. Can be
used to prevent compile-time dependencies on datatype.fullQualifiedDatatypeName - is the fully qualified name of the
Datatype to register.registerCustomDatatype(Class)protected void registerStandardDatatype(Class<?> datatype)
Datatype so it is recognized by
isJavaStandardDatatype(Class).datatype - is the Datatype to register.protected void registerStandardDatatype(String fullQualifiedDatatypeName)
registerStandardDatatype(Class) but via fully qualified name. Can
be used to prevent compile-time dependencies on datatype.fullQualifiedDatatypeName - is the fully qualified name of the
Datatype to register.registerStandardDatatype(Class)protected void registerDefaultDatatypes()
protected void registerNumberDatatypes()
registerDefaultDatatypes() to add Number based datatypes. Can also be called
standalone or overridden for customization.protected void registerJavaUtilDateCalendarDatatypes()
registerDefaultDatatypes() to add legacy Date and Calendar
datatypes. Can also be called standalone or overridden for customization.protected void registerJavaTimeDatatypes()
registerDefaultDatatypes() to add JSR310 datatypes. Can also be called standalone or
overridden for customization.public boolean isDatatype(Class<?> type)
Class reflects an (immutable)
Datatype. It will return true if the given
value is a String, Boolean, Character, anything derived from
Number, an Enum, an instance of Datatype, a
Date (even though not immutable) or anything similar.isDatatype in interface DatatypeDetectortype - is the Class to check.true if the given Class represents a
Datatype, false otherwise.public boolean isJavaStandardDatatype(Class<?> type)
Class reflects a Java standard
Datatype provided by the JDK. This is any primitive type or any of Integer, Long, Double, Float, Byte,
Short, Boolean, String, Character, BigInteger,
BigDecimal, Date, Calendar,
LocalDate, LocalTime, LocalDateTime,
Instant, OffsetDateTime, OffsetTime,
Duration, ZonedDateTime, YearMonth,
MonthDay, Year, Period,
ZoneOffset.isJavaStandardDatatype in interface DatatypeDetectortype - is the Class to check.true if the given Class represents a Java standard
Datatype, false otherwise.Copyright © 2001–2015 mmm-Team. All rights reserved.