Examples of Arg


Examples of erjang.beam.Arg

              int this_fail = decode_labelref(((Insn.L)insn_).label, this.map[insn_idx].exh);
              int next_fail = decode_labelref(((Insn.L)next_insn).label, this.map[insn_idx+1].exh);

              if (this_fail == next_fail) {

                Arg this_arg = src_arg(insn_idx, ((Insn.LD)insn_).dest);
                Arg next_arg = src_arg(insn_idx+1, ((Insn.LD)next_insn).dest);

                if (this_arg.equals(next_arg)) {
                  // SKIP THIS INSTRUCTION!                 
                  continue next_insn;
                }
View Full Code Here

Examples of net.sf.kpex.builtins.Arg

    register(new DbAdd());
    register(new DbCollect());
    register(new DbSource());

    // data structure builders/converters
    register(new Arg());
    register(new NewFun());
    register(new GetArity());
    register(new NameToChars());
    register(new CharsToName());
    register(new NumberVars());
View Full Code Here

Examples of net.sourceforge.argparse4j.annotation.Arg

        parseArgs(args, 0, attrs);

        Class userClass = userData.getClass();
        while (userClass != null) {
            for (final Field field : userClass.getDeclaredFields()) {
                Arg ann = field.getAnnotation(Arg.class);
                if (ann != null) {
                    String argDest = ann.dest();
                    if (argDest.isEmpty()) {
                        argDest = field.getName();
                    }
                    if (!attrs.containsKey(argDest)) {
                        continue;
                    }
                    Object val = attrs.get(argDest);
                    try {
                        AccessController
                                .doPrivileged(new PrivilegedAction<Void>() {

                                    @Override
                                    public Void run() {
                                        field.setAccessible(true);
                                        return null;
                                    }
                                });
                        field.set(userData,
                                ReflectHelper.list2Array(field.getType(), val));
                    } catch (RuntimeException e) {
                        if (!ann.ignoreError()) {
                            throw e;
                        }
                    } catch (Exception e) {
                        if (!ann.ignoreError()) {
                            throw new IllegalArgumentException(String.format(
                                    TextHelper.LOCALE_ROOT,
                                    "Could not set %s to field %s", val,
                                    field.getName()), e);
                        }
                    }
                }
            }
            for (final Method method : userClass.getDeclaredMethods()) {
                Arg ann = method.getAnnotation(Arg.class);
                if (ann != null) {
                    String argDest = ann.dest();
                    if (argDest.isEmpty()) {
                        argDest = method.getName();
                    }
                    if (!attrs.containsKey(argDest)) {
                        continue;
                    }
                    Object val = attrs.get(argDest);
                    Class<?>[] fargs = method.getParameterTypes();
                    if (fargs.length != 1) {
                        throw new IllegalArgumentException(String.format(
                                TextHelper.LOCALE_ROOT,
                                "Method %s must have one formal parameter",
                                method.getName()));
                    }
                    try {
                        AccessController
                                .doPrivileged(new PrivilegedAction<Void>() {

                                    @Override
                                    public Void run() {
                                        method.setAccessible(true);
                                        return null;
                                    }
                                });
                        method.invoke(userData,
                                ReflectHelper.list2Array(fargs[0], val));
                    } catch (RuntimeException e) {
                        if (!ann.ignoreError()) {
                            throw e;
                        }
                    } catch (Exception e) {
                        if (!ann.ignoreError()) {
                            throw new IllegalArgumentException(String.format(
                                    TextHelper.LOCALE_ROOT,
                                    "Could not call method %s with %s",
                                    method.getName(), val), e);
                        }
View Full Code Here

Examples of org.apache.commons.validator.Arg

    {
        final Arg[] args = field.getArgs(action);
        final String[] argMessages = new String[args.length];
        for (int ctr = 0; ctr < args.length; ctr++)
        {
            final Arg arg = args[ctr];
            if (arg != null)
            {
                if (arg.isResource())
                {
                    argMessages[ctr] = Messages.get(
                            arg.getKey(),
                            null);
                }
                else
                {
                    argMessages[ctr] = arg.getKey();
                }
            }
        }
        return argMessages;
    }
View Full Code Here

Examples of org.apache.commons.validator.Arg

   *            Second error value to use
   */
  protected static void addError(ValidatorAction va, Errors errors,
      Field field, Object validatorErrorValue1,
      Object validatorErrorValue2) {
    Arg arg = field.getArg(0);
    String validatorKey = va.getMsg();
    if (arg != null) {
      String fieldMsgKey = arg.getKey();
      if (fieldMsgKey != null) {
        Error fieldMsg = ErrorFactory.createError(fieldMsgKey);
        Error validateError = ErrorFactory.createError(validatorKey,
            fieldMsg, validatorErrorValue1, validatorErrorValue2);
        errors.add(validateError);
View Full Code Here

Examples of org.apache.commons.validator.Arg

    String sProperty2 = field.getVarValue("secondProperty"); //$NON-NLS-1$
    String value2 = ValidatorUtils.getValueAsString(bean, sProperty2);
    if (!GenericValidator.isBlankOrNull(value)) {
      try {
        if (!value.equals(value2)) {
          Arg arg = field.getArg(1);
          Error fieldMsg = null;
          if (arg != null) {
            String fieldMsgKey = arg.getKey();
            if (fieldMsgKey != null) {
              fieldMsg = ErrorFactory.createError(fieldMsgKey);
            }
          }
          addError(va, errors, field, fieldMsg);
View Full Code Here

Examples of org.apache.commons.validator.Arg

                {
                    success = false;
                    String message = "invalid field"; // apps.getString(action.getMsg());
                    if (actName.equals("doubleRange"))
                    {
                        Arg f1 = field.getArg(1);
                        Arg f2 = field.getArg(2);
                        Arg f0 = field.getArg(0);
                        Object[] args =
                        { prettyFieldName, field.getVar("min").getValue(), field.getVar("max").getValue()};
                        System.out.println("     Error message will be: " + MessageFormat.format(message, args));
                    }
                    else
View Full Code Here

Examples of org.apache.commons.validator.Arg

                {
                    success = false;
                    String message = "invalid field"; // apps.getString(action.getMsg());
                    if (actName.equals("doubleRange"))
                    {
                        Arg f1 = field.getArg(1);
                        Arg f2 = field.getArg(2);
                        Arg f0 = field.getArg(0);
                        Object[] args =
                        { prettyFieldName, field.getVar("min").getValue(), field.getVar("max").getValue()};
                        System.out.println("     Error message will be: " + MessageFormat.format(message, args));
                    }
                    else
View Full Code Here

Examples of org.apache.drill.common.expression.Arg

 
  @Override
  public FunctionDefinition[] getFunctionDefintions() {
    return new FunctionDefinition[]{
        FunctionDefinition.simple("regex_like", new BasicArgumentValidator( //
            new Arg(true, false, "pattern", MinorType.VARCHAR, MinorType.VARCHAR), //
            new Arg(false, true, "value", MinorType.FIXEDCHAR, MinorType.VARCHAR, MinorType.VARCHAR) ), FixedType.FIXED_BIT),
    };

  }
View Full Code Here

Examples of org.apache.etch.interoptester.Arg

 
  /** @throws Exception */
  @Test
  public void parse6() throws Exception
  {
    Arg a = Arg.parse( parseXml( "<arg name=\"foo\">abc</arg>" ) );
    assertEquals( "foo", a.name() );
    assertEquals( "abc", a.value( args ) );
  }
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.