Examples of Perl5Matcher


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

      regexpPattern = compiler.compile(regexp);
    } catch (MalformedPatternException mpe) {
      throw new RuntimeException("Bad pattern: " + regexp);
    }

    Perl5Matcher eventMatcher = new Perl5Matcher();
    String line = null;
    getLogger().debug("tailing file: " + tailing);
    do {
      while ((line = bufferedReader.readLine()) != null) {
        if (eventMatcher.matches(line, regexpPattern)) {
          //build an event from the previous match (held in current map)
          LoggingEvent event = buildEvent();
          if (event != null) {
            if (passesExpression(event)) {
              doPost(event);
            }
          }
          currentMap.putAll(processEvent(eventMatcher.getMatch()));
        } else {
          //getLogger().debug("line doesn't match pattern - must be ")
          //may be an exception or additional message lines
          additionalLines.add(line);
        }
View Full Code Here

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

   */
  protected void initialize() {
   
    util = new Perl5Util();
    exceptionCompiler = new Perl5Compiler();
    exceptionMatcher = new Perl5Matcher();

    currentMap = new HashMap();
    additionalLines = new ArrayList();
    matchingKeywords = new ArrayList();
   
View Full Code Here

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

    {
        if (_compiler == null)
            _compiler = new Perl5Compiler();

        if (_matcher == null)
            _matcher = new Perl5Matcher();
    }
View Full Code Here

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

    private boolean validateFormat(String input, String pattern)
    {
        if (_compiler == null)
        {
            _compiler = new Perl5Compiler();
            _matcher = new Perl5Matcher();
            _compiledPatterns = new HashMap();
        }

        Pattern compiled = (Pattern) _compiledPatterns.get(pattern);
        if (compiled == null)
View Full Code Here

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

        public boolean matches(String input) {
            if (input == null) {
                throw new NullPointerException();
            }
            return new Perl5Matcher().matches(input, pattern);
        }
View Full Code Here

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

     */
    public FTPFileListParserImpl(String regex)
    {
        try
        {
            _matcher_ = new Perl5Matcher();
            pattern   = new Perl5Compiler().compile(regex);
        }
        catch (MalformedPatternException e)
        {
            throw new IllegalArgumentException (
View Full Code Here

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

    {
        if (_compiler == null)
            _compiler = new Perl5Compiler();

        if (_matcher == null)
            _matcher = new Perl5Matcher();
    }
View Full Code Here

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

     */
    private JMeterTreeNode target;
   
    public ProxyControl()
    {
        matcher = new Perl5Matcher();
        setPort(DEFAULT_PORT);
        setExcludeList(new HashSet());
        setIncludeList(new HashSet());
        setCaptureHttpHeaders(true); // maintain original behaviour
    }
View Full Code Here

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

        HTTPSamplerBase newLink,
        HTTPSamplerBase config)
        throws MalformedPatternException
    {
        boolean ok = true;
        Perl5Matcher matcher = (Perl5Matcher) localMatcher.get();
        PropertyIterator iter = config.getArguments().iterator();

        String query = null;
        try
        {
            query = JOrphanUtils.decode(newLink.getQueryString(),"UTF-8");
        }
        catch (UnsupportedEncodingException e)
        {
            // UTF-8 unsupported? You must be joking!
            log.error("UTF-8 encoding not supported!");
            throw new Error("Should not happen: "+e.toString());
        }

        if (query == null && config.getArguments().getArgumentCount() > 0)
        {
            return false;
        }
       
        while (iter.hasNext())
        {
            Argument item = (Argument) iter.next().getObjectValue();
            if (query.indexOf(item.getName() + "=") == -1)
            {
                if (!(ok =
                    ok
                        && matcher.contains(
                            query,
                            patternCache.getPattern(
                                item.getName(),
                                Perl5Compiler.READ_ONLY_MASK))))
                {
                    return false;
                }
            }
        }

        if (config.getDomain() != null
            && config.getDomain().length() > 0
            && !newLink.getDomain().equals(config.getDomain()))
        {
            if (!(ok =
                ok
                    && matcher.matches(
                        newLink.getDomain(),
                        patternCache.getPattern(
                            config.getDomain(),
                            Perl5Compiler.READ_ONLY_MASK))))
            {
                return false;
            }
        }

        if (!newLink.getPath().equals(config.getPath())
            && !matcher.matches(
                newLink.getPath(),
                patternCache.getPattern(
                    "[/]*" + config.getPath(),
                    Perl5Compiler.READ_ONLY_MASK)))
        {
            return false;
        }

        if (!(ok =
            ok
                && matcher.matches(
                    newLink.getProtocol(),
                    patternCache.getPattern(
                        config.getProtocol(),
                        Perl5Compiler.READ_ONLY_MASK))))
        {
View Full Code Here

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

    public static synchronized boolean isArgumentMatched(
        Argument arg,
        Argument patternArg)
        throws MalformedPatternException
    {
        Perl5Matcher matcher = (Perl5Matcher) localMatcher.get();
        return (
            arg.getName().equals(patternArg.getName())
                || matcher.matches(
                    arg.getName(),
                    patternCache.getPattern(
                        patternArg.getName(),
                        Perl5Compiler.READ_ONLY_MASK)))
            && (arg.getValue().equals(patternArg.getValue())
                || matcher.matches(
                    (String) arg.getValue(),
                    patternCache.getPattern(
                        (String) patternArg.getValue(),
                        Perl5Compiler.READ_ONLY_MASK)));
    }
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.