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 fitnesse.wikitext.parser.Matcher

        /**
         * ctor.
         */
        public SvgImage() {
            super("SVG-Image");
            wikiMatcher(new Matcher().string("!svg"));
            htmlTranslation(this);
            wikiRule(this);
        }
    View Full Code Here

    Examples of java.util.regex.Matcher

        String pre = "\\$\\{";
        String post = "\\}";
        String regex = pre+"(.*?)"+post;
        Pattern pattern = Pattern.compile(regex);

        Matcher matcher = pattern.matcher(value);

        while (matcher.find()) {
          String sysKey = matcher.group(1);
          String p = pre + sysKey + post;
          String v = sysKey.equalsIgnoreCase("user.appdata") ? System.getenv("appdata") : System.getProperty(sysKey,"UNKNOWN");
         
          // We habe to replace '\' and '$' signs before replacement
          // see: http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Matcher.html#replaceAll(java.lang.String)
    View Full Code Here

    Examples of java.util.regex.Matcher

      }

      private SoftwareUpdateItem[] readSoftwareUpdateItems(BufferedReader reader, boolean onlyUpdates, boolean dragNdrop, PluginBaseInfo[] baseInfos) throws IOException {
        Pattern pluginTypePattern = Pattern.compile("\\[(.*):(.*)\\]");
        Pattern keyValuePattern = Pattern.compile("(.+?)=(.*)");
        Matcher matcher;

        ArrayList<SoftwareUpdateItem> updateItems = new ArrayList<SoftwareUpdateItem>();
        //ArrayList<PluginsSoftwareUpdateItem> blockedItems = new ArrayList<PluginsSoftwareUpdateItem>(0);

        try {
          SoftwareUpdateItem curItem=null;
          String line=reader.readLine();

          while (line != null) {
            matcher=pluginTypePattern.matcher(line);
            if (matcher.find()) { // new plugin
              String type=matcher.group(1);
              String className=matcher.group(2);

              if ("plugin".equals(type)) {
                curItem=new PluginSoftwareUpdateItem(className);
              }
              else if ("dataservice".equals(type)) {
                curItem=new DataServiceSoftwareUpdateItem(className);
              }
              else if ("tvbrowser".equals(type)) {
                curItem=new TvbrowserSoftwareUpdateItem(className);
              }

              if (curItem==null) {
                throw new IOException("invalid software update file");
              }

              updateItems.add(curItem);
            }
            else {
              matcher=keyValuePattern.matcher(line);

              if (matcher.find()) { // new plugin
                String value = matcher.group(2);
                value = value.replaceAll("\\\\", ""); // fix wrong HTML encoding in plugin descriptions

                if(curItem != null) {
                  curItem.addProperty(matcher.group(1), value);
                }
              }
            }
            line=reader.readLine();
          }
    View Full Code Here

    Examples of java.util.regex.Matcher

            if (value.toLowerCase().indexOf(preFilter) < 0) {
              return false;
            }
          }
          // second step: regex search
          Matcher matcher = mPattern.matcher(value);
          return matcher.matches();
        }
      }
    View Full Code Here

    Examples of java.util.regex.Matcher

         * Mask the password of the connection url with ***
         * @param url the actual url
         * @return the masked url
         */
        public static String maskURLPassword(String url) {
            final Matcher urlMatcher = URL_PATTERN.matcher(url);
            String maskUrl;
            if (urlMatcher.find()) {
                final Matcher pwdMatcher = PASSWORD_PATTERN.matcher(url);
                maskUrl = pwdMatcher.replaceFirst("\":***@\"");
                return maskUrl;
            }
            return url;
        }
    View Full Code Here

    Examples of java.util.regex.Matcher

        public static String methodNameToAttributeName(String methodName) {
            methodName=methodName.startsWith("get") || methodName.startsWith("set")? methodName.substring(3): methodName;
            methodName=methodName.startsWith("is")? methodName.substring(2) : methodName;
            // Pattern p=Pattern.compile("[A-Z]+");
            Matcher m=METHOD_NAME_TO_ATTR_NAME_PATTERN.matcher(methodName);
            StringBuffer sb=new StringBuffer();
            while(m.find()) {
                int start=m.start(), end=m.end();
                String str=methodName.substring(start, end).toLowerCase();
                if(str.length() > 1) {
                    String tmp1=str.substring(0, str.length() -1);
                    String tmp2=str.substring(str.length() -1);
                    str=tmp1 + "_" + tmp2;
                }
                if(start == 0) {
                    m.appendReplacement(sb, str);
                }
                else
                    m.appendReplacement(sb, "_" + str);
            }
            m.appendTail(sb);
            return sb.toString();
        }
    View Full Code Here

    Examples of java.util.regex.Matcher


        public static String attributeNameToMethodName(String attr_name) {
            if(attr_name.contains("_")) {
                // Pattern p=Pattern.compile("_.");
                Matcher m=ATTR_NAME_TO_METHOD_NAME_PATTERN.matcher(attr_name);
                StringBuffer sb=new StringBuffer();
                while(m.find()) {
                    m.appendReplacement(sb, attr_name.substring(m.end() - 1, m.end()).toUpperCase());
                }
                m.appendTail(sb);
                char first=sb.charAt(0);
                if(Character.isLowerCase(first)) {
                    sb.setCharAt(0, Character.toUpperCase(first));
                }
                return sb.toString();
    View Full Code Here

    Examples of java.util.regex.Matcher

                  .getIterator(HTML.Tag.CONTENT); it.isValid(); it.next()) {
                try {
                  String fragment = document.getText(it.getStartOffset(), it
                      .getEndOffset()
                      - it.getStartOffset());
                  Matcher matcher = pattern.matcher(fragment);
                  while (matcher.find()) {
                    highlighter.addHighlight(it.getStartOffset() + matcher.start(),
                        it.getStartOffset() + matcher.end(), painter);
                  }
                } catch (BadLocationException ex) {
                }
              }
            }
    View Full Code Here

    Examples of java.util.regex.Matcher

         * Method for validating event strings against event string specifications, where a
         * specification is a regular expression involving event symbols. e.g. [b]([sgv])[u]
         */
        protected static boolean validateEventString(String eventString, String spec) {
            Pattern pattern = null;
            Matcher matcher = null;

            // set up the regular expression specification
            pattern = Pattern.compile(spec);
            // set up the actual event string
            matcher = pattern.matcher(eventString);

            // check if the actual string satisfies the specification
            if (matcher.find()) {
                // a match has been found, but we need to check that the whole event string
                // matches, and not just a substring
                if (!(matcher.start() == 0 && matcher.end() == eventString.length())) {
                    // match on full eventString not found
                    System.err
                                    .println("event string invalid (proper substring matched): event string = "
                                                    + eventString
                                                    + ", specification = "
                                                    + spec
                                                    + "matcher.start() "
                                                    + matcher.start()
                                                    + " matcher.end() " + matcher.end());
                    return false;
                }
            } else {
                return false;
            }
    View Full Code Here

    Examples of java.util.regex.Matcher

        Pattern p = Pattern.compile("get([A-Z]\\w+)");
       
        for (int i = 0; i < m.length; i++) {
          if (m[i].getName().equals("getClass")) continue;
          if (m[i].getParameterTypes().length > 0) continue;
          Matcher r = p.matcher(m[i].getName());
          if (r.matches()) {
            try {
              values.put(r.group(1).toLowerCase(), m[i].invoke(bean, new Object[0]));
            } catch (IllegalArgumentException e) {
              throw e;
            } catch (IllegalAccessException e) {
              throw new RuntimeException(e);
            } catch (InvocationTargetException 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.