Examples of Flag


Examples of gri.gridp.modules.Flag

    if (nameAttribute == null)
      throw new InvalidModuleException("Invalid parameter: missing required 'name' attribute");
    else
      paramName = nameAttribute.getValue();

    Flag flag = new Flag(paramName);

    //child elements:
    List children = element.getChildren();
    for (int i=0; i<children.size(); i++) {
      Element child = (Element)children.get(i);
      String name = child.getName().toLowerCase();

      if (name.equals("title"))
        flag.setTitle(child.getText());
      else if (name.equals("help"))
        flag.setHelp(child.getText());
      else if (name.equals("true-value"))
        flag.setTrueValue(child.getText());
      else if (name.equals("false-value"))
        flag.setFalseValue(child.getText());
      else if (name.equals("default")) {
        boolean value = child.getText().toLowerCase().equals("true");
        flag.setDefault(new Boolean(value));
      }
      else if (name.equals("scriptlet"))
        flag.setScriptlet(child.getText());
    }

    if (flag.getTrueValue() == null)
      throw new InvalidModuleException("Flag parameter must have 'true-value' specified to be useful");

    return flag;
  }
View Full Code Here

Examples of gri.gridp.modules.Flag

  protected String getTextValue(Parameter param, Object objValue) throws MissingParameterException, IOException {
    String textValue;

    //flag:
    if (param instanceof Flag) {
      Flag flagParam = (Flag)param;

      //obtain boolean value:
      Boolean value = (Boolean)objValue;
      if (value == null) {
        if (!flagParam.hasDefault())
          return null;

        value = flagParam.getDefault();
      }

      //translate boolean value to text we will put in script:
        textValue = flagParam.getValue(value.booleanValue());
        System.out.println("Flag text: " + textValue);
    }

    //basic parameter:
    else if (param instanceof BasicParameter)  {
View Full Code Here

Examples of gri.gridp.modules.Flag

            }
        }
       
        //flag (set type)
        else if (param instanceof Flag) {
            Flag flagParam = (Flag)param;
            System.out.println(flagParam);
            if (flagParam.hasDefault()) {
          System.out.println("flag default: " + flagParam.getDefault());
                newParam.setDefaultValue(flagParam.getDefault());
            }
        }
       
        return newParam;
    }
View Full Code Here

Examples of javax.mail.Flags.Flag

        Flags permFlags = getPermanentFlags(session);

        Flag[] systemFlags = flags.getSystemFlags();
        for (int i = 0; i < systemFlags.length; i++) {
            Flag f = systemFlags[i];

            if (f != Flag.RECENT && permFlags.contains(f) == false) {
                flags.remove(f);
            }
        }
View Full Code Here

Examples of net.aufdemrand.denizen.flags.FlagManager.Flag

                name.debug() + (index > 0 ? aH.debugObj("Index", String.valueOf(index)) : "")
                        + aH.debugUniqueObj("Action/Value", action.toString(), (value != null ? value.asString() : "null"))
                        + (duration != null ? duration.debug() : "")
                        + flag_target.debug());

        Flag flag;

        // Returns existing flag (if existing), or a new flag if not
        if (flag_target instanceof Element)
            flag = DenizenAPI.getCurrentInstance().flagManager().getGlobalFlag(name.asString());

        else if (flag_target instanceof dPlayer)
            flag = DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag((dPlayer) flag_target, name.asString());

        else if (flag_target instanceof dNPC)
            flag = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(((dNPC) flag_target).getId(), name.asString());

        else throw new CommandExecutionException("Could not fetch a flag for this entity: " + flag_target.debug());

        // Do the action!
        flag.doAction(action, value, index);

        // Set flag duration
        if (flag.StillValid() && duration != null && duration.getSeconds() > 0)
            flag.setExpiration(System.currentTimeMillis()
                    + Double.valueOf(duration.getSeconds() * 1000).longValue());

        else if (flag.StillValid() && flag.expiration().getMillis() != 0L) flag.setExpiration(0L);
    }
View Full Code Here

Examples of net.sourceforge.javautil.ui.command.annotation.Flag

        int offset = t - args.length;
        if (offset >= options.length) {
          offset = offset - options.length;
          if (offset >= flags.length) break;
         
          Flag fla = flags[offset];
          if (fla != null) {
            if (type != boolean.class && type != Boolean.class)
              throw new IllegalArgumentException("Invalid flag definition, can only be used on boolean types");
           
            defs.add(fla.name());
            this.addFlag(fla.name(), fla.value(), fla.defaultValue());
          }
        } else {
          Option opt = options[offset];
          defs.add(opt.name());
          this.addOption(opt.name(), type, opt.desc(), opt.defaultDesc());
View Full Code Here

Examples of net.sourceforge.javautil.ui.command.annotation.Flag

      this.addOption(name, property.getType(), option.desc(), option.defaultDesc());
    }
   
    properties = descriptor.getProperties(Flag.class);
    for (ClassProperty property : properties) {
      Flag flag = property.getAnnotation(Flag.class);
      String name = "".equals(flag) ? property.getName() : flag.name();
      this.addFlag(name, flag.value(), flag.defaultValue());
    }
   
  }
View Full Code Here

Examples of org.apache.jackrabbit.standalone.cli.Flag

        }

        // flags
        iter = desc.getFlags().values().iterator();
        while (iter.hasNext()) {
            Flag arg = (Flag) iter.next();
            out.print("-" + arg.getName() + " ");
        }
        out.println();

        // Alias
        if (desc.getAlias().size() > 0) {
View Full Code Here

Examples of org.exolab.jms.messagemgr.Flag

        MessageImpl result = null;
        Condition condition;
        if (wait > 0) {
            condition = TimedCondition.before(wait);
        } else {
            condition = new Flag(true);
        }
        if (!_stop.get()) {
            result = doReceive(consumerId, condition);
        } else {
            ConsumerEndpoint consumer = getConsumer(consumerId);
View Full Code Here

Examples of org.infinispan.context.Flag

            ((TxInvocationContext) ctx).getCacheTransaction().hasModification(ClearCommand.class) :
            command instanceof ClearCommand;
   }

   protected final void commitContextEntries(InvocationContext ctx, FlagAffectedCommand command, Metadata metadata) {
      final Flag stateTransferFlag = extractStateTransferFlag(ctx, command);

      if (stateTransferFlag == null) {
         //it is a normal operation
         stopStateTransferIfNeeded(ctx, command);
      }
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.