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

       {
          //jdbc:hsqldb:mem:jbosscache
          Properties toReturn = (Properties) realProps.clone();
          String jdbcUrl = toReturn.getProperty("cache.jdbc.url");
          Pattern pattern = Pattern.compile("jbosscache");
          Matcher matcher = pattern.matcher(jdbcUrl);
          boolean found = matcher.find();
          assert found;
          String newJdbcUrl = matcher.replaceFirst(extractTestName() + userIndex.incrementAndGet());
          toReturn.put("cache.jdbc.url", newJdbcUrl);
          return toReturn;
       }
    View Full Code Here

    Examples of java.util.regex.Matcher

                    parentFile = new File(folder);
                }
                parentFile.mkdirs();
                Pattern p = Pattern.compile("class ([a-zA-Z0-9]+)");
                for (String model : models) {
                    Matcher m = p.matcher(model);
                    if (m.find()) {
                        String className = m.group().substring("class".length()).trim();
                        File classFile = new File(parentFile, className + ".java");
                        Writer o = new FileWriter(classFile, false);
                        PrintWriter writer = new PrintWriter(new BufferedWriter(o));
                        writer.write(model);
                        writer.close();
    View Full Code Here

    Examples of java.util.regex.Matcher

        IOUtilities.pipeStreams(stream, bytes);

        String version = bytes.toString();

        Pattern p = Pattern.compile("Version:.*git(\\d{8}).*");
        Matcher match = p.matcher(version);

        if (match.find()) {
          if (Integer.parseInt(match.group(1)) >= WEBIF_MINIMUM_VERSION) {
            return true;
          }
        }

        return false;
    View Full Code Here

    Examples of java.util.regex.Matcher

       * @param type
       *          Collect TV or radio channel
       */
      private void gatherChannels(StringBuffer webPage, TopfieldServiceType type) {
        ArrayList<SatelliteInfo> satellites = new ArrayList<SatelliteInfo>();
        Matcher infoMatcher = Pattern.compile(String.format(INFO_CREATE_FORMAT, type)).matcher(webPage);
        while (infoMatcher.find()) {
          satellites.add(new SatelliteInfo(Integer.parseInt(infoMatcher.group(1)), Integer.parseInt(infoMatcher.group(2)),
              infoMatcher.group(4)));
        }
        for (SatelliteInfo info : satellites) {
          Matcher channelMatcher = Pattern.compile(String.format(INFO_CHANNEL_FORMAT, type, info.getIndex())).matcher(
              webPage);
          while (channelMatcher.find()) {
            int subIndex = Integer.parseInt(channelMatcher.group(1));
            int serviceIndex = Integer.parseInt(channelMatcher.group(2));
            Matcher serviceMatcher = Pattern.compile(String.format(INFO_SERVICE_FORMAT, type, info.getIndex(), subIndex))
                .matcher(webPage);
            Matcher tunerMatcher = Pattern.compile(String.format(INFO_TUNER_FORMAT, type, info.getIndex(), subIndex))
                .matcher(webPage);
            serviceMatcher.find();
            tunerMatcher.find();
            String serviceName = serviceMatcher.group(1);
            serviceName = serviceName.substring(serviceName.indexOf(" ") + 1);
            TopfieldServiceInfo serviceInfo = new TopfieldServiceInfo(serviceIndex, info.getName(), info.getIndex(),
                serviceName, Integer.parseInt(tunerMatcher.group(1)), type == TopfieldServiceType.TV);
            channels.add(serviceInfo);
          }
        }
      }
    View Full Code Here

    Examples of java.util.regex.Matcher

       *          The content of the new timer form
       * @param recordTime
       *          The time to modify
       */
      private void correctTime(StringBuffer formContent, ProgramTime recordTime) {
        Matcher timeMatcher = RECEIVER_ADD_TIME_PATTERN.matcher(formContent);
        if (timeMatcher.find()) {
          int receiverPreroll = Integer.parseInt(timeMatcher.group(1));
          int receiverPostroll = Integer.parseInt(timeMatcher.group(2));

          recordTime.addMinutesToStart(receiverPreroll);
          recordTime.addMinutesToEnd(receiverPostroll * -1);
        }
      }
    View Full Code Here

    Examples of java.util.regex.Matcher

       *           If the device could not be contacted
       */
      public void getTimerList() throws TopfieldConnectionException {
        ArrayList<TopfieldTimerEntry> timerList = new ArrayList<TopfieldTimerEntry>();
        StringBuffer content = readDeviceData(TIMER_LIST_PAGE);
        Matcher timerEntryMatcher = TIMER_ENTRY_PATTERN.matcher(content);
        while (timerEntryMatcher.find()) {
          if (timerEntryMatcher.group(2).equals("0")) {
            // This is a P-timer => skip it
            continue;
          }

          int entryNumber = Integer.parseInt(timerEntryMatcher.group(1));
          TopfieldServiceType type = TopfieldServiceType.createFromNumber(Integer.parseInt(timerEntryMatcher.group(3)));
          int serviceNumber = Integer.parseInt(timerEntryMatcher.group(6)) - 1;
          int tuner = Integer.parseInt(timerEntryMatcher.group(8));
          TopfieldTimerMode mode = TopfieldTimerMode.createFromNumber(Integer.parseInt(timerEntryMatcher.group(9)));
          int startDay = Integer.parseInt(timerEntryMatcher.group(10));
          int startMonth = Integer.parseInt(timerEntryMatcher.group(11));
          int startYear = Integer.parseInt(timerEntryMatcher.group(12));
          int startHour = Integer.parseInt(timerEntryMatcher.group(13));
          int startMinute = Integer.parseInt(timerEntryMatcher.group(14));
          int length = Integer.parseInt(timerEntryMatcher.group(15));
          String fileName = timerEntryMatcher.group(16);

          Calendar recordingStart = Calendar.getInstance();
          recordingStart.set(Calendar.DAY_OF_MONTH, startDay);
          recordingStart.set(Calendar.MONTH, startMonth - 1);
          recordingStart.set(Calendar.YEAR, startYear);
    View Full Code Here

    Examples of java.util.regex.Matcher

            HttpURLConnection con = (HttpURLConnection) url.openConnection();
            InputStream in = con.getInputStream();

            BufferedReader reader = new BufferedReader(new InputStreamReader(in));

            Matcher matcher;
            Pattern pattern = Pattern.compile("<tr><td>(\\d+):(\\d+)</td><td>(.*?)</td><td>(.*?)</td><td>(.*?)</td></tr>");

            String line = reader.readLine();
            while (line != null) {

                matcher = pattern.matcher(line);
                if (matcher.find()) {
                    // System.out.println("h: "+matcher.group(1)+"; m: "+matcher.group(2)+"; title: "+matcher.group(3)+"; short: "+matcher.group(4)+"; desc: "+matcher.group(5));
                    int h = Integer.parseInt(matcher.group(1));
                    int m = Integer.parseInt(matcher.group(2));
                    String title = matcher.group(3);
                    String shortInfo = matcher.group(4);
                    String description = matcher.group(5);

                    ProgramFrame frame = new ProgramFrame();
                    frame.addProgramField(ProgramField.create(ProgramFieldType.START_TIME_TYPE, h * 60 + m));
                    frame.addProgramField(ProgramField.create(ProgramFieldType.TITLE_TYPE, title));
                    frame.addProgramField(ProgramField.create(ProgramFieldType.SHORT_DESCRIPTION_TYPE, shortInfo));
    View Full Code Here

    Examples of java.util.regex.Matcher

          if (!this.failSilently) throw new IllegalArgumentException(
              "Block '" + blockName + "' not found." +
                  " Matches " + locateBlock(blockName));
        }
        Pattern pattern = Pattern.compile("\\{([\\w\\.]+)\\}");
        Matcher matcher = pattern.matcher(copy);
        pattern = Pattern.compile("_BLOCK_\\.(.+)");
        for (Matcher matcher2; matcher.find();)
        {
          String match = matcher.group(1);
          matcher2 = pattern.matcher(match);
          if (matcher2.find())
          {
            if (parsedBlocks.containsKey(matcher2.group(1)))
            {
    View Full Code Here

    Examples of java.util.regex.Matcher

          this.implicitMain  = true; // affects parse(block) and out()
          fileText = "<!-- BEGIN: main -->" + fileText + "<!-- END: main -->";
        }
        // END: implicit main
        Pattern pattern = Pattern.compile("<!--\\s*(BEGIN|END)\\s*:\\s*(\\w+)\\s*-->(.*?)(?=(?:<!--\\s*(?:BEGIN|END)\\s*:\\s*\\w+\\s*-->)|(?:\\s*$))", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
        Matcher matcher = pattern.matcher(fileText);
        ArrayList blockNames = new ArrayList();
        String parentName = "";
        int lastlength = 0; // used in newline trimming to see if one block immediately follows the previous
        while (matcher.find())
        {
          // BEGIN: newline trimming
          String after = matcher.group(3); // contents after tag
          if (lastlength == 0 || fileText.charAt(matcher.start() - 1) == '\n') {
            after = after.replaceFirst("^\\r?\\n", "");
          }
          lastlength = after.length();
          // END: newline trimming
          if (matcher.group(1).toUpperCase().equals("BEGIN"))
          {
            parentName = implode(blockNames);
            blockNames.add(matcher.group(2));
            String currentBlockName = implode(blockNames);
            if (blocks.containsKey(currentBlockName))
            {
              blocks.put(currentBlockName, blocks.get(currentBlockName) + after);
            }
            else
            {
              blocks.put(currentBlockName, after);
            }
            if (blocks.containsKey(parentName))
            {
              blocks.put(parentName, blocks.get(parentName) + "{_BLOCK_." + currentBlockName + "}");
            }
            else
            {
              blocks.put(parentName, "{_BLOCK_." + currentBlockName + "}");
            }
            subBlocks.put(parentName, currentBlockName);
            subBlocks.put(currentBlockName, "");
          }
          else if (matcher.group(1).toUpperCase().equals("END"))
          {
            blockNames.remove(blockNames.size()-1);
            parentName = implode(blockNames);
            if (blocks.containsKey(parentName))
            {
    View Full Code Here

    Examples of java.util.regex.Matcher

                    end = content.indexOf("- Tag type:", start);
                }
                if (end != -1) {
                    String resource = content.substring(start, end);
                    // extract  medium and line
                    Matcher matcher =Pattern.compile("\\(.*\\)").matcher(resource);
                    while (matcher.find()) {
                        String group = matcher.group();
                        String[] parts = group.split("\\) \\(");
                        if (parts.length == 2) {
                            warning.setMedium(parts[0].substring(1));
                            String line = parts[1].substring(0, parts[1].length()-1);
                            line = line.substring(line.indexOf(" ")).trim();
                            try {
                                warning.setLine(Integer.parseInt(line));
                            } catch (NumberFormatException e) {
                                warning.setLine(-1);
                            }
                        }
                    }
                    resource = resource.trim();
                    resource = resource.substring(0, resource.indexOf(" "));
                    warning.setResource(resource);
                }
               
                start = content.indexOf("- Context");
                end = -1;
                if (start != -1) {
                    start += "- Context".length();
                    end = content.indexOf("- Message:", start);
                }
                if (end != -1) {
                    String temp = content.substring(start, end);
                    // extract  medium and line
                    Matcher matcher =Pattern.compile("\\(.*\\)").matcher(temp);
                    if (matcher.find()) {
                        String group = matcher.group();
                        warning.setDb(group.substring(1, group.length()-1));
                    }
                }
               
                start = content.indexOf("- Message:");
    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.