public class XmlQueryParser
extends java.lang.Object
XmlQueryFormatter; more
precisely, for any Relation r, we should have that
XmlQueryParser.parse(XmlQueryFormatter.toXmlDocument(r)) == r
| Modifier and Type | Class and Description |
|---|---|
static class |
XmlQueryParser.ParseException
Exception raised when the parser wants to signal an error.
|
| Constructor and Description |
|---|
XmlQueryParser() |
| Modifier and Type | Method and Description |
|---|---|
static Relation |
parse(org.w3c.dom.Document doc)
Builds a query from a DOM document
|
protected static Relation |
parse(org.w3c.dom.Node e)
Parse an operand.
|
static Relation |
parse(java.lang.String s)
Builds a query from a string
|
protected static Attribute |
parseAttribute(org.w3c.dom.Node e)
Parse an attribute.
|
protected static Condition |
parseCondition(org.w3c.dom.Node e)
Parse an equality.
|
protected static Equality |
parseEquality(org.w3c.dom.Node e)
Parse an equality.
|
protected static Relation |
parseIntersection(org.w3c.dom.Node e)
Parse an intersection.
|
protected static Relation |
parseJoin(org.w3c.dom.Node e)
Parse a join.
|
protected static Condition |
parseNAryCondition(NAryCondition c,
org.w3c.dom.Node e) |
protected static Relation |
parseProduct(org.w3c.dom.Node e)
Parse a Cartesian product.
|
protected static Relation |
parseProjection(org.w3c.dom.Node e)
Parse a projection.
|
protected static Schema |
parseSchema(org.w3c.dom.Node e)
Parse a schema.
|
protected static Relation |
parseSelection(org.w3c.dom.Node e)
Parse a selection.
|
protected static Table |
parseTable(org.w3c.dom.Node e)
Parse a table.
|
protected static Tuple |
parseTuple(org.w3c.dom.Node e)
Parse a table tuple.
|
protected static Relation |
parseUnion(org.w3c.dom.Node e)
Parse a union.
|
protected static Value |
parseValue(org.w3c.dom.Node e)
Parse a value.
|
protected static VariableTable |
parseVariableTable(org.w3c.dom.Node e)
Parse a table.
|
public static Relation parse(java.lang.String s) throws XmlQueryParser.ParseException
s - A string containing an XML representation of the queryXmlQueryParser.ParseExceptionpublic static Relation parse(org.w3c.dom.Document doc) throws XmlQueryParser.ParseException
s - A DOM document containing an XML representation of the queryXmlQueryParser.ParseExceptionprotected static Relation parse(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<operand> <x>…</x> </operand>where x is either intersection, union, selection, projection or table.
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Relation parseSelection(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<projection> <condition>…</condition> <operand>…</operand> </projection>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Relation parseProjection(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<projection> <schema>…</schema> <operand>…</operand> </projection>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Relation parseUnion(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<union> <operand>…</operand> <operand>…</operand> … </union>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Relation parseIntersection(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<intersection> <operand>…</operand> <operand>…</operand> … </intersection>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Relation parseProduct(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<product> <operand>…</operand> <operand>…</operand> … </product>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Relation parseJoin(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<join> <condition>…</condition> <operand>…</operand> <operand>…</operand> </join>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Condition parseCondition(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<condition> <x>…</x> </condition>where x is equals (no other conditions implemented at the moment).
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Condition parseNAryCondition(NAryCondition c, org.w3c.dom.Node e) throws XmlQueryParser.ParseException
XmlQueryParser.ParseExceptionprotected static Equality parseEquality(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<equals> <x>…</x> <y>…</y> </equals>where x and y are either attribute or value
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Attribute parseAttribute(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<attribute>name</attribute>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static VariableTable parseVariableTable(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<table>name</table>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Table parseTable(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<table>name</table>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Value parseValue(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<value>name</value>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Tuple parseTuple(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<tuple> <attr>value</attr> <attr>value</attr> … </tuple>
e - An XML DOM nodeXmlQueryParser.ParseExceptionprotected static Schema parseSchema(org.w3c.dom.Node e) throws XmlQueryParser.ParseException
<schema> <attribute>…</attribute> <attribute>…</attribute> … </schema>
e - An XML DOM nodeXmlQueryParser.ParseExceptionCopyright © Sylvain HallĂ©. All Rights Reserved.