ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text RegularExpression.java ReplaceRegExp.java
Date Sat, 12 Jan 2002 23:42:21 GMT
donaldp     02/01/12 15:42:21

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text
                        ReplaceRegExp.java
  Added:       proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text
                        RegularExpression.java
  Log:
  Regular expression moved to text package
  
  Revision  Changes    Path
  1.4       +1 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/ReplaceRegExp.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReplaceRegExp.java	4 Jan 2002 09:25:13 -0000	1.3
  +++ ReplaceRegExp.java	12 Jan 2002 23:42:21 -0000	1.4
  @@ -17,10 +17,9 @@
   import java.io.PrintWriter;
   import java.util.ArrayList;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.FileSet;
  -import org.apache.tools.ant.types.RegularExpression;
   import org.apache.tools.ant.util.regexp.Regexp;
   
   /**
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/text/RegularExpression.java
  
  Index: RegularExpression.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.tools.ant.taskdefs.text;
  
  import org.apache.myrmidon.api.TaskException;
  import org.apache.tools.ant.ProjectComponent;
  import org.apache.tools.ant.util.regexp.Regexp;
  import org.apache.tools.ant.util.regexp.RegexpFactory;
  
  /**
   * A regular expression datatype. Keeps an instance of the compiled expression
   * for speed purposes. This compiled expression is lazily evaluated (it is
   * compiled the first time it is needed). The syntax is the dependent on which
   * regular expression type you are using. The system property
   * "ant.regexp.regexpimpl" will be the classname of the implementation that will
   * be used. <pre>
   * For jdk  &lt;= 1.3, there are two available implementations:
   *   org.apache.tools.ant.util.regexp.JakartaOroRegexp (the default)
   *        Based on the jakarta-oro package
   *
   *   org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
   *        Based on the jakarta-regexp package
   *
   * For jdk &gt;= 1.4 an additional implementation is available:
   *   org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
   *        Based on the jdk 1.4 built in regular expression package.
   * </pre> <pre>
   *   &lt;regularexpression [ [id="id"] pattern="expression" | refid="id" ]
   *   /&gt;
   * </pre>
   *
   * @author Matthew Inger <a href="mailto:mattinger@mindless.com">
   *      mattinger@mindless.com</a>
   * @see org.apache.oro.regex.Perl5Compiler
   * @see org.apache.regexp.RE
   * @see java.util.regex.Pattern
   * @see org.apache.tools.ant.util.regexp.Regexp
   */
  public class RegularExpression
      extends ProjectComponent
  {
      // The regular expression factory
      private final static RegexpFactory factory = new RegexpFactory();
  
      private Regexp m_regexp;
  
      public RegularExpression()
          throws TaskException
      {
          m_regexp = factory.newRegexp();
      }
  
      public void setPattern( final String pattern )
          throws TaskException
      {
          m_regexp.setPattern( pattern );
      }
  
      /**
       * Gets the pattern string for this RegularExpression in the given project.
       */
      public String getPattern()
          throws TaskException
      {
          return m_regexp.getPattern();
      }
  
      public Regexp getRegexp()
      {
          return m_regexp;
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message