Package org.apache.xerces.impl.xpath.regex

Examples of org.apache.xerces.impl.xpath.regex.RegularExpression


      nvalue = normalize(content, fWhiteSpace);
    } else {
      nvalue = content.toString();
    }
    if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
      RegularExpression regex;
      for (int idx = fPattern.size()-1; idx >= 0; idx--) {
        regex = (RegularExpression)fPattern.elementAt(idx);
        if (!regex.matches(nvalue)){
          throw new InvalidDatatypeValueException("cvc-pattern-valid",
              new Object[]{content,
              fPatternStr.elementAt(idx),
             
              fTypeName});
View Full Code Here


*
* @author Kohsuke Kawaguchi
*/
final class XercesImpl extends RegExpFactory {
    public RegExp compile(String exp) throws ParseException {
        final RegularExpression re;

        try {
            re = new RegularExpression(exp,"X");
        } catch ( org.apache.xerces.impl.xpath.regex.ParseException e ) {
            throw new ParseException(e.getMessage(),e.getLocation());
        }

        return new RegExp() {
            public boolean matches(String text) {
                return re.matches(text);
            }
        };
    }
View Full Code Here

    if ((presentFacet & FACET_PATTERN) != 0) {
      if ((allowedFacet & FACET_PATTERN) == 0) {
        reportError("cos-applicable-facets", new Object[]{"pattern", fTypeName});
      } else {
        patternAnnotations = facets.patternAnnotations;
        RegularExpression regex = null;
        try {
          regex = new RegularExpression(facets.pattern, "X");
        } catch (Exception e) {
          reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
        }
        if (regex != null) {
          fPattern = new Vector();
View Full Code Here

      nvalue = normalize(content, fWhiteSpace);
    } else {
      nvalue = content.toString();
    }
    if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
      RegularExpression regex;
      for (int idx = fPattern.size()-1; idx >= 0; idx--) {
        regex = (RegularExpression)fPattern.elementAt(idx);
        if (!regex.matches(nvalue)){
          throw new InvalidDatatypeValueException("cvc-pattern-valid",
              new Object[]{content,
              fPatternStr.elementAt(idx),
             
              fTypeName});
View Full Code Here

        // pattern
        if ((presentFacet & FACET_PATTERN) != 0) {
            if ((allowedFacet & FACET_PATTERN) == 0) {
                reportError("cos-applicable-facets", new Object[]{"pattern"});
            } else {
                RegularExpression regex = null;
                try {
                    regex = new RegularExpression(facets.pattern, "X");
                } catch (Exception e) {
                    reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
                }
                if (regex != null) {
                    fPattern = new Vector();
View Full Code Here

                                                            new Object[]{nvalue, SPECIAL_TOKEN_STRING[fTokenType]});
                }
            }

            if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
                RegularExpression regex;
                for (int idx = fPattern.size()-1; idx >= 0; idx--) {
                    regex = (RegularExpression)fPattern.elementAt(idx);
                    if (!regex.matches(nvalue)){
                        throw new InvalidDatatypeValueException("cvc-pattern-valid",
                                                                new Object[]{content, regex});
                    }
                }
            }
View Full Code Here

    if ((presentFacet & FACET_PATTERN) != 0) {
      if ((allowedFacet & FACET_PATTERN) == 0) {
        reportError("cos-applicable-facets", new Object[]{"pattern", fTypeName});
      } else {
        patternAnnotations = facets.patternAnnotations;
        RegularExpression regex = null;
        try {
          regex = new RegularExpression(facets.pattern, "X");
        } catch (Exception e) {
          reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
        }
        if (regex != null) {
          fPattern = new Vector();
View Full Code Here

      nvalue = normalize(content, fWhiteSpace);
    } else {
      nvalue = content.toString();
    }
    if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
      RegularExpression regex;
      for (int idx = fPattern.size()-1; idx >= 0; idx--) {
        regex = (RegularExpression)fPattern.elementAt(idx);
        if (!regex.matches(nvalue)){
          throw new InvalidDatatypeValueException("cvc-pattern-valid",
              new Object[]{content,
              fPatternStr.elementAt(idx),
             
              fTypeName});
View Full Code Here

        // pattern
        if ((presentFacet & FACET_PATTERN) != 0) {
            if ((allowedFacet & FACET_PATTERN) == 0) {
                reportError("cos-applicable-facets", new Object[]{"pattern"});
            } else {
                RegularExpression regex = null;
                try {
                    regex = new RegularExpression(facets.pattern, "X");
                } catch (Exception e) {
                    reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
                }
                if (regex != null) {
                    fPattern = new Vector();
View Full Code Here

                                                            new Object[]{nvalue, SPECIAL_TOKEN_STRING[fTokenType]});
                }
            }

            if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
                RegularExpression regex;
                for (int idx = fPattern.size()-1; idx >= 0; idx--) {
                    regex = (RegularExpression)fPattern.elementAt(idx);
                    if (!regex.matches(nvalue)){
                        throw new InvalidDatatypeValueException("cvc-pattern-valid",
                                                                new Object[]{content, regex});
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.xerces.impl.xpath.regex.RegularExpression

Copyright © 2018 www.massapicom. 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.