public static DataPersister lookupForField ( Field field ) { // see if the any of the registered persisters are valid first if ( registeredPersisters != null ) { for ( DataPersister persister : registeredPersisters ) { if ( persister . isValidForField ( field ) ) { return persister ; } // check the classes instead for ( Class < ? > clazz : persister . getAssociatedClasses ( ) ) { if ( field . getType ( ) == clazz ) { return persister ; } } } } // look it up in our built-in map by class DataPersister dataPersister = builtInMap . get ( field . getType ( ) . getName ( ) ) ; if ( dataPersister != null ) { return dataPersister ; } /* * Special case for enum types. We can't put this in the registered persisters because we want people to be able * to override it. */ if ( field . getType ( ) . isEnum ( ) ) { return DEFAULT_ENUM_PERSISTER ; } else { /* * Serializable classes return null here because we don't want them to be automatically configured for * forwards compatibility with future field types that happen to be Serializable. */ return null ; } }
Lookup the data - type associated with the class .