Examples of MatchResult


Examples of ai.test.comment.domains.MatchResult

//          if (var != null)
//            variablesMap.put(var.left, var.right);
          compare(commentEdge, cfgEdge);
        }
      }
      return new MatchResult(verticesMap, variablesMap);
    }
View Full Code Here

Examples of com.dotcms.repackage.org.apache.oro.text.regex.MatchResult

    String tb = template.getBody();
    Perl5Matcher matcher = (Perl5Matcher) localP5Matcher.get();
    String oldParse;
    String newParse;
      while(matcher.contains(tb, parseContainerPattern)){
         MatchResult match = matcher.getMatch();
        int groups = match.groups();
         for(int g=0;g<groups;g++){
           oldParse = match.group(g);
           if(matcher.contains(oldParse, oldContainerPattern)){
             MatchResult matchOld = matcher.getMatch();
             newParse = matchOld.group(0).trim();
             newParse = containerTag + newParse + "')";
             tb = StringUtil.replace(tb,oldParse,newParse);
           }
         }
         template.setBody(tb);
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

    throws XPathException {
        boolean ignoreDate = (value instanceof TimeValue);
        boolean ignoreTime = (value instanceof DateValue);
        DateTimeValue dtvalue = value.toDateTime();

        MatchResult matcher = componentPattern.exec(specifier.toString());
        if (matcher == null) {
            XPathException error = new XPathException("Unrecognized date/time component [" + specifier + ']');
            error.setErrorCode("XTDE1340");
            error.setXPathContext(context);
            throw error;
        }
        String component = matcher.getGroup(1);
        if (component == null) {
            component = "";
        }
        String format = matcher.getGroup(2);
        if (format==null) {
            format = "";
        }
        boolean defaultFormat = false;
        if ("".equals(format) || format.startsWith(",")) {
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

            RegExp.compile("[0-9]+"); // was [0-9]* but this always returned a match - java: "\\p{Nd}*"
    private static CharSequence formatNumber(String component, int value,
                                             String format, boolean defaultFormat, Numberer numberer, XPathContext context)
    throws XPathException {
        MatchResult matcher = formatPattern.exec(format);
        if (matcher == null) {
            XPathException error = new XPathException("Unrecognized format picture [" + component + format + ']');
            error.setErrorCode("XTDE1340");
            error.setXPathContext(context);
            throw error;
        }
        //String primary = matcher.group(1);
        //String modifier = matcher.group(2);      
        String primary = matcher.getGroup(1);
        if (primary == null) {
            primary = "";
        }

        String modifier = null;
        if (primary.endsWith("t")) {
            primary = primary.substring(0, primary.length()-1);
            modifier = "t";
        } else if (primary.endsWith("o")) {
            primary = primary.substring(0, primary.length()-1);
            modifier = "o";
        }
        String letterValue = ("t".equals(modifier) ? "traditional" : null);
        String ordinal = ("o".equals(modifier) ? numberer.getOrdinalSuffixForDateTime(component) : null);
        String widths = matcher.getGroup(2);
        if (widths == null) {
            widths = "";
        }
        if (!alphanumericPattern.test(primary)) {
            XPathException error = new XPathException("In format picture at '" + primary +
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

        try {
            int min = -1;
            int max = -1;

            if (!"".equals(widths)) {
                MatchResult widthMatcher = widthPattern.exec(widths);
                if (widthMatcher != null) {
                    String smin = widthMatcher.getGroup(1);
                    if (smin==null || "".equals(smin) || "*".equals(smin)) {
                        min = 1;
                    } else {
                        min = Integer.parseInt(smin);
                    }
                    String smax = widthMatcher.getGroup(3);
                    if (smax==null || "".equals(smax) || "*".equals(smax)) {
                        max = Integer.MAX_VALUE;
                    } else {
                        max = Integer.parseInt(smax);
                    }
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

    private static RegExp datePattern =
            RegExp.compile("\\-?([0-9]+)-([0-9][0-9])-([0-9][0-9])([-+Z].*)?");

    protected static ConversionResult setLexicalValue(GDateValue dt, CharSequence s) {
        String str = s.toString();
        MatchResult match = datePattern.exec(str);
        if (match == null) {
            return badDate("wrong format", str);
        }
        dt.year = DurationValue.simpleInteger(match.getGroup(1));
        if (str.startsWith("-")) {
          dt.year = dt.year - 1; // no year zero in lexical space for XSD 1.0 - so -1 becomes 0 and -2 becomes -1 etc.
            dt.year = -dt.year;
        }
        dt.month = DurationValue.simpleInteger(match.getGroup(2));
        dt.day = DurationValue.simpleInteger(match.getGroup(3));
        String tz = match.getGroup(4);
        int tzmin = parseTimezone(tz);
        if (tzmin == BAD_TIMEZONE) {
            return badDate("invalid timezone", str);
        }
        dt.setTimezoneInMinutes(tzmin);
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

        if (zone==null || zone.isEmpty()) {
            return NO_TIMEZONE;
        } else if (zone.equals("Z")) {
            return 0;
        } else {
            MatchResult match = timezonePattern.exec(zone);
            if (match == null) {
                return BAD_TIMEZONE;
            }
            int h = DurationValue.simpleInteger(match.getGroup(1));
            int m = DurationValue.simpleInteger(match.getGroup(2));
            if (h > 14 || (h == 14 && m > 0)) {
                return BAD_TIMEZONE;
            }
            int tz = h*60 + m;
            if (zone.charAt(0) == '-') {
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

    private static RegExp timePattern =
            RegExp.compile("([0-9][0-9]):([0-9][0-9]):([0-9][0-9])(\\.[0-9]*)?([-+Z].*)?");

    public static ConversionResult makeTimeValue(CharSequence s) {
        String str = s.toString();
        MatchResult match = timePattern.exec(str);
        if (match == null) {
            return badTime("wrong format", str);
        }
        TimeValue dt = new TimeValue();
        dt.hour = DurationValue.simpleInteger(match.getGroup(1));
        dt.minute = DurationValue.simpleInteger(match.getGroup(2));
        dt.second = DurationValue.simpleInteger(match.getGroup(3));
        String frac = match.getGroup(4);
        if (frac != null && frac.length() > 0) {
            double fractionalSeconds = Double.parseDouble(frac);
            dt.microsecond = (int)(Math.round(fractionalSeconds * 1000000));
        }
        String tz = match.getGroup(5);
        int tzmin = parseTimezone(tz);
        if (tzmin == BAD_TIMEZONE) {
            return badTime("Invalid timezone", str);
        }
        dt.setTimezoneInMinutes(tzmin);
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

    private GYearValue(){}

    public static ConversionResult makeGYearValue(CharSequence value) {
        GYearValue g = new GYearValue();
        MatchResult m = regex.exec(Whitespace.trimWhitespace(value).toString());
        if (m == null) {
            return new ValidationFailure("Cannot convert '" + value + "' to a gYear");
        }
        String base = m.getGroup(1);
        String tz = m.getGroup(2);
        String date = (base==null ? "" : base) + "-01-01" + (tz==null ? "" : tz);
        g.typeLabel = BuiltInAtomicType.G_YEAR;
        return setLexicalValue(g, date);
    }
View Full Code Here

Examples of com.google.gwt.regexp.shared.MatchResult

    private GMonthValue(){}

    public static ConversionResult makeGMonthValue(CharSequence value) {
        GMonthValue g = new GMonthValue();
        MatchResult m = regex.exec(Whitespace.trimWhitespace(value).toString());
        if (m == null) {
            return new ValidationFailure("Cannot convert '" + value + "' to a gMonth");
        }
        String base = m.getGroup(1);
        String tz = m.getGroup(2);
        String date = "2000-" + (base==null ? "" : base) + "-01" + (tz==null ? "" : tz);
        g.typeLabel = BuiltInAtomicType.G_MONTH;
        return setLexicalValue(g, date);
    }
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.