All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.avro.avsc.SchemaVisitor Maven / Gradle / Ivy

Go to download

Avro adaptation (abstraction layer betwen zolyfarkas/avro and apache/avro) utils.

There is a newer version: 8.10.0
Show newest version
/*
* Copyright (c) 2001 - 2016, Zoltan Farkas All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package org.apache.avro.avsc;

import org.apache.avro.Schema;

public interface SchemaVisitor {

  /**
   * Invoked for schemas that do not have "child" schemas (like string, int ...)
   * or for a previously encountered schema with children,
   * which will be treated as a terminal. (to avoid circular recursion)
   *
   * @param terminal
   * @return
   */
  SchemaVisitorAction visitTerminal(Schema terminal);

  /**
   * Invoked for schema with children before proceeding to visit the children.
   *
   * @param nonTerminal
   * @return
   */
  SchemaVisitorAction visitNonTerminal(Schema nonTerminal);

  /**
   * Invoked for schemas with children after its children have been visited.
   *
   * @param nonTerminal
   * @return
   */
  SchemaVisitorAction afterVisitNonTerminal(Schema nonTerminal);


  /**
   * Invoked when visiting is complete.
   *
   * @return a value which will be returned by the visit method.
   */
  T get();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy