Search in sources :

Example 1 with XMLAttributes

use of org.jooq.XMLAttributes in project jOOQ by jOOQ.

the class DefaultParseContext method parseFieldXMLElementIf.

private final Field<?> parseFieldXMLElementIf() {
    if (parseFunctionNameIf("XMLELEMENT")) {
        parse('(');
        parseKeywordIf("NAME");
        if (parseIf(')'))
            return xmlelement(systemName("NAME"));
        Name name = parseIdentifier();
        XMLAttributes attr = null;
        List<Field<?>> content = new ArrayList<>();
        while (parseIf(',')) {
            if (attr == null && parseKeywordIf("XMLATTRIBUTES")) {
                parse('(');
                List<Field<?>> attrs = parseAliasedXMLContent();
                parse(')');
                attr = xmlattributes(attrs);
            } else
                content.add(parseField());
        }
        parse(')');
        return attr == null ? xmlelement(name, content) : xmlelement(name, attr, content);
    }
    return null;
}
Also used : GroupField(org.jooq.GroupField) TableField(org.jooq.TableField) Field(org.jooq.Field) SortField(org.jooq.SortField) SelectField(org.jooq.SelectField) XMLAttributes(org.jooq.XMLAttributes) ArrayList(java.util.ArrayList) Name(org.jooq.Name) DSL.systemName(org.jooq.impl.DSL.systemName)

Aggregations

ArrayList (java.util.ArrayList)1 Field (org.jooq.Field)1 GroupField (org.jooq.GroupField)1 Name (org.jooq.Name)1 SelectField (org.jooq.SelectField)1 SortField (org.jooq.SortField)1 TableField (org.jooq.TableField)1 XMLAttributes (org.jooq.XMLAttributes)1 DSL.systemName (org.jooq.impl.DSL.systemName)1