Examples of Matcher

  • net.fortytwo.twitlogic.syntax.Matcher
    two.net).
  • net.xeoh.plugins.diagnosis.local.util.conditions.matcher.Matcher
    @author Ralf Biedert
  • org.apache.cocoon.matching.Matcher
    @author Giacomo Pati @version CVS $Revision: 1.2.2.5 $ $Date: 2001/11/06 09:55:36 $
  • org.apache.fop.fonts.FontTriplet.Matcher
  • org.apache.ivy.plugins.matcher.Matcher
    An interface that defines a string matcher.
  • org.apache.mailet.Matcher
    This interface define the behaviour of the message "routing" inside the mailet container. The match(Mail) method returns a Collection of recipients that meet this class's criteria.

    An important feature of the mailet container is the ability to fork processing of messages. When a message first arrives at the server, it might have multiple recipients specified. As a message is passed to a matcher, the matcher might only "match" one of the listed recipients. It would then return only the matching recipient in the Collection. The mailet container should then duplicate the message splitting the recipient list across the two messages as per what the matcher returned.

    [THIS PARAGRAPH NOT YET IMPLEMENTED] The matcher can extend this forking to further separation by returning a Collection of Collection objects. This allows a matcher to fork multiple processes if there are multiple recipients that require separate processing. For example, we could write a ListservMatcher that handles multiple listservs. When someone cross-posts across multiple listservs that this matcher handles, it could put each listserv address (recipient) that it handles in a separate Collection object. By returning each of these Collections within a container Collection object, it could indicate to the mailet container how many forks to spawn.

    This interface defines methods to initialize a matcher, to match messages, and to remove a matcher from the server. These are known as life-cycle methods and are called in the following sequence:

    1. The matcher is constructed, then initialized with the init method.
    2. Any calls from clients to the match method are handled.
    3. The matcher is taken out of service, then destroyed with the destroy method, then garbage collected and finalized.
    In addition to the life-cycle methods, this interface provides the getMatcherConfig method, which the matcher can use to get any startup information, and the getMatcherInfo method, which allows the matcher to return basic information about itself, such as author, version, and copyright. @version 1.0.0, 24/04/1999 @author Federico Barbieri @author Serge Knystautas
  • org.apache.tika.sax.xpath.Matcher
    XPath element matcher. A matcher instance encapsulates a specific state in XPath evaluation.
  • org.gocha.text.regex.Matcher
    Результат совпадения шаблона @author gocha
  • org.gwt.mosaic.core.client.util.regex.Matcher
    @author georgopoulos.georgios(at)gmail.com
  • org.hamcrest.Matcher
    A matcher over acceptable values. A matcher is able to describe itself to give feedback when it fails.

    Matcher implementations should NOT directly implement this interface. Instead, extend the {@link BaseMatcher} abstract class,which will ensure that the Matcher API can grow to support new features and remain compatible with all Matcher implementations.

    For easy access to common Matcher implementations, use the static factory methods in {@link CoreMatchers}. @see CoreMatchers @see BaseMatcher

  • org.infinispan.objectfilter.Matcher
    @author anistor@redhat.com @since 7.0
  • org.jbehave.core.mock.Matcher
    Represents a matcher on a method argument. @author Dan North
  • org.jbpm.pvm.internal.type.Matcher
  • org.jbpm.pvm.type.Matcher
  • org.joni.Matcher
  • org.jregex.Matcher
    Matcher instance is an automaton that actually performs matching. It provides the following methods:
  • searching for a matching substrings : matcher.find() or matcher.findAll();
  • testing whether a text matches a whole pattern : matcher.matches();
  • testing whether the text matches the beginning of a pattern : matcher.matchesPrefix();
  • searching with custom options : matcher.find(int options)

    Obtaining results
    After the search succeded, i.e. if one of above methods returned true one may obtain an information on the match:

  • may check whether some group is captured : matcher.isCaptured(int);
  • may obtain start and end positions of the match and its length : matcher.start(int),matcher.end(int),matcher.length(int);
  • may obtain match contents as String : matcher.group(int).
    The same way can be obtained the match prefix and suffix information. The appropriate methods are grouped in MatchResult interface, which the Matcher class implements.
    Matcher objects are not thread-safe, so only one thread may use a matcher instance at a time. Note, that Pattern objects are thread-safe(the same instanse may be shared between multiple threads), and the typical tactics in multithreaded applications is to have one Pattern instance per expression(a singleton), and one Matcher object per thread.
  • org.kitesdk.morphline.shaded.com.google.code.regexp.Matcher
    An engine that performs match operations on a character sequence by interpreting a {@link Pattern}. This is a wrapper for {@link java.util.regex.Matcher}. @since 0.1.9
  • org.modeshape.jcr.sequencer.SequencerPathExpression.Matcher
  • org.netbeans.server.componentsmatch.Matcher
    @author Jindrich Sedek
  • org.openstreetmap.osmosis.tagtransform.Matcher
  • org.parboiled.matchers.Matcher
    A Matcher instance is responsible for "executing" a specific Rule instance, i.e. it implements the actual rule type specific matching logic. Since it extends the {@link GraphNode} interface it can have submatchers.
  • org.shiftone.jrat.util.regex.Matcher
    @author $Author: jeffdrost $ @version $Revision: 1.4 $

  • Examples of java.util.regex.Matcher

            "title",
            "dn"
          };
          // magnet:?xt=urn:btih:WENBTYBB7676MQWJ7NLTD4NGYDKYSQPO&dn=[DmzJ][School_Days][Vol.01-06][DVDRip]
          for (String toMatch : titles) {
            Matcher matcher = Pattern.compile("[?&]" + toMatch + "=(.*)&?",
                Pattern.CASE_INSENSITIVE).matcher(url);
            if (matcher.find()) {
              return matcher.group(1);
            }
          }
         
          /*
           * If no 'title' field was found then just get the file name instead
    View Full Code Here

    Examples of java.util.regex.Matcher

       * @param filter range expression
       * @return list of matched DownloadManager objects
       */
      private List matchRange( List torrents, String filter )
      {
        Matcher matcher = rangePattern.matcher(filter);
        List list = new ArrayList();
        if( matcher.matches() )
        {
          int minId = Integer.parseInt(matcher.group(1));
          if( minId == 0 )
            throw new AzureusCoreException("lower range must be greater than 0");
          if( minId > torrents.size() )
            throw new AzureusCoreException("lower range specified (" + minId + ") is outside number of torrents (" + torrents.size() + ")");
          if( matcher.group(2) == null )
          {       
            // received a single number. eg: 3
            list.add(torrents.get(minId-1));
            return list;
          }
          int maxId;
          if( matcher.group(3) == null )
            // received bound range. eg: 3-5
            maxId = Integer.parseInt(matcher.group(5));
          else
            // received open ended range. eg: 3-
            maxId = torrents.size();
         
          if( minId > maxId )
    View Full Code Here

    Examples of java.util.regex.Matcher

        //       Restart doesn't include azureus.script.version yet, so we
        //       would normally prompt again.  This fix reads the version
        //       from the file if we don't have a version yet, thus preventing
        //       the second restart message
        if (version == 0) {
          Matcher matcher = pat.matcher(oldStartupScript);
          if (matcher.find()) {
            String sScriptVersion = matcher.group(1);
            try {
              version = Integer.parseInt(sScriptVersion);
            } catch (Throwable t) {
            }
          }
        }
       
        if (version <= lastAskedVersion) {
          return;
        }

        InputStream stream = getClass().getResourceAsStream("startupScript");
        try {
          String startupScript = FileUtil.readInputStreamAsString(stream, 65535,
              "utf8");
          Matcher matcher = pat.matcher(startupScript);
          if (matcher.find()) {
            String sScriptVersion = matcher.group(1);
            int latestVersion = 0;
            try {
              latestVersion = Integer.parseInt(sScriptVersion);
            } catch (Throwable t) {
            }
    View Full Code Here

    Examples of java.util.regex.Matcher

            File file = new File(confList[i]);
            if (file.isFile() && file.canRead()) {
              log("  checking " + file + " for GRE_PATH");
              String fileText = FileUtil.readFileAsString(file, 16384);
              if (fileText != null) {
                Matcher matcher = pat.matcher(fileText);
                if (matcher.find()) {
                  String possibleGrePath = matcher.group(1);
                  if (isValidGrePath(new File(possibleGrePath))) {
                    grePath = possibleGrePath;
                    break;
                  }
                }
    View Full Code Here

    Examples of java.util.regex.Matcher

      }
     
      public static String expandValue(String value) {
        // Replace {*} with a lookup of *
        if (value != null && value.indexOf('}') > 0) {
          Matcher matcher = PAT_PARAM_ALPHA.matcher(value);
          while (matcher.find()) {
            String key = matcher.group(1);
            try {
              String text = getResourceBundleString(key);
              if (text != null) {
                value = value.replaceAll("\\Q{" + key + "}\\E", text);
              }
    View Full Code Here

    Examples of java.util.regex.Matcher

              String startIp = null;
              String endIp = null;
              int level = 0;

              if (parseMode <= 0 || parseMode == 1) {
                Matcher matcher = pattern.matcher(line);
                if (matcher.find()) {
                  if (parseMode != 1) {
                    parseMode = 1;
                  }
                  description = matcher.group(1);
                  startIp = matcher.group(2);
                  endIp = matcher.group(3);
                } else {
                  Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                      "unrecognized line while reading ip filter: " + line));
                }
              }
    View Full Code Here

    Examples of java.util.regex.Matcher

      {
        StringBuffer sb = new StringBuffer();
        sb.append(comp.getSequence());
        List ret = new ArrayList();

        Matcher m = urlPattern.matcher(sb);
        int txtStart = 0;
        while(m.find())
        {
          int urlStart = m.start();
          int urlEnd = m.end();
          if(txtStart <= urlStart - 1)
            ret.add(new TextComponent(sb.substring(txtStart, urlStart)));
          String linkText = sb.substring(urlStart, urlEnd);
          try
          {
    View Full Code Here

    Examples of java.util.regex.Matcher

        }
        return UnmodifiableList.create(ret);
      }
     
      private static AbstractCanvasObject createPath(Element elt) {
        Matcher patt = PATH_REGEX.matcher(elt.getAttribute("d"));
        List<String> tokens = new ArrayList<String>();
        int type = -1; // -1 error, 0 start, 1 curve, 2 polyline
        while (patt.find()) {
          String token = patt.group();
          tokens.add(token);
          if (Character.isLetter(token.charAt(0))) {
            switch (token.charAt(0)) {
            case 'M':
              if (type == -1) type = 0;
    View Full Code Here

    Examples of java.util.regex.Matcher

      {
        StringBuffer sb = new StringBuffer();
        sb.append(comp.getSequence());
        List ret = new ArrayList();

        Matcher m = urlPattern.matcher(sb);
        int txtStart = 0;
        while(m.find())
        {
          int urlStart = m.start();
          int urlEnd = m.end();
          if(txtStart <= urlStart - 1)
            ret.add(new TextComponent(sb.substring(txtStart, urlStart)));
          String linkText = sb.substring(urlStart, urlEnd);
          try
          {
    View Full Code Here

    Examples of java.util.regex.Matcher

        List ret = new ArrayList();
        StringBuffer sb = new StringBuffer();
        sb.append(comp.getSequence());

        Matcher m = fontColorPattern.matcher(sb);
        int txtStart = 0;
        while(m.find())
        {
          int txtEnd = m.end();
          if(txtStart < txtEnd)
          {
            String text = sb.substring(txtStart, txtEnd);
            ret.add(new TextComponent(text, currentFont, currentColor));
          }
          txtStart = txtEnd;

          String fontFace = m.group(3);
          String fontSize = m.group(4);
          String colorCodeStr = m.group(7);
          String colorStr = m.group(9);

          if(fontFace != null)
            currentFont = new Font(fontFace, currentFontStyle, currentFontSize);
          if(fontSize != null)
          {
    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.