Examples of required()


Examples of org.apache.camel.dataformat.bindy.annotation.KeyValuePairField.required()

                     * target class and if the field is mandatory
                     */
                    if (obj != null) {

                        // Check mandatory field
                        if (keyValuePairField.required()) {
                            throw new IllegalArgumentException("The mandatory key/tag : " + key + " has not been defined !");
                        }

                        Object result = getDefaultValueForPrimitive(field.getType());

View Full Code Here

Examples of org.apache.cloudstack.api.Parameter.required()

            //TODO: Annotate @Validate on API Cmd classes, FIXME how to process Validate
            Validate validateAnnotation = field.getAnnotation(Validate.class);
            Object paramObj = unpackedParams.get(parameterAnnotation.name());
            if (paramObj == null) {
                if (parameterAnnotation.required()) {
                    throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8) + " due to missing parameter "
                            + parameterAnnotation.name());
                }
                continue;
            }
View Full Code Here

Examples of org.apache.cxf.jaxrs.ext.multipart.Multipart.required()

            } else {
                return fromAttachment(multipart, c, t, anns);
            }
        }
       
        if (id != null && !id.required()) {
            /*
             * If user asked for a null, give them a null.
             */
            return null;
        }
View Full Code Here

Examples of org.apache.felix.gogo.commands.Argument.required()

                            }
                            public String description() {
                                return delegate.description();
                            }
                            public boolean required() {
                                return delegate.required();
                            }
                            public int index() {
                                return delegate.index();
                            }
                            public boolean multiValued() {
View Full Code Here

Examples of org.apache.felix.gogo.commands.Option.required()

                }
            }
        }
        // Check required arguments / options
        for (Option option : options.keySet()) {
            if (option.required() && optionValues.get(option) == null) {
                Command command = action.getClass().getAnnotation(Command.class);
                throw new CommandException(
                        Ansi.ansi()
                                .fg(Ansi.Color.RED)
                                .a("Error executing command ")
View Full Code Here

Examples of org.apache.karaf.shell.api.action.Argument.required()

                            "Option " + option.name() + " is required"
                    );
            }
        }
        for (Argument argument : orderedArguments) {
            if (argument.required() && argumentValues.get(argument) == null) {
                    throw new CommandException(commandErrorSt +
                            "argument " + INTENSITY_BOLD + argument.name() + INTENSITY_NORMAL + " is required",
                            "Argument " + argument.name() + " is required"
                    );
            }
View Full Code Here

Examples of org.apache.karaf.shell.api.action.Option.required()

                }
            }
        }
        // Check required arguments / options
        for (Option option : options.keySet()) {
            if (option.required() && optionValues.get(option) == null) {
                    throw new CommandException(commandErrorSt +
                            "option " + INTENSITY_BOLD + option.name() + INTENSITY_NORMAL + " is required",
                            "Option " + option.name() + " is required"
                    );
            }
View Full Code Here

Examples of org.apache.karaf.shell.commands.Argument.required()

                public String description() {
                    return delegate.description();
                }

                public boolean required() {
                    return delegate.required();
                }

                public int index() {
                    return delegate.index();
                }
View Full Code Here

Examples of org.apache.karaf.shell.commands.Option.required()

                }
            }
        }
        // Check required arguments / options
        for (Option option : options.keySet()) {
            if (option.required() && optionValues.get(option) == null) {
                    throw new CommandException(commandErrorSt +
                            Ansi.ansi().a("option ").bold().a(option.name()).boldOff().a(" is required").toString(),
                            "Option " + option.name() + " is required"
                    );
            }
View Full Code Here

Examples of org.apache.logging.log4j.samples.dto.Constraint.required()

                    final Annotation[] annotations = _method.getDeclaredAnnotations();
                    for (final Annotation annotation : annotations) {
                        final Constraint constraint = (Constraint) annotation;

                        if (constraint.required() && msg.get(name) == null) {
                            if (missing.length() > 0) {
                                missing.append(", ");
                            }
                            missing.append(name);
                        }
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.