Package com.ibm.icu.util

Examples of com.ibm.icu.util.StringTokenizer


    {     
      String result = null;
      if (xsiSchemaLocationValue != null && namespace != null)
      {
       
        StringTokenizer st = new StringTokenizer(xsiSchemaLocationValue);
        while(st.hasMoreTokens())
        {
          if(st.nextToken().equals(namespace))
          {
            if(st.hasMoreTokens())
            {
              result = st.nextToken();
            }
          }
          else
          {
            if(st.hasMoreTokens())
            {
              st.nextToken();
            }
          }
        }
      }
      return result;
View Full Code Here


      return false;
    }

    String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
    if (traceFilter != null) {
      StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
      while (tokenizer.hasMoreTokens()) {
        String cat = tokenizer.nextToken().trim();
        if (category.equals(cat)) {
          return true;
        }
      }
    }
View Full Code Here

   * @return location hint (systemId) if it was found, null otherwise
   */
  private String getLocationHint(Element elementNode, String namespaceURI) {
    Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
    if (schemaLocNode != null) {
      StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
      while (st.hasMoreTokens()) {
        String publicId = st.hasMoreTokens() ? st.nextToken() : null;
        String systemId = st.hasMoreTokens() ? st.nextToken() : null;
        // found location hint
        if (namespaceURI.equalsIgnoreCase(publicId)) {
          return systemId;
        }
      }
View Full Code Here

              attrText = document.get(((IDOMNode)node).getStartOffset(), ((IDOMNode)node).getLength());
            } catch (BadLocationException e) {
              Logger.logException(e);
            }
          }         
          StringTokenizer st = new StringTokenizer(attrValue);
          while (st.hasMoreTokens()) {
            publicId = st.nextToken();
            systemId = st.hasMoreTokens() ? st.nextToken() : null;
            int startOffset = -1;
            int endOffset = -1;
            if (publicId != null) {
              startOffset = attrText.indexOf(publicId);
              if (systemId != null) {
View Full Code Here

              IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

              for (int i = 1; i < lines && !fBuildPathIsDirty; i++) {
                line = doc.getLineInformation(i);
                lineText = doc.get(line.getOffset(), line.getLength());
                StringTokenizer toker = new StringTokenizer(lineText, "|"); //$NON-NLS-1$
                if (toker.hasMoreTokens()) {
                  String tokenType = toker.nextToken();
                  if ("JAR".equalsIgnoreCase(tokenType)) { //$NON-NLS-1$ //$NON-NLS-2$
                    boolean has11TLD = Boolean.valueOf(toker.nextToken()).booleanValue();
                    boolean exported = Boolean.valueOf(toker.nextToken()).booleanValue();
                    // make the rest the libraryLocation
                    String libraryLocation = toker.nextToken();
                    while (toker.hasMoreTokens()) {
                      libraryLocation = libraryLocation + "|" + toker.nextToken(); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    libraryLocation = libraryLocation.trim();
                    if (libraryRecord != null && notifyOnRestoration) {
                      TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, libraryRecord, ITaglibIndexDelta.ADDED));
                    }
                    // Create a new JarRecord
                    libraryRecord = createJARRecord(libraryLocation);
                    libraryRecord.has11TLD = has11TLD;
                    libraryRecord.isExported = exported;

                    // Add a URLRecord for the 1.1 TLD
                    if (has11TLD) {
                      InputStream contents = JarUtilities.getInputStream(libraryLocation, JarUtilities.JSP11_TAGLIB);
                      if (contents != null) {
                        TaglibInfo info = extractInfo(libraryLocation, contents);

                        if (info != null && info.uri != null && info.uri.length() > 0) {
                          URLRecord urlRecord = new URLRecord();
                          urlRecord.info = info;
                          urlRecord.isExported = exported;
                          urlRecord.baseLocation = libraryLocation;
                          try {
                            urlRecord.url = new URL("jar:file:" + libraryLocation + "!/" + JarUtilities.JSP11_TAGLIB); //$NON-NLS-1$ //$NON-NLS-2$
                            libraryRecord.urlRecords.add(urlRecord);
                            fClasspathReferences.put(urlRecord.getURI(), urlRecord);
                            if (_debugIndexCreation)
                              Logger.log(Logger.INFO, "created record for " + urlRecord.getURI() + "@" + urlRecord.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
                          }
                          catch (MalformedURLException e) {
                            /*
                             * don't record this
                             * URI
                             */
                            Logger.logException(e);
                          }
                        }
                        try {
                          contents.close();
                        }
                        catch (IOException e) {
                          Logger.log(Logger.ERROR_DEBUG, null, e);
                        }
                      }
                    }

                    fClasspathJars.put(libraryLocation, libraryRecord);
                  }
                  else if ("URL".equalsIgnoreCase(tokenType) && libraryRecord != null) { //$NON-NLS-1$
                    // relies on a previously declared JAR record
                    boolean exported = Boolean.valueOf(toker.nextToken()).booleanValue();
                    // make the rest the URL
                    String urlString = toker.nextToken();
                    while (toker.hasMoreTokens()) {
                      urlString = urlString + "|" + toker.nextToken(); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    urlString = urlString.trim();
                    // Append a URLrecord
                    URLRecord urlRecord = new URLRecord();
                    urlRecord.url = new URL(urlString);
                    urlRecord.isExported = exported;
                    urlRecord.baseLocation = libraryRecord.location.toString();

                    InputStream tldStream = JarUtilities.getInputStream(urlRecord.url);
                    if(tldStream != null) {
                      libraryRecord.urlRecords.add(urlRecord);
                      TaglibInfo info = extractInfo(urlRecord.url.toString(), tldStream);
                      if (info != null) {
                        urlRecord.info = info;
                      }
                      try {
                        tldStream.close();
                      }
                      catch (IOException e) {
                        Logger.log(Logger.ERROR_DEBUG, null, e);
                      }
                      if (urlRecord.getURI() != null && urlRecord.getURI().length() > 0) {
                        fClasspathReferences.put(urlRecord.getURI(), urlRecord);
                      }
                    }
                  }
                  else if (BUILDPATH_PROJECT.equalsIgnoreCase(tokenType)) {
                    String projectName = toker.nextToken();
                    if (Path.ROOT.isValidSegment(projectName)) {
                      IProject project = workspaceRoot.getProject(projectName);
                      /* do not check if "open" here */
                      if (project != null) {
                        fClasspathProjects.add(project);
                      }
                    }
                  }
                  // last since they occur once
                  else if (BUILDPATH_DIRTY.equalsIgnoreCase(tokenType)) {
                    fBuildPathIsDirty = Boolean.valueOf(toker.nextToken()).booleanValue();
                  }
                  else if (BUILDPATH_ENTRIES.equalsIgnoreCase(tokenType)) {
                    fBuildPathEntryCount = Integer.valueOf(toker.nextToken()).intValue();
                  }
                }
                if (libraryRecord != null && notifyOnRestoration) {
                  TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, libraryRecord, ITaglibIndexDelta.ADDED));
                }
View Full Code Here

      return false;
    if ("*".equals(searchName) && "*".equals(searchNamespace)) { //$NON-NLS-1$ //$NON-NLS-2$
      return true;
    }

    final StringTokenizer tokenizer = new StringTokenizer(pattern.searchName);
     while (tokenizer.hasMoreTokens()) {
       final String token = tokenizer.nextToken();
       int n = token.indexOf(":"); //$NON-NLS-1$
       String name = token;
       String namespace = pattern.searchNamespace; // accept the default
       if(n > 0) {
         final String prefix = token.substring(0, n);
View Full Code Here

    return string;
  }

  private void setStyledText(StyledText styledText, String text) {
    String visibleMessage = ""; //$NON-NLS-1$
    for (StringTokenizer st = new StringTokenizer(markedUpDetailsMessage, "'", false); st.hasMoreTokens();) //$NON-NLS-1$
    {
      String token = st.nextToken();
      visibleMessage += token;
    }

    styledText.setText(visibleMessage);
    // dw Font font = styledText.getFont();

    boolean inQuote = false;
    int position = 0;
    for (StringTokenizer st = new StringTokenizer(markedUpDetailsMessage, "'", true); st.hasMoreTokens();) //$NON-NLS-1$
    {
      String token = st.nextToken();

      if (token.equals("'")) //$NON-NLS-1$
      {
        inQuote = !inQuote;
      }
View Full Code Here

    if (!isDebugging())
      return false;

    String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
    if (traceFilter != null) {
      StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
      while (tokenizer.hasMoreTokens()) {
        String cat = tokenizer.nextToken().trim();
        if (category.equals(cat)) {
          return true;
        }
      }
    }
View Full Code Here

      int lastSlash = path.lastIndexOf('/');
      if (lastSlash > -1) {
        String pathSection = path.substring(lastSlash + 1);
        if (pathSection.length() > 0) {
          boolean emptyBaseName = pathSection.charAt(0) == '.';
          StringTokenizer tokens = new StringTokenizer(pathSection,
              ".");
          if (tokens.hasMoreTokens()) {
            String baseName;
            if (!emptyBaseName) {
              baseName = tokens.nextToken();
            } else {
              baseName = "";
            }
            if (tokens.hasMoreTokens()) {
              String[] langHeaderValues = request
                  .getHeaderValues(HeaderName.ACCEPT_LANGUAGE);
              List currentLanguages = new ArrayList();
              for (int i = 0; i < langHeaderValues.length; i++) {
                currentLanguages
                    .add(getLanguage(langHeaderValues[i]));

              }
              List languages = new ArrayList();
              List mimeTypes = new ArrayList();
              while (tokens.hasMoreTokens()) {
                String extension = tokens.nextToken();
                if (currentLanguages.contains(extension)
                    || systemLanguages.contains(extension)) {
                  languages.add(0, extension);
                  continue;
                }
View Full Code Here

                                                           try{
                                                               List<String> lines = IOUtils.readLines(new StringReader((String)message.getContent()));
                                                               if (lines.size()==2) {
                                                                   String timeLine = lines.get(0);
                                                                   String callLine = lines.get(1);
                                                                   StringTokenizer st = new StringTokenizer(timeLine);
                                                                   String secsString = st.nextToken();
                                                                   facet.seconds = Integer.parseInt(secsString.substring(0,secsString.length()-1));
                                                                   st = new StringTokenizer(callLine);
                                                                   if (callLine.indexOf("outgoing call")!=-1) {
                                                                       facet.callType = CallLogEntryFacet.CallType.OUTGOING;
                                                                   } else if (callLine.indexOf("incoming call")!=-1) {
                                                                       facet.callType = CallLogEntryFacet.CallType.INCOMING;
                                                                   }
                                                                   facet.personNumber = st.nextToken();
                                                                   switch(facet.callType) {
                                                                       case OUTGOING:
                                                                           Address[] recipients = null;
                                                                           try{
                                                                               recipients =  message.getRecipients(MimeMessage.RecipientType.TO);
                                                                           } catch (AddressException ignored){}
                                                                           if (recipients != null && recipients.length > 0)
                                                                               facet.personName = ((InternetAddress)recipients[0]).getPersonal();
                                                                           else
                                                                               facet.personName = message.getSubject().substring(10);//read the name from the subject line
                                                                           break;
                                                                       case INCOMING:
                                                                           Address[] senders = null;
                                                                           try{
                                                                               senders =  message.getFrom();
                                                                           } catch (AddressException ignored){}
                                                                           if (senders != null && senders.length > 0)
                                                                               facet.personName = ((InternetAddress)senders[0]).getPersonal();
                                                                           else
                                                                               facet.personName = message.getSubject().substring(10);//read the name from the subject line
                                                                   }
                                                               } else if (lines.size()==1) {
                                                                   String callLine = lines.get(0);
                                                                   StringTokenizer st = new StringTokenizer(callLine);
                                                                   facet.personNumber = st.nextToken();
                                                                   facet.callType = CallLogEntryFacet.CallType.MISSED;
                                                                   Address[] senders = null;
                                                                   try{
                                                                       senders =  message.getFrom();
                                                                   } catch (AddressException ignored){}
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.StringTokenizer

Copyright © 2018 www.massapicom. 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.