Skip to content

Commit

Permalink
AVRO-2118: Reverting changes by Thiruvalluvan M G <thiru@startsmartla…
Browse files Browse the repository at this point in the history
…bs.com> from commit 9132015
  • Loading branch information
nielsbasjes committed Dec 21, 2017
1 parent 5040c64 commit c7a3c96
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
/*
* 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.
*/
/*
* 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.compiler.schema;

import org.apache.avro.Schema;

/**
* @author zoly
*/
public interface SchemaVisitor<T> {

/**
* 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
*/
Expand All @@ -50,7 +50,6 @@ public interface SchemaVisitor<T> {

/**
* Invoked when visiting is complete.
*
* @return a value which will be returned by the visit method.
*/
T get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
/*
* 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.
*/
/*
* 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.compiler.schema;

/**
* @author zoly
*/
public enum SchemaVisitorAction {

/**
* continue visit.
*/
CONTINUE,
/**
* terminate visit.
*/
TERMINATE,
/**
* when returned from pre non terminal visit method the children of the non terminal are skipped.
* afterVisitNonTerminal for the current schema will not be invoked.
*/
SKIP_SUBTREE,
/**
* Skip visiting the siblings of this schema.
*/
SKIP_SIBLINGS;
/**
* continue visit.
*/
CONTINUE,
/**
* terminate visit.
*/
TERMINATE,
/**
* when returned from pre non terminal visit method the children of the non terminal are skipped.
* afterVisitNonTerminal for the current schema will not be invoked.
*/
SKIP_SUBTREE,
/**
* Skip visiting the siblings of this schema.
*/
SKIP_SIBLINGS;

}

0 comments on commit c7a3c96

Please sign in to comment.