Package org.apache.oro.text.regex

Examples of org.apache.oro.text.regex.PatternMatcher.matches()


            validationError = null;
   
            if (enteredValue != null) {
                // try to split it
                PatternMatcher matcher = new Perl5Matcher();
                if (matcher.matches(enteredValue, aggregateDefinition.getSplitPattern())) {
                    MatchResult matchResult = matcher.getMatch();
                    Iterator iterator = aggregateDefinition.getSplitMappingsIterator();
                    while (iterator.hasNext()) {
                        SplitMapping splitMapping = (SplitMapping)iterator.next();
                        String result = matchResult.group(splitMapping.getGroup());
View Full Code Here


        return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.string.regexp", new String[] {regexp}, Constants.I18N_CATALOGUE));
    }
   
    private boolean matchesRegExp(String string) {
        PatternMatcher matcher = new Perl5Matcher();
        return matcher.matches(string, pattern);
    }
   
    void setPattern(String regexp, Pattern pattern) {
        this.regexp = regexp;
      this.pattern = pattern;
View Full Code Here

          // Sybase maintains the default values for DATE/TIME jdbc types, so we have to
          // migrate the default value to TIMESTAMP
          PatternMatcher matcher   = new Perl5Matcher();
          Timestamp      timestamp = null;
   
          if (matcher.matches(column.getDefaultValue(), _isoDatePattern))
          {
            timestamp = new Timestamp(Date.valueOf(matcher.getMatch().group(1)).getTime());
          }
          else if (matcher.matches(column.getDefaultValue(), _isoTimePattern))
          {
View Full Code Here

   
          if (matcher.matches(column.getDefaultValue(), _isoDatePattern))
          {
            timestamp = new Timestamp(Date.valueOf(matcher.getMatch().group(1)).getTime());
          }
          else if (matcher.matches(column.getDefaultValue(), _isoTimePattern))
          {
            timestamp = new Timestamp(Time.valueOf(matcher.getMatch().group(1)).getTime());
          }
          if (timestamp != null)
          {
View Full Code Here

      if (column.getDefaultValue() != null)
      {
        PatternMatcher matcher   = new Perl5Matcher();
        Timestamp      timestamp = null;
 
        if (matcher.matches(column.getDefaultValue(), _oracleIsoTimestampPattern))
        {
          String timestampVal = matcher.getMatch().group(1);

          timestamp = Timestamp.valueOf(timestampVal);
        }
View Full Code Here

        {
          String timestampVal = matcher.getMatch().group(1);

          timestamp = Timestamp.valueOf(timestampVal);
        }
        else if (matcher.matches(column.getDefaultValue(), _oracleIsoDatePattern))
        {
          String dateVal = matcher.getMatch().group(1);

          timestamp = new Timestamp(Date.valueOf(dateVal).getTime());
        }
View Full Code Here

        {
          String dateVal = matcher.getMatch().group(1);

          timestamp = new Timestamp(Date.valueOf(dateVal).getTime());
        }
        else if (matcher.matches(column.getDefaultValue(), _oracleIsoTimePattern))
        {
          String timeVal = matcher.getMatch().group(1);

          timestamp = new Timestamp(Time.valueOf(timeVal).getTime());
        }
View Full Code Here

      if (column.getTypeCode() == Types.TIME)
      {
        PatternMatcher matcher = new Perl5Matcher();

        // Db2 returns "HH24.MI.SS"
        if (matcher.matches(column.getDefaultValue(), _db2TimePattern))
        {
          StringBuffer newDefault = new StringBuffer();

          newDefault.append("'");
          // the hour
View Full Code Here

      else if (column.getTypeCode() == Types.TIMESTAMP)
      {
        PatternMatcher matcher = new Perl5Matcher();

        // Db2 returns "YYYY-MM-DD-HH24.MI.SS.FF"
        if (matcher.matches(column.getDefaultValue(), _db2TimestampPattern))
        {
          StringBuffer newDefault = new StringBuffer();

          newDefault.append("'");
          // group 1 is the date which has the correct format
View Full Code Here

  PatternCompiler compiler = new Perl5Compiler();
  PatternMatcher matcher = new Perl5Matcher();
 
  for (int i=0; i<raw_pat.length; i++) {
      try {
    if (matcher.matches(raw_pat[i], dec_pat)) {
        patterns[realsize] =
      compiler.compile(matcher.getMatch().group(1));
        substitutions[realsize] = matcher.getMatch().group(2);
        realsize++;
    }
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.