Search in sources :

Example 1 with StaticTypeNameError

use of org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError in project webtools.sourceediting by eclipse.

the class DefaultEvaluator method visit.

/**
 * visit item type.
 *
 * @param e
 *            is the item type.
 * @return null
 */
public Object visit(ItemType e) {
    switch(e.type()) {
        case ItemType.ITEM:
            break;
        case ItemType.QNAME:
            boolean ok = false;
            TypeModel model = _sc.getTypeModel();
            if (model != null) {
                ok = _sc.getTypeModel().lookupType(e.qname().namespace(), e.qname().local()) != null;
            }
            if (!ok) {
                ok = BuiltinTypeLibrary.BUILTIN_TYPES.lookupType(e.qname().namespace(), e.qname().local()) != null;
            }
            if (!ok)
                report_error(new StaticTypeNameError("Type not defined: " + e.qname().string()));
            ResultSequence arg = (ResultSequence) ((Pair) _param)._two;
            ((Pair) _param)._two = item_test(arg, e.qname());
            break;
        case ItemType.KINDTEST:
            ((Pair) _param)._two = e.kind_test().accept(this);
            break;
    }
    return null;
}
Also used : ResultSequence(org.eclipse.wst.xml.xpath2.api.ResultSequence) TypeModel(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel) StaticTypeNameError(org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError)

Aggregations

ResultSequence (org.eclipse.wst.xml.xpath2.api.ResultSequence)1 TypeModel (org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel)1 StaticTypeNameError (org.eclipse.wst.xml.xpath2.processor.internal.StaticTypeNameError)1