예제 #1
0
  public void marshall(
      Class parentType,
      QName elementType,
      ExtensibilityElement extension,
      PrintWriter pw,
      Definition def,
      ExtensionRegistry extReg)
      throws WSDLException {
    MIMEContent mimeContent = (MIMEContent) extension;

    if (mimeContent != null) {
      String tagName = DOMUtils.getQualifiedValue(MIMEConstants.NS_URI_MIME, "content", def);

      if (parentType != null && MIMEPart.class.isAssignableFrom(parentType)) {
        pw.print("    ");
      }

      pw.print("        <" + tagName);

      DOMUtils.printAttribute(MIMEConstants.ATTR_PART, mimeContent.getPart(), pw);
      DOMUtils.printAttribute(Constants.ATTR_TYPE, mimeContent.getType(), pw);

      Boolean required = mimeContent.getRequired();

      if (required != null) {
        DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw);
      }

      pw.println("/>");
    }
  }
예제 #2
0
 private static Object[] parseArguments(String args[])
     throws Exception
 {
     File f;
     File f1;
     Socket s;
     Boolean server = null;
     f = new File(args[0]);
     f1 = new File(args[1]);
     s = null;
     if(args.length == 4)
     {
         int port = Integer.parseInt(args[2]);
         server = new Boolean(args[3].trim().equalsIgnoreCase("true"));
         if(server.booleanValue())
             s = (new ServerSocket(port)).accept();
         else
             s = new Socket("localhost", port);
     }
     return (new Object[] {
         f, f1, s
     });
     Exception ex;
     ex;
     printUsage();
     throw ex;
 }
예제 #3
0
 public Property get(String category, String key, boolean defaultValue) {
   Property prop = get(category, key, Boolean.toString(defaultValue), BOOLEAN);
   if (!prop.isBooleanValue()) {
     prop.value = Boolean.toString(defaultValue);
   }
   return prop;
 }
