public class DefinitionToSparkVisitor extends Object implements DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>
| Constructor and Description |
|---|
DefinitionToSparkVisitor(FhirConversionSupport fhirSupport,
String basePackage,
Map<String,HapiConverter<org.apache.spark.sql.types.DataType>> visitedConverters)
Creates a visitor to construct Spark Row 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.spark.sql.types.DataType> |
visitChoice(String elementName,
Map<String,HapiConverter<org.apache.spark.sql.types.DataType>> choiceTypes)
Visits a choice type.
|
HapiConverter<org.apache.spark.sql.types.DataType> |
visitComposite(String elementName,
String elementPath,
String baseType,
String elementTypeUrl,
List<StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> children)
Visits a composite type.
|
HapiConverter |
visitContained(String elementPath,
String elementTypeUrl,
Map<String,StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> contained)
Visits a container type.
|
HapiConverter<org.apache.spark.sql.types.DataType> |
visitLeafExtension(String elementName,
String extensionUri,
HapiConverter elementConverter)
Visits a leaf extension, which contains some value.
|
HapiConverter<org.apache.spark.sql.types.DataType> |
visitMultiValued(String elementName,
HapiConverter arrayElement)
Visits a multi-valued element.
|
HapiConverter |
visitParentExtension(String elementName,
String extensionUrl,
List<StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> children)
Visits a non-leaf extension.
|
HapiConverter |
visitPrimitive(String elementName,
String primitiveType)
Visits a primitive type.
|
HapiConverter |
visitReference(String elementName,
List<String> referenceTypes,
List<StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> children)
Visits a reference type.
|
public DefinitionToSparkVisitor(FhirConversionSupport fhirSupport, String basePackage, Map<String,HapiConverter<org.apache.spark.sql.types.DataType>> visitedConverters)
fhirSupport - support for FHIR conversions.basePackage - the base package to be used as a prefix for unique keys to cache generated
converters.visitedConverters - a mutable cache of generated converters that may
be reused by types that contain them.public HapiConverter visitPrimitive(String elementName, String primitiveType)
DefinitionVisitorvisitPrimitive in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>elementName - the element to visit.primitiveType - the FHIR type of the primitive.public HapiConverter<org.apache.spark.sql.types.DataType> visitComposite(String elementName, String elementPath, String baseType, String elementTypeUrl, List<StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> children)
DefinitionVisitorvisitComposite in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>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 visitContained(String elementPath, String elementTypeUrl, Map<String,StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> contained)
DefinitionVisitorvisitContained in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>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 visitReference(String elementName, List<String> referenceTypes, List<StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> children)
DefinitionVisitorvisitReference in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>elementName - the element to visit.referenceTypes - the types of resource that can be referencedchildren - the child fields of the referencepublic HapiConverter visitParentExtension(String elementName, String extensionUrl, List<StructureField<HapiConverter<org.apache.spark.sql.types.DataType>>> children)
DefinitionVisitorvisitParentExtension in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>elementName - the element to visit.extensionUrl - the URL of the extension.children - the children of the extensionpublic HapiConverter<org.apache.spark.sql.types.DataType> visitLeafExtension(String elementName, String extensionUri, HapiConverter elementConverter)
DefinitionVisitorvisitLeafExtension in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>elementName - the element to visit.extensionUri - the URL of the extension.elementConverter - the children of the extension.public HapiConverter<org.apache.spark.sql.types.DataType> visitMultiValued(String elementName, HapiConverter arrayElement)
DefinitionVisitorvisitMultiValued in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>elementName - the element to visit.arrayElement - the visitor result for a single element of the array.public HapiConverter<org.apache.spark.sql.types.DataType> visitChoice(String elementName, Map<String,HapiConverter<org.apache.spark.sql.types.DataType>> choiceTypes)
DefinitionVisitorvisitChoice in interface DefinitionVisitor<HapiConverter<org.apache.spark.sql.types.DataType>>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.spark.sql.types.DataType>>elementTypeUrl - the element type that is recursivepath - the path to the element that is recursiveCopyright © 2020. All rights reserved.