Package net.aufdemrand.denizencore.exceptions

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException


        }

        // Check for required arguments

        if (!scriptEntry.hasObject("id"))
            throw new InvalidArgumentsException("Must specify an id!");

        if (!scriptEntry.hasObject("action"))
            throw new InvalidArgumentsException("Must specify an action!");

        if (!scriptEntry.hasObject("key") &&
                scriptEntry.getElement("action").asString().equalsIgnoreCase("write"))
            throw new InvalidArgumentsException("Must specify a key!");

        scriptEntry.defaultObject("value", new Element(""));
    }
View Full Code Here


        // Add default script if none was specified.
        scriptEntry.defaultObject("script", scriptEntry.getScript());

        // Check if player is valid
        if (!((BukkitScriptEntryData)scriptEntry.entryData).hasPlayer() || !((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().isValid())
            throw new InvalidArgumentsException("Must have player context!");
    }
View Full Code Here

                break;
            }
        }

        if (!scriptEntry.hasObject("value") && !scriptEntry.hasObject("stop") && !scriptEntry.hasObject("next") && !scriptEntry.hasObject("callback"))
            throw new InvalidArgumentsException("Must specify a comparison value or 'stop' or 'next'!");

        scriptEntry.addObject("braces", getBracedCommands(scriptEntry));

    }
View Full Code Here

                // Check matchesArgumentType afterwards so we don't default
                // to the attached script unintentionally.
                if (arg.matchesArgumentType(dScript.class))
                    scriptEntry.addObject("script", arg.asType(dScript.class));
                else
                    throw new InvalidArgumentsException("Specified an invalid script!");
            }

            else arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("duration"))
            throw new InvalidArgumentsException("Requires a valid duration!");
    }
View Full Code Here

            else arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("definition") || !scriptEntry.hasObject("value"))
            throw new InvalidArgumentsException("Must specify a definition and value!");

    }
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

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.