11/*
2- * Copyright 2019 the original author or authors.
2+ * Copyright 2019-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3535import org .springframework .core .io .Resource ;
3636import org .springframework .lang .Nullable ;
3737import org .springframework .util .Assert ;
38+ import org .springframework .util .ClassUtils ;
3839
3940/**
4041 * An {@link ItemReader} that deserializes data from a {@link Resource} containing
4142 * serialized Avro objects.
4243 *
4344 * @author David Turanski
4445 * @author Mahmoud Ben Hassine
46+ * @author Song JaeGeun
4547 * @since 4.2
4648 */
4749public class AvroItemReader <T > extends AbstractItemCountingItemStreamItemReader <T > {
@@ -61,6 +63,8 @@ public class AvroItemReader<T> extends AbstractItemCountingItemStreamItemReader<
6163 * @param clazz the data type to be deserialized.
6264 */
6365 public AvroItemReader (Resource resource , Class <T > clazz ) {
66+ setName (ClassUtils .getShortName (AvroItemReader .class ));
67+
6468 Assert .notNull (resource , "'resource' is required." );
6569 Assert .notNull (clazz , "'class' is required." );
6670
@@ -78,6 +82,8 @@ public AvroItemReader(Resource resource, Class<T> clazz) {
7882 * @param schema the {@link Resource} containing the Avro schema.
7983 */
8084 public AvroItemReader (Resource data , Resource schema ) {
85+ setName (ClassUtils .getShortName (AvroItemReader .class ));
86+
8187 Assert .notNull (data , "'data' is required." );
8288 Assert .state (data .exists (), "'data' " + data .getFilename () + " does not exist." );
8389 Assert .notNull (schema , "'schema' is required" );
0 commit comments