public class DefinitionToAvroVisitor extends Object implements DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>
| Constructor and Description |
|---|
DefinitionToAvroVisitor(FhirConversionSupport fhirSupport,
String basePackage,
Map<String,HapiConverter<org.apache.avro.Schema>> visitedConverters)
Creates a visitor to construct Avro conversion objects.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxDepth(String elementTypeUrl,
String path)
Returns the maximum depth to use for recursive structures of the given type.
|
HapiConverter<org.apache.avro.Schema> |
visitChoice(String elementName,
Map<String,HapiConverter<org.apache.avro.Schema>> choiceTypes)
Visits a choice type.
|
HapiConverter<org.apache.avro.Schema> |
visitComposite(String elementName,
String elementPath,
String baseType,
String elementTypeUrl,
List<StructureField<HapiConverter<org.apache.avro.Schema>>> children)
Visits a composite type.
|
HapiConverter<org.apache.avro.Schema> |
visitContained(String elementPath,
String elementTypeUrl,
Map<String,StructureField<HapiConverter<org.apache.avro.Schema>>> contained)
Visits a container type.
|
HapiConverter<org.apache.avro.Schema> |
visitLeafExtension(String elementName,
String extensionUrl,
HapiConverter<org.apache.avro.Schema> element)
Visits a leaf extension, which contains some value.
|
HapiConverter<org.apache.avro.Schema> |
visitMultiValued(String elementName,
HapiConverter<org.apache.avro.Schema> arrayElement)
Visits a multi-valued element.
|
HapiConverter<org.apache.avro.Schema> |
visitParentExtension(String elementName,
String extensionUrl,
List<StructureField<HapiConverter<org.apache.avro.Schema>>> children)
Visits a non-leaf extension.
|
HapiConverter<org.apache.avro.Schema> |
visitPrimitive(String elementName,
String primitiveType)
Visits a primitive type.
|
HapiConverter<org.apache.avro.Schema> |
visitReference(String elementName,
List<String> referenceTypes,
List<StructureField<HapiConverter<org.apache.avro.Schema>>> children)
Visits a reference type.
|
public DefinitionToAvroVisitor(FhirConversionSupport fhirSupport, String basePackage, Map<String,HapiConverter<org.apache.avro.Schema>> visitedConverters)
fhirSupport - support for FHIR conversions.basePackage - the base package to be used for generated Avro structures.visitedConverters - a mutable cache of generated converters that may
be reused by types that contain them.public HapiConverter<org.apache.avro.Schema> visitPrimitive(String elementName, String primitiveType)
DefinitionVisitorvisitPrimitive in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.primitiveType - the FHIR type of the primitive.public HapiConverter<org.apache.avro.Schema> visitContained(String elementPath, String elementTypeUrl, Map<String,StructureField<HapiConverter<org.apache.avro.Schema>>> contained)
DefinitionVisitorvisitContained in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementPath - the FHIR path to the element.elementTypeUrl - the type of the container type.contained - the map of types to their contained elements.public HapiConverter<org.apache.avro.Schema> visitComposite(String elementName, String elementPath, String baseType, String elementTypeUrl, List<StructureField<HapiConverter<org.apache.avro.Schema>>> children)
DefinitionVisitorvisitComposite in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.elementPath - the FHIR path to the element.baseType - the type of the composite type.elementTypeUrl - the URL of the resource containing the element.children - the composite type's children.public HapiConverter<org.apache.avro.Schema> visitReference(String elementName, List<String> referenceTypes, List<StructureField<HapiConverter<org.apache.avro.Schema>>> children)
DefinitionVisitorvisitReference in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.referenceTypes - the types of resource that can be referencedchildren - the child fields of the referencepublic HapiConverter<org.apache.avro.Schema> visitParentExtension(String elementName, String extensionUrl, List<StructureField<HapiConverter<org.apache.avro.Schema>>> children)
DefinitionVisitorvisitParentExtension in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.extensionUrl - the URL of the extension.children - the children of the extensionpublic HapiConverter<org.apache.avro.Schema> visitLeafExtension(String elementName, String extensionUrl, HapiConverter<org.apache.avro.Schema> element)
DefinitionVisitorvisitLeafExtension in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.extensionUrl - the URL of the extension.element - the children of the extension.public HapiConverter<org.apache.avro.Schema> visitMultiValued(String elementName, HapiConverter<org.apache.avro.Schema> arrayElement)
DefinitionVisitorvisitMultiValued in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.arrayElement - the visitor result for a single element of the array.public HapiConverter<org.apache.avro.Schema> visitChoice(String elementName, Map<String,HapiConverter<org.apache.avro.Schema>> choiceTypes)
DefinitionVisitorvisitChoice in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementName - the element to visit.choiceTypes - a map of the choice type with the returned children.public int getMaxDepth(String elementTypeUrl, String path)
DefinitionVisitorgetMaxDepth in interface DefinitionVisitor<HapiConverter<org.apache.avro.Schema>>elementTypeUrl - the element type that is recursivepath - the path to the element that is recursiveCopyright © 2020. All rights reserved.