Package org.apache.avro.compiler.schema
Class CloningVisitor
java.lang.Object
org.apache.avro.compiler.schema.CloningVisitor
- All Implemented Interfaces:
SchemaVisitor<Schema>
this visitor will create a clone of the original Schema with docs and other
nonessential fields stripped by default. what attributes are copied is
customizable.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCloningVisitor
(CloningVisitor.PropertyCopier copyProperties, boolean copyDocs, Schema root) CloningVisitor
(Schema root) copy only serialization necessary fields. -
Method Summary
Modifier and TypeMethodDescriptionInvoked for schemas with children after its children have been visited.get()
Invoked when visiting is complete.toString()
Invoked for schema with children before proceeding to visit the children.visitTerminal
(Schema terminal) Invoked for schemas that do not have "child" schemas (like string, int ...)
-
Constructor Details
-
CloningVisitor
copy only serialization necessary fields.- Parameters:
root
-
-
CloningVisitor
-
-
Method Details
-
visitTerminal
Description copied from 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)- Specified by:
visitTerminal
in interfaceSchemaVisitor<Schema>
- Parameters:
terminal
-
-
visitNonTerminal
Description copied from interface:SchemaVisitor
Invoked for schema with children before proceeding to visit the children.- Specified by:
visitNonTerminal
in interfaceSchemaVisitor<Schema>
- Parameters:
nt
-
-
afterVisitNonTerminal
Description copied from interface:SchemaVisitor
Invoked for schemas with children after its children have been visited.- Specified by:
afterVisitNonTerminal
in interfaceSchemaVisitor<Schema>
- Parameters:
nt
-
-
get
Description copied from interface:SchemaVisitor
Invoked when visiting is complete.- Specified by:
get
in interfaceSchemaVisitor<Schema>
- Returns:
- a value which will be returned by the visit method.
-
toString
-