Examples of Warning


Examples of org.bukkit.Warning

            }

            for (Class<?> clazz = eventClass; Event.class.isAssignableFrom(clazz); clazz = clazz.getSuperclass()) {
                // This loop checks for extending deprecated events
                if (clazz.getAnnotation(Deprecated.class) != null) {
                    Warning warning = clazz.getAnnotation(Warning.class);
                    WarningState warningState = server.getWarningState();
                    if (!warningState.printFor(warning)) {
                        break;
                    }
                    plugin.getLogger().log(
                            Level.WARNING,
                            String.format(
                                    "\"%s\" has registered a listener for %s on method \"%s\", but the event is Deprecated." +
                                    " \"%s\"; please notify the authors %s.",
                                    plugin.getDescription().getFullName(),
                                    clazz.getName(),
                                    method.toGenericString(),
                                    (warning != null && warning.reason().length() != 0) ? warning.reason() : "Server performance will be affected",
                                    Arrays.toString(plugin.getDescription().getAuthors().toArray())),
                            warningState == WarningState.ON ? new AuthorNagException(null) : null);
                    break;
                }
            }
View Full Code Here

Examples of org.restlet.client.data.Warning

        super(header);
    }

    @Override
    public Warning readValue() throws IOException {
        Warning result = new Warning();

        String code = readToken();
        skipSpaces();
        String agent = readRawText();
        skipSpaces();
        String text = readQuotedString();
        // The date is not mandatory
        skipSpaces();
        String date = null;
        if (peek() != -1) {
            date = readQuotedString();
        }

        if ((code == null) || (agent == null) || (text == null)) {
            throw new IOException("Warning header malformed.");
        }

        result.setStatus(Status.valueOf(Integer.parseInt(code)));
        result.setAgent(agent);
        result.setText(text);
        if (date != null) {
            result.setDate(DateUtils.parse(date));
        }

        return result;
    }
View Full Code Here

Examples of org.restlet.data.Warning

        super(header);
    }

    @Override
    public Warning readValue() throws IOException {
        Warning result = new Warning();

        String code = readToken();
        skipSpaces();
        String agent = readRawText();
        skipSpaces();
        String text = readQuotedString();
        // The date is not mandatory
        skipSpaces();
        String date = null;
        if (peek() != -1) {
            date = readQuotedString();
        }

        if ((code == null) || (agent == null) || (text == null)) {
            throw new IOException("Warning header malformed.");
        }

        result.setStatus(Status.valueOf(Integer.parseInt(code)));
        result.setAgent(agent);
        result.setText(text);
        if (date != null) {
            result.setDate(DateUtils.parse(date));
        }

        return result;
    }
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.