public static void registerAccessor ( Class < ? > documentType , DocumentAccessor accessor ) { Assert . notNull ( documentType , "documentType may not be null" ) ; Assert . notNull ( accessor , "accessor may not be null" ) ; if ( accessors . containsKey ( documentType ) ) { DocumentAccessor existing = getAccessor ( documentType ) ; LOG . warn ( String . format ( "DocumentAccessor for class %s already exists: %s will be overridden by %s" , documentType , existing . getClass ( ) , accessor . getClass ( ) ) ) ; } putAccessor ( documentType , accessor ) ; LOG . debug ( "Registered document accessor: {} for class: {}" , accessor . getClass ( ) , documentType ) ; }
Used to register a custom DocumentAccessor for a particular class . Any existing accessor for the class will be overridden .