Package java.lang

Examples of java.lang.String.trim()


        if (expectedMatchStart == -1 || expectedMatchEnd == -1) {
          fail(lang
              + ": No error position markup ('<marker>...</marker>') in bad example in rule " + rule);
        }
        final String badSentence = cleanXML(origBadSentence);
        assertTrue(badSentence.trim().length() > 0);
        List<RuleMatch> matches = getMatches(rule, badSentence, languageTool);
        if (!rule.isWithComplexPhrase()) {
          assertTrue(lang + ": Did expect one error in: \"" + badSentence
              + "\" (Rule: " + rule + "), but found " + matches.size()
              + ". Additional info:" + rule.getMessage() + ", Matches: " + matches, matches.size() == 1);
View Full Code Here


      try{
        InputStreamReader read = new InputStreamReader(new FileInputStream(path), "UTF-8");
        BufferedReader in = new BufferedReader(read);
        String s;
        while ((s = in.readLine()) != null){
          s = s.trim();
          if (!s.matches("^$"))
            sWord.add(s);
        }
        in.close();
      }catch (Exception e) {
View Full Code Here

    }

    public boolean hasValueFor(final Object key) {
        final String v = data.get(key);
        if(v != null) {
            return v.trim().length() > 0;
        }
        return false;
    }

    @Override
View Full Code Here

                       ALTERNATE_DOC_BASE_ILLEGAL_URL_PATTERN,
                       urlPattern);
            return;
        }

        docBase = docBase.trim();

        addAlternateDocBase(urlPattern, docBase);
    }

    List<URI> getDeployAppLibs() {
View Full Code Here

        DeploymentContext dc = getWebModuleConfig().getDeploymentContext();
        if (dc == null) {
            return;
        }

        altDDName = altDDName.trim();
        if (altDDName.startsWith("/")) {
            altDDName = altDDName.substring(1);
        }
     
        String appLoc = dc.getSource().getParentArchive().getURI().getPath();
View Full Code Here

                       ALTERNATE_DOC_BASE_ILLEGAL_URL_PATTERN,
                       urlPattern);
            return;
        }

        docBase = docBase.trim();

        addAlternateDocBase(urlPattern, docBase);
    }

    List<URI> getDeployAppLibs() {
View Full Code Here

        DeploymentContext dc = getWebModuleConfig().getDeploymentContext();
        if (dc == null) {
            return;
        }

        altDDName = altDDName.trim();
        if (altDDName.startsWith("/")) {
            altDDName = altDDName.substring(1);
        }
     
        String appLoc = dc.getSource().getParentArchive().getURI().getPath();
View Full Code Here

            contentType = "";
        int semicolon = contentType.indexOf(';');
        if (semicolon >= 0) {
            contentType = contentType.substring(0, semicolon).trim();
        } else {
            contentType = contentType.trim();
        }
        if (!("application/x-www-form-urlencoded".equals(contentType))) {
            return null;
        }
View Full Code Here

            }
        }

        if (keepState == null) {
            String keepSessionsString = deployContext.getAppProps().getProperty(DeploymentProperties.KEEP_SESSIONS);
            if (keepSessionsString != null && keepSessionsString.trim().length() > 0) {
                keepState = Boolean.valueOf(keepSessionsString);
            } else {
                keepState = getDescriptor().getApplication().getKeepState();
            }
        }
View Full Code Here

      if (expectedMatchStart == -1 || expectedMatchEnd == -1) {
        fail(lang
            + ": No error position markup ('<marker>...</marker>') in bad example in rule " + rule);
      }
      final String badSentence = cleanXML(origBadSentence);
      assertTrue(badSentence.trim().length() > 0);
     
      // necessary for XML Pattern rules containing <or>
      List<RuleMatch> matches = new ArrayList<>();
      for (Rule auxRule : rules) {
        matches.addAll(getMatches(auxRule, badSentence, languageTool));
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.