Package org.spf4j.avro.schema
Class SchemasWithClasses
- java.lang.Object
-
- org.spf4j.avro.schema.SchemasWithClasses
-
- All Implemented Interfaces:
SchemaVisitor<Map<String,org.apache.avro.Schema>>
public final class SchemasWithClasses extends Object implements SchemaVisitor<Map<String,org.apache.avro.Schema>>
A visitor that recursively visits a schema and returns a map like: java class name -> Schema for every Schema encountered that has a java class implementation.- Author:
- zoly
-
-
Constructor Summary
Constructors Constructor Description SchemasWithClasses()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaVisitorActionafterVisitNonTerminal(org.apache.avro.Schema terminal)Invoked for schemas with children after its children have been visited.Map<String,org.apache.avro.Schema>get()Invoked when visiting is complete.StringtoString()SchemaVisitorActionvisitNonTerminal(org.apache.avro.Schema schema)Invoked for schema with children before proceeding to visit the children.SchemaVisitorActionvisitTerminal(org.apache.avro.Schema schema)Invoked for schemas that do not have "child" schemas or for a previously encountered schema with children which will be treated as a terminal.
-
-
-
Method Detail
-
visitTerminal
public SchemaVisitorAction visitTerminal(org.apache.avro.Schema schema)
Description copied from interface:SchemaVisitorInvoked for schemas that do not have "child" schemas or for a previously encountered schema with children which will be treated as a terminal. (to avoid circular recursion)- Specified by:
visitTerminalin interfaceSchemaVisitor<Map<String,org.apache.avro.Schema>>- Returns:
-
visitNonTerminal
public SchemaVisitorAction visitNonTerminal(org.apache.avro.Schema schema)
Description copied from interface:SchemaVisitorInvoked for schema with children before proceeding to visit the children.- Specified by:
visitNonTerminalin interfaceSchemaVisitor<Map<String,org.apache.avro.Schema>>- Returns:
-
afterVisitNonTerminal
public SchemaVisitorAction afterVisitNonTerminal(org.apache.avro.Schema terminal)
Description copied from interface:SchemaVisitorInvoked for schemas with children after its children have been visited.- Specified by:
afterVisitNonTerminalin interfaceSchemaVisitor<Map<String,org.apache.avro.Schema>>- Returns:
-
get
public Map<String,org.apache.avro.Schema> get()
Description copied from interface:SchemaVisitorInvoked when visiting is complete.- Specified by:
getin interfaceSchemaVisitor<Map<String,org.apache.avro.Schema>>- Returns:
- a value which will be returned by the visit method.
-
-