diff --git a/lang/java/avro/src/main/java/org/apache/avro/specific/AvroInternal.java b/lang/java/avro/src/main/java/org/apache/avro/specific/AvroInternal.java new file mode 100644 index 00000000000..65119660b47 --- /dev/null +++ b/lang/java/avro/src/main/java/org/apache/avro/specific/AvroInternal.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.avro.specific; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicates that an annotated accessor is an Avro internal + * and should be ignored when introspecting @AvroGenerated classes. + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface AvroInternal { +} diff --git a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm index ec1e6c3ca7a..2e0ec7ce6ae 100755 --- a/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm +++ b/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm @@ -177,9 +177,11 @@ public class ${this.mangleTypeIdentifier($schema.getName())} extends ${this.getS #end @Override + @org.apache.avro.specific.AvroInternal public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; } @Override + @org.apache.avro.specific.AvroInternal public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call.