Package org.apache.oro.text.regex

Examples of org.apache.oro.text.regex.Perl5Compiler


    public void afterPropertiesSet() throws Exception {
        Assert.notNull(userDetailsService, "An authenticationDao must be set");
        Assert.notNull(this.messages, "A message source must be set");

        Perl5Compiler compiler = new Perl5Compiler();

        try {
            subjectDNPattern = compiler.compile(subjectDNRegex,
                    Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK);
        } catch (MalformedPatternException mpe) {
            throw new IllegalArgumentException("Malformed regular expression: " + subjectDNRegex);
        }
    }
View Full Code Here


    //~ Methods ========================================================================================================

    public void addSecureUrl(String perl5RegExp, ConfigAttributeDefinition attr) {
        Pattern compiledPattern;
        Perl5Compiler compiler = new Perl5Compiler();

        try {
            compiledPattern = compiler.compile(perl5RegExp, Perl5Compiler.READ_ONLY_MASK);
        } catch (MalformedPatternException mpe) {
            throw new IllegalArgumentException("Malformed regular expression: " + perl5RegExp);
        }

        requestMap.add(new EntryHolder(compiledPattern, attr));
View Full Code Here

    {
        String sql = createTestDatabase(COLUMN_TEST_SCHEMA);

        // Since we have no way of knowing the auto-generated variables in the SQL,
        // we simply try to extract it from the SQL
        Pattern        declarePattern    = new Perl5Compiler().compile("DECLARE @([\\S]+) [^@]+@([\\S]+)");
        PatternMatcher matcher           = new Perl5Matcher();
        String         tableNameVar      = "tablename";
        String         constraintNameVar = "constraintname";

        if (matcher.contains(sql, declarePattern))
View Full Code Here

    {
        String sql = createTestDatabase(COLUMN_CONSTRAINT_TEST_SCHEMA);

        // Since we have no way of knowing the auto-generated variables in the SQL,
        // we simply try to extract it from the SQL
        Pattern        declarePattern    = new Perl5Compiler().compile("DECLARE @([\\S]+) [^@]+@([\\S]+)");
        PatternMatcher matcher           = new Perl5Matcher();
        String         tableNameVar      = "tablename";
        String         constraintNameVar = "constraintname";

        if (matcher.contains(sql, declarePattern))
View Full Code Here

    {
        String sql = createTestDatabase(TABLE_CONSTRAINT_TEST_SCHEMA);

        // Since we have no way of knowing the auto-generated variables in the SQL,
        // we simply try to extract it from the SQL
        Pattern             declarePattern     = new Perl5Compiler().compile("DECLARE @([\\S]+) [^@]+@([\\S]+)");
        PatternMatcherInput input              = new PatternMatcherInput(sql);
        PatternMatcher      matcher            = new Perl5Matcher();
        String[]            tableNameVars      = { "tablename", "tablename", "tablename" };
        String[]            constraintNameVars = { "constraintname", "constraintname", "constraintname" };
View Full Code Here

    {
        String sql = createTestDatabase(COLUMN_CHAR_SEQUENCES_TO_ESCAPE);

        // Since we have no way of knowing the auto-generated variables in the SQL,
        // we simply try to extract it from the SQL
        Pattern        declarePattern    = new Perl5Compiler().compile("DECLARE @([\\S]+) [^@]+@([\\S]+)");
        PatternMatcher matcher           = new Perl5Matcher();
        String         tableNameVar      = "tablename";
        String         constraintNameVar = "constraintname";

        if (matcher.contains(sql, declarePattern))
View Full Code Here

        super(platform);
        setDefaultCatalogPattern(null);
        setDefaultSchemaPattern(null);
        setDefaultTablePattern("%");

        PatternCompiler compiler = new Perl5Compiler();

      try
      {
            _isoDatePattern = compiler.compile("'(\\d{4}\\-\\d{2}\\-\\d{2})'");
            _isoTimePattern = compiler.compile("'(\\d{2}:\\d{2}:\\d{2})'");
        }
      catch (MalformedPatternException ex)
        {
          throw new DdlUtilsException(ex);
        }
View Full Code Here

        }

        // compile splitpattern
        Element splitElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "split", true);
        String patternString = DomHelper.getAttribute(splitElement, "pattern");
        Perl5Compiler compiler = new Perl5Compiler();
        Pattern pattern = null;
        try {
            pattern = compiler.compile(patternString, Perl5Compiler.READ_ONLY_MASK);
        } catch (MalformedPatternException e) {
            throw new Exception("Invalid regular expression at " + DomHelper.getLocation(splitElement) + ": " + e.getMessage());
        }
        definition.setSplitPattern(pattern, patternString);
View Full Code Here

        RegExpValidationRule rule = new RegExpValidationRule();

        String regexp = DomHelper.getAttribute(validationRuleElement, "pattern");
        buildFailMessage(validationRuleElement, rule);

        Perl5Compiler compiler = new Perl5Compiler();
        Pattern pattern = null;
        try {
            pattern = compiler.compile(regexp, Perl5Compiler.READ_ONLY_MASK);
        } catch (MalformedPatternException e) {
            throw new Exception("Invalid regular expression at " + DomHelper.getLocation(validationRuleElement) + ": " + e.getMessage());
        }
        rule.setPattern(regexp, pattern);
View Full Code Here

  /**
   * Creates a new date converter object.
   */
  public DateConverter()
  {
        PatternCompiler compiler = new Perl5Compiler();

        try
        {
            _datePattern = compiler.compile("(\\d{2,4})(?:\\-(\\d{2}))?(?:\\-(\\d{2}))?.*");
        }
        catch (MalformedPatternException ex)
        {
            throw new DdlUtilsException(ex);
        }
View Full Code Here

TOP

Related Classes of org.apache.oro.text.regex.Perl5Compiler

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.