예제 #4
0
 private static GeometricObject recreateObject(String data) {
   GeometricObject result = null;
   String[] token = data.split(",");
   if (token[0].equals("Circle")) { // find what constructor to use
     String color = token[1];
     boolean filled = Boolean.valueOf(token[2]); // find data in the line
     double radius = Double.valueOf(token[3]);
     try {
       return new Circle(color, filled, radius); // attempt to make a circle
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   if (token[0].equals("Rectangle")) {
     String color = token[1];
     boolean filled = Boolean.valueOf(token[2]); // find data
     double height = Double.valueOf(token[3]);
     double width = Double.valueOf(token[4]);
     try {
       return new Rectangle(color, filled, height, width); // attempt to make a rectangle
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   return result; // default return null GeometricObject
 } // end method
 /** INTERNAL: Return if the expression is for a direct mapped attribute. */
 public boolean isAttribute() {
   if (isAttributeExpression == null) {
     if (getSession() == null) {
       // We can't tell, so say no.
       return false;
     }
     QueryKey queryKey = getQueryKeyOrNull();
     if (queryKey != null) {
       isAttributeExpression = Boolean.valueOf(queryKey.isDirectQueryKey());
     } else {
       DatabaseMapping mapping = getMapping();
       if (mapping != null) {
         if (mapping.isVariableOneToOneMapping()) {
           throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(
               mapping, mapping.getDescriptor());
         } else {
           isAttributeExpression = Boolean.valueOf(mapping.isDirectToFieldMapping());
         }
       } else {
         isAttributeExpression = Boolean.FALSE;
       }
     }
   }
   return isAttributeExpression.booleanValue();
 }
예제 #6
0
 void LoadConfig() {
   String id = Long.toString(robot_uid);
   limit_top = Double.valueOf(prefs.get(id + "_limit_top", "0"));
   limit_bottom = Double.valueOf(prefs.get(id + "_limit_bottom", "0"));
   limit_left = Double.valueOf(prefs.get(id + "_limit_left", "0"));
   limit_right = Double.valueOf(prefs.get(id + "_limit_right", "0"));
   m1invert = Boolean.parseBoolean(prefs.get(id + "_m1invert", "false"));
   m2invert = Boolean.parseBoolean(prefs.get(id + "_m2invert", "false"));
 }
예제 #7
0
 void SaveConfig() {
   String id = Long.toString(robot_uid);
   prefs.put(id + "_limit_top", Double.toString(limit_top));
   prefs.put(id + "_limit_bottom", Double.toString(limit_bottom));
   prefs.put(id + "_limit_right", Double.toString(limit_right));
   prefs.put(id + "_limit_left", Double.toString(limit_left));
   prefs.put(id + "_m1invert", Boolean.toString(m1invert));
   prefs.put(id + "_m2invert", Boolean.toString(m2invert));
 }
예제 #8
0
 /**
  * @attribute syn
  * @aspect GenericsSubtype
  * @declaredat
  *     /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:212
  */
 @SuppressWarnings({"unchecked", "cast"})
 public boolean sameStructure(TypeDecl t) {
   Object _parameters = t;
   if (sameStructure_TypeDecl_values == null)
     sameStructure_TypeDecl_values = new java.util.HashMap(4);
   ASTNode$State.CircularValue _value;
   if (sameStructure_TypeDecl_values.containsKey(_parameters)) {
     Object _o = sameStructure_TypeDecl_values.get(_parameters);
     if (!(_o instanceof ASTNode$State.CircularValue)) {
       return ((Boolean) _o).booleanValue();
     } else _value = (ASTNode$State.CircularValue) _o;
   } else {
     _value = new ASTNode$State.CircularValue();
     sameStructure_TypeDecl_values.put(_parameters, _value);
     _value.value = Boolean.valueOf(true);
   }
   ASTNode$State state = state();
   if (!state.IN_CIRCLE) {
     state.IN_CIRCLE = true;
     int num = state.boundariesCrossed;
     boolean isFinal = this.is$Final();
     boolean new_sameStructure_TypeDecl_value;
     do {
       _value.visited = new Integer(state.CIRCLE_INDEX);
       state.CHANGE = false;
       new_sameStructure_TypeDecl_value = sameStructure_compute(t);
       if (new_sameStructure_TypeDecl_value != ((Boolean) _value.value).booleanValue()) {
         state.CHANGE = true;
         _value.value = Boolean.valueOf(new_sameStructure_TypeDecl_value);
       }
       state.CIRCLE_INDEX++;
     } while (state.CHANGE);
     if (isFinal && num == state().boundariesCrossed) {
       sameStructure_TypeDecl_values.put(_parameters, new_sameStructure_TypeDecl_value);
     } else {
       sameStructure_TypeDecl_values.remove(_parameters);
       state.RESET_CYCLE = true;
       sameStructure_compute(t);
       state.RESET_CYCLE = false;
     }
     state.IN_CIRCLE = false;
     return new_sameStructure_TypeDecl_value;
   }
   if (!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
     _value.visited = new Integer(state.CIRCLE_INDEX);
     boolean new_sameStructure_TypeDecl_value = sameStructure_compute(t);
     if (state.RESET_CYCLE) {
       sameStructure_TypeDecl_values.remove(_parameters);
     } else if (new_sameStructure_TypeDecl_value != ((Boolean) _value.value).booleanValue()) {
       state.CHANGE = true;
       _value.value = new_sameStructure_TypeDecl_value;
     }
     return new_sameStructure_TypeDecl_value;
   }
   return ((Boolean) _value.value).booleanValue();
 }
예제 #9
0
  /** Synchronizes the state of the actions to the current state of this host. */
  private void updateActions() {
    final DeviceController currentDeviceController = getDeviceController();

    final boolean deviceControllerSet = currentDeviceController != null;
    final boolean deviceCapturing = deviceControllerSet && currentDeviceController.isCapturing();
    final boolean deviceSetup =
        deviceControllerSet && !deviceCapturing && currentDeviceController.isSetup();

    getAction(CaptureAction.ID).setEnabled(deviceControllerSet);
    getAction(CancelCaptureAction.ID).setEnabled(deviceCapturing);
    getAction(RepeatCaptureAction.ID).setEnabled(deviceSetup);

    final boolean projectChanged = this.projectManager.getCurrentProject().isChanged();
    final boolean projectSavedBefore =
        this.projectManager.getCurrentProject().getFilename() != null;
    final boolean dataAvailable = this.dataContainer.hasCapturedData();

    getAction(SaveProjectAction.ID).setEnabled(projectChanged);
    getAction(SaveProjectAsAction.ID).setEnabled(projectSavedBefore && projectChanged);
    getAction(SaveDataFileAction.ID).setEnabled(dataAvailable);

    getAction(ZoomInAction.ID).setEnabled(dataAvailable);
    getAction(ZoomOutAction.ID).setEnabled(dataAvailable);
    getAction(ZoomDefaultAction.ID).setEnabled(dataAvailable);
    getAction(ZoomFitAction.ID).setEnabled(dataAvailable);

    final boolean triggerEnable = dataAvailable && this.dataContainer.hasTriggerData();
    getAction(GotoTriggerAction.ID).setEnabled(triggerEnable);

    // Update the cursor actions accordingly...
    final boolean enableCursors = dataAvailable && this.dataContainer.isCursorsEnabled();

    for (int c = 0; c < CapturedData.MAX_CURSORS; c++) {
      final boolean enabled = enableCursors && this.dataContainer.isCursorPositionSet(c);
      getAction(GotoNthCursorAction.getID(c)).setEnabled(enabled);
    }

    getAction(GotoFirstCursorAction.ID).setEnabled(enableCursors);
    getAction(GotoLastCursorAction.ID).setEnabled(enableCursors);

    getAction(SetCursorModeAction.ID).setEnabled(dataAvailable);
    getAction(SetCursorModeAction.ID)
        .putValue(Action.SELECTED_KEY, Boolean.valueOf(this.dataContainer.isCursorsEnabled()));

    boolean anyCursorSet = false;
    for (int c = 0; c < CapturedData.MAX_CURSORS; c++) {
      final boolean cursorPositionSet = this.dataContainer.isCursorPositionSet(c);
      anyCursorSet |= cursorPositionSet;

      final Action action = getAction(SetCursorAction.getCursorId(c));
      action.setEnabled(dataAvailable);
      action.putValue(Action.SELECTED_KEY, Boolean.valueOf(cursorPositionSet));
    }

    getAction(ClearCursors.ID).setEnabled(enableCursors && anyCursorSet);
  }
예제 #10
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
예제 #11
0
 private static void toXml(XmlWriter w, Requirement requirement) throws IOException {
   w.element(RepositoryParser.REQUIRE)
       .attribute(RepositoryParser.NAME, requirement.getName())
       .attribute(RepositoryParser.FILTER, requirement.getFilter())
       .attribute(RepositoryParser.EXTEND, Boolean.toString(requirement.isExtend()))
       .attribute(RepositoryParser.MULTIPLE, Boolean.toString(requirement.isMultiple()))
       .attribute(RepositoryParser.OPTIONAL, Boolean.toString(requirement.isOptional()))
       .text(requirement.getComment().trim())
       .end();
 }
예제 #12
0
  public RegionFile(File file) {
    lastModified = 0L;
    fileName = file;
    debugln((new StringBuilder()).append("REGION LOAD ").append(fileName).toString());
    sizeDelta = 0;
    try {
      if (file.exists()) {
        lastModified = file.lastModified();
      }
      dataFile = new RandomAccessFile(file, "rw");
      if (dataFile.length() < 4096L) {
        for (int i = 0; i < 1024; i++) {
          dataFile.writeInt(0);
        }

        for (int j = 0; j < 1024; j++) {
          dataFile.writeInt(0);
        }

        sizeDelta += 8192;
      }
      if ((dataFile.length() & 4095L) != 0L) {
        for (int k = 0; (long) k < (dataFile.length() & 4095L); k++) {
          dataFile.write(0);
        }
      }
      int l = (int) dataFile.length() / 4096;
      sectorFree = new ArrayList(l);
      for (int i1 = 0; i1 < l; i1++) {
        sectorFree.add(Boolean.valueOf(true));
      }

      sectorFree.set(0, Boolean.valueOf(false));
      sectorFree.set(1, Boolean.valueOf(false));
      dataFile.seek(0L);
      for (int j1 = 0; j1 < 1024; j1++) {
        int l1 = dataFile.readInt();
        offsets[j1] = l1;
        if (l1 == 0 || (l1 >> 8) + (l1 & 0xff) > sectorFree.size()) {
          continue;
        }
        for (int j2 = 0; j2 < (l1 & 0xff); j2++) {
          sectorFree.set((l1 >> 8) + j2, Boolean.valueOf(false));
        }
      }

      for (int k1 = 0; k1 < 1024; k1++) {
        int i2 = dataFile.readInt();
        chunkTimestamps[k1] = i2;
      }

    } catch (IOException ioexception) {
      ioexception.printStackTrace();
    }
  }
예제 #13
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     // System.out.println("Debug:TextViewer: ActionChangedListener enabled");
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
예제 #14
0
 @Override
 public SCM newInstance(StaplerRequest req, JSONObject formData) throws FormException {
   String path = req.getParameter("fs_scm.path");
   String[] filters = req.getParameterValues("fs_scm.filters");
   Boolean filterEnabled =
       Boolean.valueOf("on".equalsIgnoreCase(req.getParameter("fs_scm.filterEnabled")));
   Boolean includeFilter = Boolean.valueOf(req.getParameter("fs_scm.includeFilter"));
   Boolean clearWorkspace =
       Boolean.valueOf("on".equalsIgnoreCase(req.getParameter("fs_scm.clearWorkspace")));
   return new FSSCM(path, clearWorkspace, filterEnabled, includeFilter, filters);
 }
예제 #15
0
 private static Map<String, String> nodeAllocationToMap(AssociationEntry entry) {
   final HashMap<String, String> map = new HashMap(8);
   map.put(FIELD_HOSTNAME, entry.getHostname());
   map.put(FIELD_IP, entry.getIpAddress());
   map.put(FIELD_MAC, entry.getMac());
   map.put(FIELD_BROADCAST, entry.getBroadcast());
   map.put(FIELD_SUBNET_MASK, entry.getSubnetMask());
   map.put(FIELD_GATEWAY, entry.getGateway());
   map.put(FIELD_IN_USE, Boolean.toString(entry.isInUse()));
   map.put(FIELD_EXPLICIT_MAC, Boolean.toString(entry.isExplicitMac()));
   return map;
 }
예제 #16
0
  public static String[] exec(String command, String interpret) {

    log.info("RListener - calling DirectJNI.getInstance().exec(" + command + ")");

    String[] result =
        DirectJNI.getInstance()
            .exec(command, Boolean.parseBoolean(interpret), !Boolean.parseBoolean(interpret));

    log.info("RListener - DirectJNI returned");

    return result;
  }
예제 #17
0
 @SuppressWarnings({"unchecked", "cast"})
 public boolean subtype(TypeDecl type) {
   Object _parameters = type;
   if (subtype_TypeDecl_visited == null) subtype_TypeDecl_visited = new java.util.HashMap(4);
   if (subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4);
   if (subtype_TypeDecl_computed.contains(_parameters))
     return ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue();
   if (!subtype_TypeDecl_initialized.contains(_parameters)) {
     subtype_TypeDecl_initialized.add(_parameters);
     subtype_TypeDecl_values.put(_parameters, Boolean.valueOf(true));
   }
   if (!IN_CIRCLE) {
     IN_CIRCLE = true;
     int num = boundariesCrossed;
     boolean isFinal = this.is$Final();
     CIRCLE_INDEX = 1;
     boolean new_subtype_TypeDecl_value;
     do {
       subtype_TypeDecl_visited.put(_parameters, new Integer(CIRCLE_INDEX));
       CHANGE = false;
       new_subtype_TypeDecl_value = subtype_compute(type);
       if (new_subtype_TypeDecl_value
           != ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue()) CHANGE = true;
       subtype_TypeDecl_values.put(_parameters, Boolean.valueOf(new_subtype_TypeDecl_value));
       CIRCLE_INDEX++;
     } while (CHANGE);
     if (isFinal && num == boundariesCrossed) {
       subtype_TypeDecl_computed.add(_parameters);
     } else {
       RESET_CYCLE = true;
       subtype_compute(type);
       RESET_CYCLE = false;
       subtype_TypeDecl_computed.remove(_parameters);
       subtype_TypeDecl_initialized.remove(_parameters);
     }
     IN_CIRCLE = false;
     return new_subtype_TypeDecl_value;
   }
   if (!new Integer(CIRCLE_INDEX).equals(subtype_TypeDecl_visited.get(_parameters))) {
     subtype_TypeDecl_visited.put(_parameters, new Integer(CIRCLE_INDEX));
     if (RESET_CYCLE) {
       subtype_TypeDecl_computed.remove(_parameters);
       subtype_TypeDecl_initialized.remove(_parameters);
       return ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue();
     }
     boolean new_subtype_TypeDecl_value = subtype_compute(type);
     if (new_subtype_TypeDecl_value
         != ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue()) CHANGE = true;
     subtype_TypeDecl_values.put(_parameters, Boolean.valueOf(new_subtype_TypeDecl_value));
     return new_subtype_TypeDecl_value;
   }
   return ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue();
 }
예제 #18
0
 protected boolean queryBoolean(String query) throws IOException {
   if (USECACHE) {
     if (cache == null) cache = new Hashtable();
     Object r = cache.get(query);
     if (r != null) return ((Boolean) r).booleanValue();
     Boolean r1 = queryBoolean1(query);
     cache.put(query, r1);
     return r1.booleanValue();
   } else {
     return queryBoolean1(query).booleanValue();
   }
 }
예제 #19
0
 public static boolean isScratchImageValid(Image img) {
   try {
     Boolean lost = (Boolean) tryMethod(img, "contentsLost", new Object[] {});
     if (lost == null) return true; // method does not exist->not volatile
     // System.out.println("volatile");
     return !lost.booleanValue();
   } catch (java.security.AccessControlException e) {
     // we're not allowed to do this (we're probably an applet)
     // we assume we created a nonvolatile image
     return true;
   }
 }
예제 #20
0
 public static String PrintState(ArrayList state) {
   StringBuffer sb = new StringBuffer();
   Iterator i = state.iterator();
   while (i.hasNext()) {
     Object o = i.next();
     if (o instanceof Boolean) {
       Boolean val = (Boolean) o;
       sb.append((val.booleanValue() ? "." : "X"));
     }
   }
   return sb.toString();
 }
  /** Add entries to the Map for node filter parameters from the nodeset */
  public static void addAPINodeSetParams(
      final HashMap<String, String> params, final NodeSet nodeSet, final Boolean isKeepgoing) {

    if (null == nodeSet) {
      return;
    }
    if (nodeSet.getThreadCount() > 0) {
      params.put("nodeThreadcount", Integer.toString(nodeSet.getThreadCount()));
    }
    if (null != isKeepgoing) {
      params.put("nodeKeepgoing", Boolean.toString(isKeepgoing));
    }
    if (nodeSet.isBlank()) {
      return;
    }
    boolean excludeprecedence = true;
    if (null != nodeSet.getExclude() && nodeSet.getExclude().isDominant()) {
      excludeprecedence = true;
    } else if (null != nodeSet.getInclude() && nodeSet.getInclude().isDominant()) {
      excludeprecedence = false;
    }
    params.put("exclude-precedence", Boolean.toString(excludeprecedence));

    final NodeSet.Include include = nodeSet.getInclude();

    for (final NodeSet.FILTER_ENUM filter : NodeSet.FILTER_ENUM.values()) {
      String value = null;
      if (null != include && !include.isBlank()) {
        value = filter.value(include);
      }

      final String key = filter.getName();
      if (null != value && !"".equals(value)) {
        params.put(key, value);
      } else {
        params.put(key, "");
      }
    }
    final NodeSet.Exclude exclude = nodeSet.getExclude();

    for (final NodeSet.FILTER_ENUM filter : NodeSet.FILTER_ENUM.values()) {
      String value = null;
      if (null != exclude && !exclude.isBlank()) {
        value = filter.value(exclude);
      }
      final String key = filter.getName();
      if (null != value && !"".equals(value)) {
        params.put("exclude-" + key, value);
      } else {
        params.put("exclude-" + key, "");
      }
    }
  }
예제 #22
0
 // get licensing features, with appropriate defaults
 @SuppressWarnings("unchecked")
 private void loadLicensingFeatures(Element licensingElt) {
   List<LicensingFeature> licensingFeats = new ArrayList<LicensingFeature>();
   boolean containsLexFeat = false;
   if (licensingElt != null) {
     for (Iterator<Element> it = licensingElt.getChildren("feat").iterator(); it.hasNext(); ) {
       Element featElt = it.next();
       String attr = featElt.getAttributeValue("attr");
       if (attr.equals("lex")) containsLexFeat = true;
       String val = featElt.getAttributeValue("val");
       List<String> alsoLicensedBy = null;
       String alsoVals = featElt.getAttributeValue("also-licensed-by");
       if (alsoVals != null) {
         alsoLicensedBy = Arrays.asList(alsoVals.split("\\s+"));
       }
       boolean licenseEmptyCats = true;
       boolean licenseMarkedCats = false;
       boolean instantiate = true;
       byte loc = LicensingFeature.BOTH;
       String lmc = featElt.getAttributeValue("license-marked-cats");
       if (lmc != null) {
         licenseMarkedCats = Boolean.valueOf(lmc).booleanValue();
         // change defaults
         licenseEmptyCats = false;
         loc = LicensingFeature.TARGET_ONLY;
         instantiate = false;
       }
       String lec = featElt.getAttributeValue("license-empty-cats");
       if (lec != null) {
         licenseEmptyCats = Boolean.valueOf(lec).booleanValue();
       }
       String inst = featElt.getAttributeValue("instantiate");
       if (inst != null) {
         instantiate = Boolean.valueOf(inst).booleanValue();
       }
       String locStr = featElt.getAttributeValue("location");
       if (locStr != null) {
         if (locStr.equals("target-only")) loc = LicensingFeature.TARGET_ONLY;
         if (locStr.equals("args-only")) loc = LicensingFeature.ARGS_ONLY;
         if (locStr.equals("both")) loc = LicensingFeature.BOTH;
       }
       licensingFeats.add(
           new LicensingFeature(
               attr, val, alsoLicensedBy, licenseEmptyCats, licenseMarkedCats, instantiate, loc));
     }
   }
   if (!containsLexFeat) {
     licensingFeats.add(LicensingFeature.defaultLexFeature);
   }
   _licensingFeatures = new LicensingFeature[licensingFeats.size()];
   licensingFeats.toArray(_licensingFeatures);
 }
 public static boolean shouldSkipPlugin(final IdeaPluginDescriptor descriptor) {
   if (descriptor instanceof IdeaPluginDescriptorImpl) {
     IdeaPluginDescriptorImpl descriptorImpl = (IdeaPluginDescriptorImpl) descriptor;
     Boolean skipped = descriptorImpl.getSkipped();
     if (skipped != null) {
       return skipped.booleanValue();
     }
     boolean result = shouldSkipPlugin(descriptor, ourPlugins);
     descriptorImpl.setSkipped(result);
     return result;
   }
   return shouldSkipPlugin(descriptor, ourPlugins);
 }
예제 #24
0
  private Element generatePortNode(Document doc, Port port) {
    Element portEl = doc.createElement(EL_PORT);

    portEl.setAttribute(ATR_NAME, port.getName());
    portEl.setAttribute(ATR_TYPE, port.getType());
    portEl.setAttribute(ATR_X, Integer.toString(port.getX()));
    portEl.setAttribute(ATR_Y, Integer.toString(port.getY()));
    portEl.setAttribute(ATR_PORT_CONNECTION, port.isArea() ? "area" : "");
    portEl.setAttribute(ATR_STRICT, Boolean.toString(port.isStrict()));
    portEl.setAttribute(ATR_MULTI, Boolean.toString(port.isMulti()));

    return portEl;
  }
 public void startElement(String uri, String localName, String qName, Attributes attributes)
     throws SAXException {
   if ("tag".equals(qName)) {
     String name = attributes.getValue("name");
     String content = attributes.getValue("content");
     String section = attributes.getValue("section");
     String deprecated = attributes.getValue("deprecated");
     String unique = attributes.getValue("unique");
     String ignorePermitted = attributes.getValue("ignore-permitted");
     tagInfo =
         new TagInfo(
             name,
             "all".equals(content)
                 ? TagInfo.CONTENT_ALL
                 : ("none".equals(content) ? TagInfo.CONTENT_NONE : TagInfo.CONTENT_TEXT),
             "all".equals(section)
                 ? TagInfo.HEAD_AND_BODY
                 : ("head".equals(section) ? TagInfo.HEAD : TagInfo.BODY),
             deprecated != null && "true".equals(deprecated),
             unique != null && "true".equals(unique),
             ignorePermitted != null && "true".equals(ignorePermitted));
     if (generateCode) {
       String s = "tagInfo = new TagInfo(\"#1\", #2, #3, #4, #5, #6);";
       s = s.replaceAll("#1", name);
       s =
           s.replaceAll(
               "#2",
               "all".equals(content)
                   ? "TagInfo.CONTENT_ALL"
                   : ("none".equals(content)
                       ? "TagInfo.CONTENT_NONE"
                       : " TagInfo.CONTENT_TEXT"));
       s =
           s.replaceAll(
               "#3",
               "all".equals(section)
                   ? "TagInfo.HEAD_AND_BODY"
                   : ("head".equals(section) ? "TagInfo.HEAD" : "TagInfo.BODY"));
       s = s.replaceAll("#4", Boolean.toString(deprecated != null && "true".equals(deprecated)));
       s = s.replaceAll("#5", Boolean.toString(unique != null && "true".equals(unique)));
       s =
           s.replaceAll(
               "#6",
               Boolean.toString(ignorePermitted != null && "true".equals(ignorePermitted)));
       System.out.println(s);
     }
   } else if (!"tags".equals(qName)) {
     dependencyName = qName;
   }
 }
  /**
   * Parses the arguments table from the GATK Report and creates a RAC object with the proper
   * initialization values
   *
   * @param table the GATKReportTable containing the arguments and its corresponding values
   * @return a RAC object properly initialized with all the objects in the table
   */
  private RecalibrationArgumentCollection initializeArgumentCollectionTable(GATKReportTable table) {
    final RecalibrationArgumentCollection RAC = new RecalibrationArgumentCollection();

    for (int i = 0; i < table.getNumRows(); i++) {
      final String argument = table.get(i, "Argument").toString();
      Object value = table.get(i, RecalUtils.ARGUMENT_VALUE_COLUMN_NAME);
      if (value.equals("null"))
        value =
            null; // generic translation of null values that were printed out as strings | todo --
                  // add this capability to the GATKReport

      if (argument.equals("covariate") && value != null)
        RAC.COVARIATES = value.toString().split(",");
      else if (argument.equals("standard_covs"))
        RAC.DO_NOT_USE_STANDARD_COVARIATES = Boolean.parseBoolean((String) value);
      else if (argument.equals("solid_recal_mode"))
        RAC.SOLID_RECAL_MODE = RecalUtils.SOLID_RECAL_MODE.recalModeFromString((String) value);
      else if (argument.equals("solid_nocall_strategy"))
        RAC.SOLID_NOCALL_STRATEGY =
            RecalUtils.SOLID_NOCALL_STRATEGY.nocallStrategyFromString((String) value);
      else if (argument.equals("mismatches_context_size"))
        RAC.MISMATCHES_CONTEXT_SIZE = Integer.parseInt((String) value);
      else if (argument.equals("indels_context_size"))
        RAC.INDELS_CONTEXT_SIZE = Integer.parseInt((String) value);
      else if (argument.equals("mismatches_default_quality"))
        RAC.MISMATCHES_DEFAULT_QUALITY = Byte.parseByte((String) value);
      else if (argument.equals("insertions_default_quality"))
        RAC.INSERTIONS_DEFAULT_QUALITY = Byte.parseByte((String) value);
      else if (argument.equals("deletions_default_quality"))
        RAC.DELETIONS_DEFAULT_QUALITY = Byte.parseByte((String) value);
      else if (argument.equals("maximum_cycle_value"))
        RAC.MAXIMUM_CYCLE_VALUE = Integer.parseInt((String) value);
      else if (argument.equals("low_quality_tail"))
        RAC.LOW_QUAL_TAIL = Byte.parseByte((String) value);
      else if (argument.equals("default_platform")) RAC.DEFAULT_PLATFORM = (String) value;
      else if (argument.equals("force_platform")) RAC.FORCE_PLATFORM = (String) value;
      else if (argument.equals("quantizing_levels"))
        RAC.QUANTIZING_LEVELS = Integer.parseInt((String) value);
      else if (argument.equals("recalibration_report"))
        RAC.existingRecalibrationReport = (value == null) ? null : new File((String) value);
      else if (argument.equals("binary_tag_name"))
        RAC.BINARY_TAG_NAME = (value == null) ? null : (String) value;
      else if (argument.equals("sort_by_all_columns"))
        RAC.SORT_BY_ALL_COLUMNS = Boolean.parseBoolean((String) value);
    }

    return RAC;
  }
예제 #27
0
 public CreateObjectMonitor(String n, ObjectURL wturl, WithHash w, Boolean r) {
   super();
   name = n;
   with = w;
   this.wturl = wturl;
   replace = r.booleanValue();
 }
예제 #28
0
 public void load(InputStream inputStream) throws Exception {
   BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
   ArrayList<String> us = new ArrayList<>();
   while (bufferedReader.ready()) {
     us.add(bufferedReader.readLine());
   }
   for (int i = 0; i < us.size(); i += 5) {
     User user = new User();
     user.setFirstName(us.get(i));
     user.setLastName(us.get(i + 1));
     user.setBirthDate(new Date(Long.parseLong(us.get(i + 2))));
     user.setMale(Boolean.valueOf(us.get(i + 3)));
     String country = us.get(i + 4);
     User.Country country1 = null;
     if (country.equals("UKRAINE")) {
       country1 = User.Country.UKRAINE;
     } else if (country.equals("RUSSIA")) {
       country1 = User.Country.RUSSIA;
     } else if (country.equals("OTHER")) {
       country1 = User.Country.OTHER;
     }
     user.setCountry(country1);
     users.add(user);
   }
   bufferedReader.close();
 }
예제 #29
0
  public void init() throws ServletException {
    if (!inited) {
      secureDirPath = getServletContext().getRealPath(SECURE_CONTEXT_PATH);
      strongProtection = Boolean.valueOf(getInitParameter("strongProtection")).booleanValue();
      File secureDir = new File(secureDirPath);
      if (secureDirPath != null && secureDir.isDirectory()) {
        inited = true;

        if (DEBUG)
          log(
              "Initialization OK (Strong protection "
                  + (strongProtection ? "enabled" : "DISABLED (better enable it check web.xml) !!!")
                  + "). Setting secureDirPath to "
                  + secureDirPath);
      } else {
        if (DEBUG)
          log(
              "Initialization problem, please check if "
                  + getServletContext().getRealPath(SECURE_CONTEXT_PATH)
                  + " exists and if it is directory !!!");
      }
    }
    dateFormat = DateFormat.getDateInstance();
    dateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
  }
예제 #30
0
  public PacksModel(InstallData idata) {
    this.installData = idata;
    this.rules = idata.getRules();
    try {
      this.messages = idata.getMessages().newMessages(PackHelper.LANG_FILE_NAME);
    } catch (com.izforge.izpack.api.exception.ResourceNotFoundException ex) {
      this.messages = idata.getMessages();
    }
    this.variables = idata.getVariables();
    this.packsToInstall = idata.getSelectedPacks();

    this.modifyInstallation = Boolean.valueOf(idata.getVariable(InstallData.MODIFY_INSTALLATION));
    this.installedPacks = loadInstallationInformation(modifyInstallation);

    this.packs = getVisiblePacks();
    this.hiddenPacks = getHiddenPacks();
    this.allPacks = idata.getAvailablePacks();
    this.nameToRow = getNametoRowMapping(packs);
    this.nameToPack = getNametoPackMapping(allPacks);

    this.packs = setPackProperties(packs, nameToPack);
    this.checkValues = initCheckValues(packs, packsToInstall);

    updateConditions(true);
    updatePacksToInstall();
  }