Package org.spf4j.avro.schema
Class CloningVisitor
- java.lang.Object
-
- org.spf4j.avro.schema.CloningVisitor
-
- All Implemented Interfaces:
SchemaVisitor<org.apache.avro.Schema>
public final class CloningVisitor extends Object implements SchemaVisitor<org.apache.avro.Schema>
this visitor will create a clone of the original Schema with docs and other nonesential fields stripped by default. what attributes are copied is customizable.- Author:
- zoly
-
-
Constructor Summary
Constructors Constructor Description CloningVisitor(BiConsumer<org.apache.avro.Schema.Field,org.apache.avro.Schema.Field> copyField, BiConsumer<org.apache.avro.Schema,org.apache.avro.Schema> copySchema, boolean copyDocs, boolean copyDefaults, org.apache.avro.Schema root)CloningVisitor(BiConsumer<org.apache.avro.Schema.Field,org.apache.avro.Schema.Field> copyField, BiConsumer<org.apache.avro.Schema,org.apache.avro.Schema> copySchema, boolean copyDocs, org.apache.avro.Schema root)CloningVisitor(org.apache.avro.Schema root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaVisitorActionafterVisitNonTerminal(org.apache.avro.Schema nt)Invoked for schemas with children after its children have been visited.org.apache.avro.Schemaget()Invoked when visiting is complete.StringtoString()SchemaVisitorActionvisitNonTerminal(org.apache.avro.Schema nt)Invoked for schema with children before proceeding to visit the children.SchemaVisitorActionvisitTerminal(org.apache.avro.Schema terminal)Invoked for schemas that do not have "child" schemas or for a previously encountered schema with children which will be treated as a terminal.
-
-
-
Constructor Detail
-
CloningVisitor
public CloningVisitor(org.apache.avro.Schema root)
-
CloningVisitor
public CloningVisitor(BiConsumer<org.apache.avro.Schema.Field,org.apache.avro.Schema.Field> copyField, BiConsumer<org.apache.avro.Schema,org.apache.avro.Schema> copySchema, boolean copyDocs, org.apache.avro.Schema root)
-
CloningVisitor
public CloningVisitor(BiConsumer<org.apache.avro.Schema.Field,org.apache.avro.Schema.Field> copyField, BiConsumer<org.apache.avro.Schema,org.apache.avro.Schema> copySchema, boolean copyDocs, boolean copyDefaults, org.apache.avro.Schema root)
-
-
Method Detail
-
visitTerminal
public SchemaVisitorAction visitTerminal(org.apache.avro.Schema terminal)
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<org.apache.avro.Schema>- Returns:
-
visitNonTerminal
public SchemaVisitorAction visitNonTerminal(org.apache.avro.Schema nt)
Description copied from interface:SchemaVisitorInvoked for schema with children before proceeding to visit the children.- Specified by:
visitNonTerminalin interfaceSchemaVisitor<org.apache.avro.Schema>- Returns:
-
afterVisitNonTerminal
public SchemaVisitorAction afterVisitNonTerminal(org.apache.avro.Schema nt)
Description copied from interface:SchemaVisitorInvoked for schemas with children after its children have been visited.- Specified by:
afterVisitNonTerminalin interfaceSchemaVisitor<org.apache.avro.Schema>- Returns:
-
get
public org.apache.avro.Schema get()
Description copied from interface:SchemaVisitorInvoked when visiting is complete.- Specified by:
getin interfaceSchemaVisitor<org.apache.avro.Schema>- Returns:
- a value which will be returned by the visit method.
-
-