Examples of PatternMatcher


Examples of org.apache.ivy.plugins.matcher.PatternMatcher

                Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes, new String[] {
                        "name", "type", "ext", "url", "conf"});
                confAware = new DefaultDependencyArtifactDescriptor(name, type, ext,
                        url == null ? null : new URL(url), extraAtt);
            } else if (state == ARTIFACT_INCLUDE) {
                PatternMatcher matcher = getPatternMatcher(attributes.getValue("matcher"));
                String org = ivy.substitute(attributes.getValue("org"));
                org = org == null ? PatternMatcher.ANY_EXPRESSION : org;
                String module = ivy.substitute(attributes.getValue("module"));
                module = module == null ? PatternMatcher.ANY_EXPRESSION : module;
                ArtifactId aid = new ArtifactId(new ModuleId(org, module), name, type, ext);
                Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes, new String[] {
                        "org", "module", "name", "type", "ext", "matcher", "conf"});
                confAware = new DefaultIncludeRule(aid, matcher, extraAtt);
            } else { // _state == ARTIFACT_EXCLUDE || EXCLUDE
                PatternMatcher matcher = getPatternMatcher(attributes.getValue("matcher"));
                String org = ivy.substitute(attributes.getValue("org"));
                org = org == null ? PatternMatcher.ANY_EXPRESSION : org;
                String module = ivy.substitute(attributes.getValue("module"));
                module = module == null ? PatternMatcher.ANY_EXPRESSION : module;
                ArtifactId aid = new ArtifactId(new ModuleId(org, module), name, type, ext);
View Full Code Here

Examples of org.apache.ivy.plugins.matcher.PatternMatcher

            }
        }

        private PatternMatcher getPatternMatcher(String m) {
            String matcherName = ivy.substitute(m);
            PatternMatcher matcher = matcherName == null ? defaultMatcher : ivy
                    .getMatcher(matcherName);
            if (matcher == null) {
                throw new IllegalArgumentException("unknown matcher " + matcherName);
            }
            return matcher;
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

                                 String sId, String [] aAttachmentsPath,
                                 String sBasePath)
  throws IOException,MessagingException,IllegalArgumentException,SecurityException {

  PatternCompiler oCompiler = new Perl5Compiler();
  PatternMatcher oMatcher = new Perl5Matcher();
 
  String sContentType = (sHtmlBody==null ? "plain" : "html");
 
  if (DebugFile.trace) {
    DebugFile.writeln("Begin SessionHandler.composeMessage("+sSubject+","+sEncoding+",...,"+sId+","+sContentType+")");
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

            return defaultValue;
        }

        List<MatchResult> collectAllMatches = new ArrayList<MatchResult>();
        try {
            PatternMatcher matcher = JMeterUtils.getMatcher();
            PatternMatcherInput input = new PatternMatcherInput(textToMatch);
            while (matcher.contains(input, searchPattern)) {
                MatchResult match = matcher.getMatch();
                collectAllMatches.add(match);
            }
        } catch (NumberFormatException e) {//TODO: can this occur?
            log.error("", e); //$NON-NLS-1$
            return defaultValue;
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

    private Object[] generateTemplate(String rawTemplate) {
        List<String> pieces = new ArrayList<String>();
        // String or Integer
        List<Object> combined = new LinkedList<Object>();
        PatternMatcher matcher = JMeterUtils.getMatcher();
        Util.split(pieces, matcher, templatePattern, rawTemplate);
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
        boolean startsWith = isFirstElementGroup(rawTemplate);
        if (startsWith) {
            pieces.remove(0);// Remove initial empty entry
        }
        Iterator<String> iter = pieces.iterator();
        while (iter.hasNext()) {
            boolean matchExists = matcher.contains(input, templatePattern);
            if (startsWith) {
                if (matchExists) {
                    combined.add(Integer.valueOf(matcher.getMatch().group(1)));
                }
                combined.add(iter.next());
            } else {
                combined.add(iter.next());
                if (matchExists) {
                    combined.add(Integer.valueOf(matcher.getMatch().group(1)));
                }
            }
        }
        if (matcher.contains(input, templatePattern)) {
            combined.add(Integer.valueOf(matcher.getMatch().group(1)));
        }
        return combined.toArray();
    }
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

        setVariables(variables);
        this.regexMatch = regexMatch;
    }

    public JMeterProperty transformValue(JMeterProperty prop) throws InvalidVariableException {
        PatternMatcher pm = JMeterUtils.getMatcher();
        Pattern pattern = null;
        PatternCompiler compiler = new Perl5Compiler();
        Iterator<String> iter = getVariables().keySet().iterator();
        String input = prop.getStringValue();
        while (iter.hasNext()) {
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

            return;
        }
        List pieces = new ArrayList();
        List combined = new LinkedList();
        String rawTemplate = getTemplate();
        PatternMatcher matcher = (Perl5Matcher) localMatcher.get();
        Pattern templatePattern =
            patternCache.getPattern(
                "\\$(\\d+)\\$",
                Perl5Compiler.READ_ONLY_MASK & Perl5Compiler.SINGLELINE_MASK);
        log.debug("Pattern = " + templatePattern);
        log.debug("template = " + rawTemplate);
        Util.split(pieces, matcher, templatePattern, rawTemplate);
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
        Iterator iter = pieces.iterator();
        boolean startsWith = isFirstElementGroup(rawTemplate);
        log.debug(
            "template split into "
                + pieces.size()
                + " pieces, starts with = "
                + startsWith);
        while (iter.hasNext())
        {
            boolean matchExists = matcher.contains(input, templatePattern);
            if (startsWith)
            {
                if (matchExists)
                {
                    combined.add(new Integer(matcher.getMatch().group(1)));
                }
                combined.add(iter.next());
            }
            else
            {
                combined.add(iter.next());
                if (matchExists)
                {
                    combined.add(new Integer(matcher.getMatch().group(1)));
                }
            }
        }
        if (matcher.contains(input, templatePattern))
        {
            log.debug("Template does end with template pattern");
            combined.add(new Integer(matcher.getMatch().group(1)));
        }
        template = combined.toArray();
    }
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

        }

        List collectAllMatches = new ArrayList();
        try
        {
            PatternMatcher matcher = (PatternMatcher) localMatcher.get();
            String responseText = new String(previousResult.getResponseData());
            PatternMatcherInput input = new PatternMatcherInput(responseText);
            while (matcher.contains(input, searchPattern))
            {
                MatchResult match = matcher.getMatch();
                collectAllMatches.add(match);
            }
        }
        catch (NumberFormatException e)
        {
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

    private Object[] generateTemplate(String rawTemplate)
    {
        List pieces = new ArrayList();
        List combined = new LinkedList();
        PatternMatcher matcher = new Perl5Matcher();
        Util.split(pieces, new Perl5Matcher(), templatePattern, rawTemplate);
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
        Iterator iter = pieces.iterator();
        boolean startsWith = isFirstElementGroup(rawTemplate);
        while (iter.hasNext())
        {
            boolean matchExists = matcher.contains(input, templatePattern);
            if (startsWith)
            {
                if (matchExists)
                {
                    combined.add(new Integer(matcher.getMatch().group(1)));
                }
                combined.add(iter.next());
            }
            else
            {
                combined.add(iter.next());
                if (matchExists)
                {
                    combined.add(new Integer(matcher.getMatch().group(1)));
                }
            }
        }
        if (matcher.contains(input, templatePattern))
        {
            combined.add(new Integer(matcher.getMatch().group(1)));
        }
        return combined.toArray();
    }
View Full Code Here

Examples of org.apache.oro.text.regex.PatternMatcher

        }

        List collectAllMatches = new ArrayList();
        try
        {
            PatternMatcher matcher = (PatternMatcher) localMatcher.get();
            String responseText = new String(previousResult.getResponseData());
            PatternMatcherInput input = new PatternMatcherInput(responseText);
            while (matcher.contains(input, searchPattern))
            {
                MatchResult match = matcher.getMatch();
                collectAllMatches.add(match);
            }
        }
        catch (NumberFormatException e)
        {
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.