Package webit.script.exceptions

Examples of webit.script.exceptions.ScriptRuntimeException


        }

        public Object invoke(final Context context, final Object[] args) {
            final int len;
            if (args == null || (len = args.length) == 0) {
                throw new ScriptRuntimeException("This method need 1 argument at least.");
            }
            final CachingEntry cachingEntry;
            final Object firstArgument = args[0];
            if (firstArgument instanceof MethodDeclare) {
                cachingEntry = buildIfAbent(context, firstArgument, (MethodDeclare) firstArgument, args, 1);
            } else if (len > 1) {
                final Object secondArgument;
                if ((secondArgument = args[1]) instanceof MethodDeclare) {
                    cachingEntry = buildIfAbent(context, firstArgument, (MethodDeclare) secondArgument, args, 2);
                } else {
                    throw new ScriptRuntimeException("This method need a function argument at index 0 or 1.");
                }
            } else {
                throw new ScriptRuntimeException("This method need a function argument.");
            }
            context.out(cachingEntry.outted);
            return cachingEntry.returned;
        }
View Full Code Here


* @author zqq90
*/
public class ScriptVoidResolver implements GetResolver, SetResolver, OutResolver {

    public Object get(Object object, Object property) {
        throw new ScriptRuntimeException("'Void' type has no property.");
    }
View Full Code Here

    public Class getMatchClass() {
        return Void.class;
    }

    public void set(Object object, Object property, Object value) {
        throw new ScriptRuntimeException("'Void' type has no property.");
    }
View Full Code Here

            encoders.get().write(text, 0, text.length, out);
            final byte[] bytes = out.toArray();
            out.reset();
            return bytes;
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

    public Object get(Object object, Object property) {
        return ((SimpleUnsetableBag) object).get(property);
    }

    public void set(Object object, Object property, Object value) {
        throw new ScriptRuntimeException("This is an unsetable Object.s");
    }
View Full Code Here

                    return (((Iter) object).index() & 1) == 0; //Note: when index start by 0
                }
                break;
        }

        throw new ScriptRuntimeException(StringUtil.concat("Invalid property or can't read: webit.tl.util.collection.Iter#", property));
    }
View Full Code Here

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

    public void write(final byte[] bytes) {
        try {
            this.outputStream.write(bytes);
        } 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.encoder.write(chars, offset, length, this.outputStream);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

    public void write(final String string, final int offset, final int length) {
        try {
            this.encoder.write(string, offset, length, this.outputStream);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
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.