Examples of Arguments


Examples of org.apache.jsieve.Arguments

        mockAdapter = new ScriptCheckMailAdapter();
        List<String> stringList = new ArrayList<String>();
        stringList.add("Whatever");
        List<Argument> argumentList = new ArrayList<Argument>();
        argumentList.add(new StringListArgument(stringList));
        dummyArguments = new Arguments(argumentList, new TestList(Collections.EMPTY_LIST));
        ConfigurationManager configurationManager = new ConfigurationManager();
        dummyContext = new BaseSieveContext(
                configurationManager.getCommandManager(), configurationManager
                        .getComparatorManager(), configurationManager
                        .getTestManager(), LogFactory
View Full Code Here

Examples of org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.Arguments

    private static final long serialVersionUID = 1L;

    public double div(double arg1, double arg2) throws DivByZero {
        if (arg2 == 0) {
            DivByZero exception = new DivByZero();
            exception.arguments = new Arguments(arg1, arg2);
            exception.info = "Error occured during div: div by zero";
            throw exception;
        } else {
            return arg1 / arg2;
        }
View Full Code Here

Examples of org.apache.twill.internal.Arguments

          populateRunnableLocalFiles(twillSpec, runnableLocalFiles);
          saveSpecification(twillSpec, runnableLocalFiles, localFiles);
          saveLogback(localFiles);
          saveLauncher(localFiles);
          saveJvmOptions(localFiles);
          saveArguments(new Arguments(arguments, runnableArgs), localFiles);
          saveLocalFiles(localFiles, ImmutableSet.of(Constants.Files.TWILL_SPEC,
                                                     Constants.Files.LOGBACK_TEMPLATE,
                                                     Constants.Files.CONTAINER_JAR,
                                                     Constants.Files.LAUNCHER_JAR,
                                                     Constants.Files.ARGUMENTS));
View Full Code Here

Examples of org.geotools.resources.Arguments

     * Run the suite from the command line. If {@code "-log"} flag is specified on the
     * command-line, then the logger will be set to {@link Level#CONFIG}. This is usefull
     * for tracking down which data source is actually used.
     */
    public static void main(final String[] args) {
        final Arguments arguments = new Arguments(args);
        final boolean log = arguments.getFlag("-log");
        arguments.getRemainingArguments(0);
        org.geotools.util.logging.Logging.GEOTOOLS.forceMonolineConsoleOutput(log ? Level.CONFIG : null);
        junit.textui.TestRunner.run(suite());
    }
View Full Code Here

Examples of org.jboss.aesh.cl.Arguments

        for(Field field : clazz.getDeclaredFields()) {
            Option o;
            OptionGroup og;
            OptionList ol;
            Arguments a;
            if((o = field.getAnnotation(Option.class)) != null) {
                OptionType optionType;
                if(o.hasValue())
                    optionType = OptionType.NORMAL;
                else
                    optionType = OptionType.BOOLEAN;
                if(o.name() == null || o.name().length() < 1) {
                    processedCommand.addOption(o.shortName(), field.getName(), o.description(),
                            o.argument(), o.required(), ',', o.defaultValue(),
                            field.getType(), field.getName(), optionType, o.converter(),
                            o.completer(), o.validator(), o.activator(), o.renderer(), o.overrideRequired());
                }
                else {
                    processedCommand.addOption(o.shortName(), o.name(), o.description(),
                            o.argument(), o.required(), ',', o.defaultValue(),
                            field.getType(), field.getName(), optionType, o.converter(),
                            o.completer(), o.validator(), o.activator(), o.renderer(), o.overrideRequired());
                }

            }
            else if((ol = field.getAnnotation(OptionList.class)) != null) {
                if(!Collection.class.isAssignableFrom(field.getType()))
                    throw new CommandLineParserException("OptionGroup field must be instance of Collection");
                Class type = Object.class;
                if(field.getGenericType() != null) {
                    ParameterizedType listType = (ParameterizedType) field.getGenericType();
                    type = (Class) listType.getActualTypeArguments()[0];
                }
                if(ol.name() == null || ol.name().length() < 1) {
                    processedCommand.addOption(ol.shortName(), field.getName(), ol.description(), "",
                            ol.required(), ol.valueSeparator(), ol.defaultValue(), type, field.getName(), OptionType.LIST,
                            ol.converter(), ol.completer(), ol.validator(), ol.activator(), ol.renderer());
                }
                else {
                    processedCommand.addOption(ol.shortName(), ol.name(), ol.description(), "",
                            ol.required(), ol.valueSeparator(), ol.defaultValue(), type, field.getName(), OptionType.LIST,
                            ol.converter(), ol.completer(), ol.validator(), ol.activator(), ol.renderer());
                }
            }
            else if((og = field.getAnnotation(OptionGroup.class)) != null) {
                if(!Map.class.isAssignableFrom(field.getType()))
                    throw new CommandLineParserException("OptionGroup field must be instance of Map");
                Class type = Object.class;
                if(field.getGenericType() != null) {
                    ParameterizedType listType = (ParameterizedType) field.getGenericType();
                    type = (Class) listType.getActualTypeArguments()[1];
                }
                if(og.name() == null || og.name().length() < 1) {
                    processedCommand.addOption(og.shortName(), field.getName(), og.description(),
                            "", og.required(), ',', og.defaultValue(), type, field.getName(), OptionType.GROUP,
                            og.converter(), og.completer(), og.validator(), og.activator(), og.renderer());
                }
                else {
                    processedCommand.addOption(og.shortName(), og.name(), og.description(),
                            "", og.required(), ',', og.defaultValue(), type, field.getName(), OptionType.GROUP,
                            og.converter(), og.completer(), og.validator(), og.activator(), og.renderer());
                }
            }

            else if((a = field.getAnnotation(Arguments.class)) != null) {
                if(!Collection.class.isAssignableFrom(field.getType()))
                    throw new CommandLineParserException("Arguments field must be instance of Collection");
                Class type = Object.class;
                if(field.getGenericType() != null) {
                    ParameterizedType listType = (ParameterizedType) field.getGenericType();
                    type = (Class) listType.getActualTypeArguments()[0];
                }
                processedCommand.setArgument(
                        new ProcessedOption('\u0000',"", a.description(), "", false, a.valueSeparator(),
                                a.defaultValue(), type, field.getName(), OptionType.ARGUMENT, a.converter(),
                                a.completer(), a.validator(), null, null));
            }
        }

        return new CommandLineParserBuilder().parameter(processedCommand).generateParser();
    }
View Full Code Here

Examples of org.jeecgframework.minidao.annotation.Arguments

    String templateSql = null;
    //如果方法参数大于1个的话,方法必须使用注释标签Arguments
    boolean arguments_flag = method.isAnnotationPresent(Arguments.class);
    if(arguments_flag){
      //[1].获取方法的参数标签
      Arguments arguments = method.getAnnotation(Arguments.class)
            logger.debug("@Arguments------------------------------------------"+Arrays.toString(arguments.value()));
            if(arguments.value().length > args.length){
              //校验机制-如果注释标签参数数目大于方法的参数,则抛出异常
              throw new Exception("[注释标签]参数数目,不能大于[方法参数]参数数目");
            }
            // step.2.将args转换成键值对,封装成Map对象
            int args_num = 0;
            for(String v:arguments.value()){
              // update-begin--Author:fancq  Date:20140102 for:支持多数据分页
              if (v.equalsIgnoreCase("page")) {
                pageSetting.setPage(Integer.parseInt(args[args_num].toString()));
              }
              if (v.equalsIgnoreCase("rows")) {
View Full Code Here

Examples of org.jitterbit.util.net.Arguments

        }
    }

    private void writeCommand(ByteArrayOutputStream buf, Command cmd) throws IOException {
        writeStringWithLength(buf, cmd.getCommandName());
        Arguments args = cmd.getArguments();
        KongaProtocolUtils.appendInt(buf, args.size());
        for (String arg : args) {
            writeStringWithLength(buf, arg);
        }
    }
View Full Code Here

Examples of org.python.antlr.ast.arguments

                + ")";
        def(tmp);
        ArgListCompiler ac = new ArgListCompiler();
        List<expr> args = new ArrayList<expr>();
        args.add(new Name(node.getToken(), bound_exp, expr_contextType.Param));
        ac.visitArgs(new arguments(node, args, null, null, new ArrayList<expr>()));
        beginScope(tmp, FUNCSCOPE, node, ac);
        cur.addParam(bound_exp);
        cur.markFromParam();

        cur.defineAsGenerator(node);
View Full Code Here

Examples of org.thymeleaf.Arguments

        if (processingContext instanceof Arguments) {
            // Try to initialize the context variables by asking the SpEL expression
            // evaluator object (which might be a subclass of the standard one) to create
            // this variable map.
           
            final Arguments arguments = (Arguments) processingContext;
            final IStandardVariableExpressionEvaluator expressionEvaluator =
                    StandardExpressions.getVariableExpressionEvaluator(arguments.getConfiguration());

            contextVariables =
                    SpringVersionSpecificUtils.computeExpressionObjectsFromExpressionEvaluator(arguments, expressionEvaluator);

        }
View Full Code Here

Examples of ru.yandex.strictweb.ajaxtools.annotation.Arguments

    return p;
  }
 
 
  Object[] getParams(JsonRePresentation rep, Method method, HttpServletRequest request) throws Exception {
    Arguments arguments = method.getAnnotation(Arguments.class);
    if(arguments==null) throw new MethodNotArgumentized(method);
   
    Class<?>[] parameterTypes = method.getParameterTypes();
   
    int nParams = parameterTypes.length;
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.