use of org.teiid.query.sql.symbol.XMLNamespaces.NamespaceItem in project teiid by teiid.
the class Evaluator method namespaces.
private Evaluator.NameValuePair<String>[] namespaces(XMLNamespaces namespaces) {
if (namespaces == null) {
return null;
}
List<NamespaceItem> args = namespaces.getNamespaceItems();
Evaluator.NameValuePair<String>[] nameValuePairs = new Evaluator.NameValuePair[args.size()];
for (int i = 0; i < args.size(); i++) {
NamespaceItem item = args.get(i);
nameValuePairs[i] = new Evaluator.NameValuePair<String>(item.getPrefix(), item.getUri());
}
return nameValuePairs;
}
use of org.teiid.query.sql.symbol.XMLNamespaces.NamespaceItem in project teiid by teiid.
the class SQLStringVisitor method visit.
@Override
public void visit(XMLNamespaces obj) {
append(XMLNAMESPACES);
// $NON-NLS-1$
append("(");
for (Iterator<NamespaceItem> items = obj.getNamespaceItems().iterator(); items.hasNext(); ) {
NamespaceItem item = items.next();
if (item.getPrefix() == null) {
if (item.getUri() == null) {
// $NON-NLS-1$
append("NO DEFAULT");
} else {
// $NON-NLS-1$
append("DEFAULT ");
visitNode(new Constant(item.getUri()));
}
} else {
visitNode(new Constant(item.getUri()));
// $NON-NLS-1$
append(" AS ");
outputDisplayName(item.getPrefix());
}
if (items.hasNext()) {
// $NON-NLS-1$
append(", ");
}
}
// $NON-NLS-1$
append(")");
}
Aggregations