Examples of InvalidArgumentsException


Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

        if (!scriptEntry.hasObject("list")
                && !scriptEntry.hasObject("stop")
                && !scriptEntry.hasObject("next")
                && !scriptEntry.hasObject("callback"))
            throw new InvalidArgumentsException("Must specify a valid list or 'stop' or 'next'!");
    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

        if (!scriptEntry.hasObject("display") && scriptEntry.getObject("action").equals(Action.CREATE))
            scriptEntry.addObject("display", Display.LOCATION);

        if (!scriptEntry.hasObject("id"))
            throw new InvalidArgumentsException("Must specify a Viewer ID!");

        if (!scriptEntry.hasObject("location") && scriptEntry.getObject("action").equals(Action.CREATE))
            throw new InvalidArgumentsException("Must specify a Sign location!");

        if (!scriptEntry.hasObject("type") && scriptEntry.getObject("action").equals(Action.CREATE))
            scriptEntry.addObject("type", Type.SIGN_POST);
    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

            else arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("sqlid")) {
            throw new InvalidArgumentsException("Must specify an ID!");
        }

        if (!scriptEntry.hasObject("action")) {
            throw new InvalidArgumentsException("Must specify an action!");
        }
    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

                arg.reportUnhandled();

        }

        if (!scriptEntry.hasObject("script") && !scriptEntry.hasObject("local"))
            throw new InvalidArgumentsException("Must define a SCRIPT to be injected.");

        if (!scriptEntry.hasObject("path") && scriptEntry.hasObject("local"))
            throw new InvalidArgumentsException("Must specify a PATH.");

    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

            else if (ScriptRegistry.containsScript(aH.getStringFrom(arg))) {
                script = aH.getScriptFrom(arg);
                if (!script.getType().equalsIgnoreCase("TASK"))
                    script = null;

            } else throw new InvalidArgumentsException("Unknown argument '" + arg + "'!");
        }

        // Must specify at least a valid script to run...
        if (script == null)
            throw new InvalidArgumentsException("Must define a SCRIPT to be run.");
        // If not queue, and delayed, throw an exception... this cannot happen.
        if (queue.equals(scriptEntry.getResidingQueue().id) && delay != null)
            throw new InvalidArgumentsException("Cannot delay an INJECTED task script! Use 'QUEUE'.");

        // Put important objects inside the scriptEntry to be sent to execute()
        scriptEntry.addObject("instant", instant)
                .addObject("queue", queue)
                .addObject("delay", (delay != null ? delay.setPrefix("Delay") : null))
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

            else
                arg.reportUnhandled();
        }

        if (!scriptEntry.hasObject("location"))
            throw new InvalidArgumentsException("Missing location argument!");

        if (!scriptEntry.hasObject("action"))
            scriptEntry.addObject("action", new Element("ADD"));

        if (!scriptEntry.hasObject("duration"))
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

            else arg.reportUnhandled();
        }

        // Check for required information
        if (!scriptEntry.hasObject("world_name"))
            throw new InvalidArgumentsException("Must specify a world name.");

        if (!scriptEntry.hasObject("worldtype"))
            scriptEntry.addObject("worldtype", new Element("NORMAL"));
    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

                arg.reportUnhandled();
        }

        // Check for required information
         if (!scriptEntry.hasObject("required_object"))
          throw new InvalidArgumentsException("Must have required object!");

    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

                break;
            }
        }

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

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

    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.InvalidArgumentsException

                arg.reportUnhandled();
        }

        // Make sure location and entity were fulfilled
        if (!scriptEntry.hasObject("location"))
            throw new InvalidArgumentsException("Must specify a location!");

        // Use the NPC or the Player as the default entity
        scriptEntry.defaultObject("entity",
                (((BukkitScriptEntryData)scriptEntry.entryData).hasNPC() ? ((BukkitScriptEntryData)scriptEntry.entryData).getNPC().getDenizenEntity() : null));

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

        scriptEntry.defaultObject("radius", new Element(2));

    }
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.