Package webit.script.exceptions

Examples of webit.script.exceptions.ScriptRuntimeException


    public void write(final String string) {
        try {
            this.encoder.write(string, 0, string.length(), this.outputStream);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here


    public void write(final byte[] bytes, final int offset, final int length) {
        try {
            this.decoder.write(bytes, offset, length, this.writer);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

    public void write(final byte[] bytes) {
        try {
            this.decoder.write(bytes, 0, bytes.length, this.writer);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

    public void write(final char[] chars, final int offset, final int length) {
        try {
            this.writer.write(chars, offset, length);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

    public void write(final char[] chars) {
        try {
            this.writer.write(chars);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

            string.getChars(offset, offset + length,
                    chars = this.buffers.getChars(length),
                    0);
            this.writer.write(chars, 0, length);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

        final int len;
        if (args != null && args.length > 0) {
            Object lenObject;
            if ((lenObject = args[0]) instanceof Number) {
                if ((len = ((Number) lenObject).intValue()) < 0) {
                    throw new ScriptRuntimeException(StringUtil.concat("must given a nonnegative number as array's length: ", len));
                }
            } else {
                throw new ScriptRuntimeException(StringUtil.concatObjectClass("must given a number as array's length, but get a: ", lenObject));
            }
        } else {
            len = 0;
        }
View Full Code Here

            methodArgs = new Object[myArgsCount];
        }
        try {
            return constructor.newInstance(methodArgs);
        } catch (InstantiationException ex) {
            throw new ScriptRuntimeException("Can't create new instance: ".concat(ex.getLocalizedMessage()));
        } catch (IllegalAccessException ex) {
            throw new ScriptRuntimeException("Unaccessible method: ".concat(ex.getLocalizedMessage()));
        } catch (IllegalArgumentException ex) {
            throw new ScriptRuntimeException("Illegal arguments: ".concat(ex.getLocalizedMessage()));
        } catch (InvocationTargetException ex) {
            throw new ScriptRuntimeException("this method throws an exception", ex.getTargetException());
        }
    }
View Full Code Here

                result = function.invoke(context, args);
                context.vars = bakVars;
                context.indexers = bakIndexers;
                return result;
            } catch (Exception e) {
                throw new ScriptRuntimeException(StatementUtil.castToScriptRuntimeException(e, function).setTemplate(template));
            }
        }
    }
View Full Code Here

                obj = args[0];
                int copyLen;
                //Note: Warning 参数个数不一致
                System.arraycopy(args, 1, methodArgs = new Object[myArgsCount], 0, ((copyLen = args.length - 1) <= myArgsCount) ? copyLen : myArgsCount);
            } else {
                throw new ScriptRuntimeException("this method need one argument at least");
            }
        }
        try {
            Object result = method.invoke(obj, methodArgs);
            return noVoid ? result : Context.VOID;
        } catch (IllegalAccessException ex) {
            throw new ScriptRuntimeException("this method is inaccessible: ".concat(ex.getLocalizedMessage()));
        } catch (IllegalArgumentException ex) {
            throw new ScriptRuntimeException("illegal argument: ".concat(ex.getLocalizedMessage()));
        } catch (InvocationTargetException ex) {
            throw new ScriptRuntimeException("this method throws an exception", ex.getTargetException());
        }
    }
View Full Code Here

TOP

Related Classes of webit.script.exceptions.ScriptRuntimeException

Copyright © 2018 www.massapicom. 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.