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 Summary
Constructors -
Method Summary
Modifier 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
-
getDrillSchema
Returns 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.
-
onEnterElement
public 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 interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onExitElement
public void onExitElement(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.walker.XmlSchemaTypeInfo xmlSchemaTypeInfo, boolean b) - Specified by:
onExitElementin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onVisitAttribute
public 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 interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onEndAttributes
public 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 interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onEnterSubstitutionGroup
public void onEnterSubstitutionGroup(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement) - Specified by:
onEnterSubstitutionGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onExitSubstitutionGroup
public void onExitSubstitutionGroup(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement) - Specified by:
onExitSubstitutionGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onEnterAllGroup
public void onEnterAllGroup(org.apache.ws.commons.schema.XmlSchemaAll xmlSchemaAll) - Specified by:
onEnterAllGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onExitAllGroup
public void onExitAllGroup(org.apache.ws.commons.schema.XmlSchemaAll xmlSchemaAll) - Specified by:
onExitAllGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onEnterChoiceGroup
public void onEnterChoiceGroup(org.apache.ws.commons.schema.XmlSchemaChoice xmlSchemaChoice) - Specified by:
onEnterChoiceGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onExitChoiceGroup
public void onExitChoiceGroup(org.apache.ws.commons.schema.XmlSchemaChoice xmlSchemaChoice) - Specified by:
onExitChoiceGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onEnterSequenceGroup
public void onEnterSequenceGroup(org.apache.ws.commons.schema.XmlSchemaSequence xmlSchemaSequence) - Specified by:
onEnterSequenceGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onExitSequenceGroup
public void onExitSequenceGroup(org.apache.ws.commons.schema.XmlSchemaSequence xmlSchemaSequence) - Specified by:
onExitSequenceGroupin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onVisitAny
public void onVisitAny(org.apache.ws.commons.schema.XmlSchemaAny xmlSchemaAny) - Specified by:
onVisitAnyin interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-
onVisitAnyAttribute
public void onVisitAnyAttribute(org.apache.ws.commons.schema.XmlSchemaElement xmlSchemaElement, org.apache.ws.commons.schema.XmlSchemaAnyAttribute xmlSchemaAnyAttribute) - Specified by:
onVisitAnyAttributein interfaceorg.apache.ws.commons.schema.walker.XmlSchemaVisitor
-