Examples of StaticError


Examples of net.sf.saxon.xpath.StaticError

                throw new DynamicError(err);
            }

            // check that it's not a pattern that matches ""
            if (re.matcher("").matches()) {
                throw new StaticError(
                        "The regular expression must not be one that matches a zero-length string");
            }

        }
        return new TokenIterator(input, re);
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

                    break;
                case 'x':
                    flags |= Pattern.COMMENTS;  // note, this enables comments as well as whitespace
                    break;
                default:
                    throw new StaticError("Invalid character '" + c + "' in regular expression flags");
            }
        }
        return flags;
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

            try {
                String javaRegex = RegexTranslator.translate(
                        ((StringValue)args[patternArg]).getStringValue(), true);
                return Pattern.compile(javaRegex, flags);
            } catch (RegexTranslator.RegexSyntaxException err) {
                throw new StaticError(err);
            } catch (PatternSyntaxException err) {
                throw new StaticError(err);
            }
        } else {
            return null;
        }
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

                            type0 != Type.UNTYPED_ATOMIC_TYPE &&
                            type0 != Type.ANY_ATOMIC_TYPE &&
                            Type.isSubType(type1, Type.ANY_ATOMIC_TYPE) &&
                            type1 != Type.UNTYPED_ATOMIC_TYPE &&
                            type1 != Type.ANY_ATOMIC_TYPE) {
                        StaticError err = new StaticError("Unsuitable operands for arithmetic operation (" +
                                type0.toString(env.getNamePool()) + ", " +
                                type1.toString(env.getNamePool()) + ')');
                        err.setIsTypeError(true);
                        throw err;
                    }
                    return e;
            }
            ExpressionTool.copyLocationInfo(this, e);
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

    * Type-check the expression.
    */

    public Expression analyze(StaticContext env, ItemType contextItemType) throws XPathException {
        if (contextItemType == null) {
            StaticError err = new StaticError("The context item is undefined at this point");
            err.setIsTypeError(true);
            err.setLocator(this);
            throw err;
        }
        itemType = contextItemType;
        return this;
    }
View Full Code Here

Examples of net.sf.saxon.xpath.StaticError

    * Type-check the expression
    */

    public Expression analyze(StaticContext env, ItemType contextItemType) throws XPathException {
        if (contextItemType == null) {
            StaticError err = new StaticError("Cannot use an axis here: the context item is undefined");
            err.setIsTypeError(true);
            err.setLocator(this);
            throw err;
        }
        if (contextItemType instanceof AtomicType) {
            StaticError err = new StaticError("Cannot use an axis here: the context item is an atomic value");
            err.setIsTypeError(true);
            err.setLocator(this);
            throw err;
        }
        return this;
    }
View Full Code Here

Examples of xbird.xquery.StaticError

    }

    public static Type get(QualifiedName type) throws StaticError {
        final Type t = types.get(type.toString());
        if(t == null) {
            throw new StaticError("err:XPST0051", "Type not found: " + type.toString());
        }
        return t;
    }
View Full Code Here

Examples of xbird.xquery.StaticError

    }

    public static Type get(final String type) throws StaticError {
        final Type resolved = safeGet(type);
        if(resolved == null) {
            throw new StaticError("err:XPST0051", "Type not found: " + type.toString());
        }
        return resolved;
    }
View Full Code Here

Examples of xbird.xquery.StaticError

    public static AtomicType createAtomicType(QualifiedName itemName, StaticContext ctxt)
            throws StaticError {
        final Type t = ctxt.getSchemaType(itemName);
        if(!(t instanceof AtomicType)) {
            throw new StaticError("err:XPST0051", "Type not found: " + itemName.toString());
        }
        return (AtomicType) t;
    }
View Full Code Here

Examples of xbird.xquery.StaticError

    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            this._analyzed = true;
            final Type primeType = _targetType.prime();
            if(primeType == NOTATIONType.NOTATION || primeType == AtomicType.ANY_ATOMIC_TYPE) {
                throw new StaticError("err:XPST0080", "Illegal target type: " + _targetType);
            }
            this._inputExpr = _inputExpr.staticAnalysis(statEnv);
            this._type = BooleanType.BOOLEAN;
        }
        return this;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.