Пример #1
0
  private static void mapPrefixIfNeeded(
      Set<String> declaredPrefixes, String uri, String qName, StringBuilder sb) {
    final String prefix = XMLUtils.prefixFromQName(qName);
    if (prefix.length() > 0 && !declaredPrefixes.contains(prefix)) {
      sb.append(" xmlns:");
      sb.append(prefix);
      sb.append("=\"");
      sb.append(uri);
      sb.append("\"");

      declaredPrefixes.add(prefix);
    }
  }
 /** Register that an upload has ended. */
 public void endUpload(String uploadId) {
   // NOTE: Don't enforce existence of upload, as this is also called if upload control becomes
   // non-relevant, and
   // also because asynchronously if the client notifies us to end an upload after a control has
   // become non-relevant,
   // we don't want to fail.
   if (pendingUploads != null) pendingUploads.remove(uploadId);
 }
 /** Register that an upload has started. */
 public void startUpload(String uploadId) {
   if (pendingUploads == null) pendingUploads = new HashSet<String>();
   pendingUploads.add(uploadId);
 }
 /** Whether an upload is pending for the given upload control. */
 public boolean isUploadPendingFor(XFormsUploadControl uploadControl) {
   return (pendingUploads != null) && pendingUploads.contains(uploadControl.getUploadUniqueId());
 }
 /** Return the number of pending uploads. */
 public int countPendingUploads() {
   return (pendingUploads == null) ? 0 : pendingUploads.size();
 }