Class DrillXSDSchemaVisitor
java.lang.Object
org.apache.drill.exec.store.xml.xsd.DrillXSDSchemaVisitor
- All Implemented Interfaces:
- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
public class DrillXSDSchemaVisitor
extends Object
implements org.apache.ws.commons.schema.walker.XmlSchemaVisitor
This class transforms an XSD schema into a Drill Schema.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns aTupleMetadatarepresentation of the schema contained in an XSD file.voidonEndAttributes(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo) Called for each element decl once all its attributes have been previously processed by onVisitAttribute.voidonEnterAllGroup(org.apache.ws.commons.schema.XmlSchemaAll xmlSchemaAll) voidonEnterChoiceGroup(org.apache.ws.commons.schema.XmlSchemaChoice xmlSchemaChoice) voidonEnterElement(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo, boolean b) Handles global elements establishing a map for the child elements and attributes (if any).voidonEnterSequenceGroup(org.apache.ws.commons.schema.XmlSchemaSequence xmlSchemaSequence) voidonEnterSubstitutionGroup(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement) voidonExitAllGroup(org.apache.ws.commons.schema.XmlSchemaAll xmlSchemaAll) voidonExitChoiceGroup(org.apache.ws.commons.schema.XmlSchemaChoice xmlSchemaChoice) voidonExitElement(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo, boolean b) voidonExitSequenceGroup(org.apache.ws.commons.schema.XmlSchemaSequence xmlSchemaSequence) voidonExitSubstitutionGroup(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement) voidonVisitAny(org.apache.ws.commons.schema.XmlSchemaAny xmlSchemaAny) voidonVisitAnyAttribute(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.XmlSchemaAnyAttribute xmlSchemaAnyAttribute) voidonVisitAttribute(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaAttrInfo xmlSchemaAttrInfo) This method just gathers the elements up into a table.
- 
Constructor Details- 
DrillXSDSchemaVisitor
 
- 
- 
Method Details- 
getDrillSchemaReturns aTupleMetadatarepresentation of the schema contained in an XSD file. This method should only be called after the walk method of XmlSchemaWalker has been called.- Returns:
- A TupleMetadatarepresentation of the XSD schema.
 
- 
onEnterElementpublic void onEnterElement(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo, boolean b) Handles global elements establishing a map for the child elements and attributes (if any). TBD: Does not handle case where multiple elements have the same name as in:
 There is also the case where they are ambiguous unless namespaces are used:<element name="a" .../> <element name="b" .../> <element name="a" .../><element name="a" .../> <element ref="pre:a" .../> <!-- without namespace, ambiguous with prior "a" -->- Specified by:
- onEnterElementin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onExitElementpublic void onExitElement(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo, boolean b) - Specified by:
- onExitElementin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onVisitAttributepublic void onVisitAttribute(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaAttrInfo xmlSchemaAttrInfo) This method just gathers the elements up into a table.- Specified by:
- onVisitAttributein interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onEndAttributespublic void onEndAttributes(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo) Called for each element decl once all its attributes have been previously processed by onVisitAttribute. Constructs the map for the special attributes child element of each element. Note: does not construct an attribute child map if there are no attributes. Only supports attributes with no-namespace on their qnames. Or rather, ignores namespaces. Only deals with local names. TBD: needs to check for attributes with namespaced names and at minimum reject them.- Specified by:
- onEndAttributesin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onEnterSubstitutionGrouppublic void onEnterSubstitutionGroup(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement) - Specified by:
- onEnterSubstitutionGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onExitSubstitutionGrouppublic void onExitSubstitutionGroup(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement) - Specified by:
- onExitSubstitutionGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onEnterAllGrouppublic void onEnterAllGroup(org.apache.ws.commons.schema.XmlSchemaAll xmlSchemaAll) - Specified by:
- onEnterAllGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onExitAllGrouppublic void onExitAllGroup(org.apache.ws.commons.schema.XmlSchemaAll xmlSchemaAll) - Specified by:
- onExitAllGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onEnterChoiceGrouppublic void onEnterChoiceGroup(org.apache.ws.commons.schema.XmlSchemaChoice xmlSchemaChoice) - Specified by:
- onEnterChoiceGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onExitChoiceGrouppublic void onExitChoiceGroup(org.apache.ws.commons.schema.XmlSchemaChoice xmlSchemaChoice) - Specified by:
- onExitChoiceGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onEnterSequenceGrouppublic void onEnterSequenceGroup(org.apache.ws.commons.schema.XmlSchemaSequence xmlSchemaSequence) - Specified by:
- onEnterSequenceGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onExitSequenceGrouppublic void onExitSequenceGroup(org.apache.ws.commons.schema.XmlSchemaSequence xmlSchemaSequence) - Specified by:
- onExitSequenceGroupin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onVisitAnypublic void onVisitAny(org.apache.ws.commons.schema.XmlSchemaAny xmlSchemaAny) - Specified by:
- onVisitAnyin interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
- 
onVisitAnyAttributepublic void onVisitAnyAttribute(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.XmlSchemaAnyAttribute xmlSchemaAnyAttribute) - Specified by:
- onVisitAnyAttributein interface- org.apache.ws.commons.schema.walker.XmlSchemaVisitor
 
 
-