Package org.jaggeryjs.scriptengine.exceptions

Examples of org.jaggeryjs.scriptengine.exceptions.ScriptException


                property.put("value", property, properties.get(key));
                props.add(property);
            }
            return cx.newArray(thisObj, props.toArray());
        } else {
            throw new ScriptException("getProperties() method doesn't accept arguments");
        }
    }
View Full Code Here


                    arguments[2] instanceof String) {

                resourceHostObject.resource.editPropertyValue((String) arguments[0], (String) arguments[1],
                        (String) arguments[2]);
            } else {
                throw new ScriptException("Invalid argument types for editProperty() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for editProperty() method");
        }
    }
View Full Code Here

        ResourceHostObject resourceHostObject = (ResourceHostObject) thisObj;
        if (arguments.length == 1) {
            if (arguments[0] instanceof String) {
                resourceHostObject.resource.removeProperty((String) arguments[0]);
            } else {
                throw new ScriptException("Invalid argument type for removeProperty() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for removeProperty() method");
        }
    }
View Full Code Here

        ResourceHostObject resourceHostObject = (ResourceHostObject) thisObj;
        if (arguments.length == 2) {
            if (arguments[0] instanceof String && arguments[1] instanceof String) {
                resourceHostObject.resource.removePropertyValue((String) arguments[0], (String) arguments[1]);
            } else {
                throw new ScriptException("Invalid argument types for removePropertyValue() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for removePropertyValue() method");
        }
    }
View Full Code Here

                resourceHostObject.resource.setProperty((String) arguments[0], (String) arguments[1]);
            } else if (arguments[0] instanceof String && arguments[1] instanceof NativeArray) {
                resourceHostObject.resource.setProperty((String) arguments[0], (List) Context.jsToJava(
                        arguments[1], List.class));
            } else {
                throw new ScriptException("Invalid argument types for setProperty() method");
            }
        } else {
            throw new ScriptException("Invalid no. of arguments for setProperty() method");
        }
    }
View Full Code Here

    public void jsSet_mediaType(Object mediaType) throws ScriptException {
        if (mediaType instanceof String) {
            this.resource.setMediaType((String) mediaType);
        } else {
            throw new ScriptException("Invalid property type for mediaType");
        }
    }
View Full Code Here

                return context.newArray(this, Arrays.copyOf(content, content.length, Object[].class));
            } else {
                return Context.toObject(result, this);
            }
        } catch (RegistryException e) {
            throw new ScriptException("Registry Exception while reading content property", e);
        }
    }
View Full Code Here

    public void jsSet_content(Object content) throws ScriptException {
        if (content instanceof String) {
            try {
                this.resource.setContent((String) content);
            } catch (RegistryException e) {
                throw new ScriptException("Registry Exception while setting content property", e);
            }
        } else if (content instanceof XMLObject) {
            try {
                this.resource.setContent(AXIOMUtil.stringToOM(content.toString()));
            } catch (Exception e) {
                throw new ScriptException(e);
            }
        } else {
            throw new ScriptException("Invalid property type for content");
        }
    }
View Full Code Here

    public void jsSet_description(Object description) throws ScriptException {
        if (description instanceof String) {
            this.resource.setDescription((String) description);
        } else {
            throw new ScriptException("Invalid property type for description");
        }
    }
View Full Code Here

            String content = HostObjectUtil.serializeObject(object);
            response.getOutputStream().print(content);
        } catch (IOException e) {
            String msg = "Error occurred while reading Servlet OutputStream";
            log.error(msg, e);
            throw new ScriptException(msg, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jaggeryjs.scriptengine.exceptions.ScriptException

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.