Examples of Perl5Util


Examples of org.apache.oro.text.perl.Perl5Util

            String userPat = getDelimittedRegexp("^" + word + "(\\." + word + ")*$");
            String domainPat =
                getDelimittedRegexp("^" + atom + "(\\." + atom + ")*$");
            String atomPat = getDelimittedRegexp("(" + atom + ")");

            Perl5Util matchEmailPat = new Perl5Util();
            Perl5Util matchUserPat = new Perl5Util();
            Perl5Util matchIPPat = new Perl5Util();
            Perl5Util matchDomainPat = new Perl5Util();
            Perl5Util matchAtomPat = new Perl5Util();
            Perl5Util matchAsciiPat = new Perl5Util();

            boolean ipAddress = false;
            boolean symbolic = false;

            if (!matchAsciiPat.match(legalAsciiPat, value)) {
                return false;
            }

            // Check the whole email address structure
            bValid = matchEmailPat.match(emailPat, value);
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

     *  <tr><td>p4.user</td><td>User</td></tr>
     *  </table>
     */
    public void init() {

        util = new Perl5Util();

        //Get default P4 settings from environment - Mark would have done something cool with
        //introspection here.....:-)
        String tmpprop;
        if ((tmpprop = getProject().getProperty("p4.port")) != null) {
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

        failOnError = fail;
    }

    public void init() {

        util = new Perl5Util();

        //Get default P4 settings from environment - Mark would have done something cool with
        //introspection here.....:-)
        String tmpprop;
        if ((tmpprop = project.getProperty("p4.port")) != null) {
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

        String output = p4change.backslash(input);
        assertEquals("comment with a \\/ inside", output);
    }

    public void testSubstitute(){
        Perl5Util util = new Perl5Util();
        String tosubstitute = "xx<here>xx";
        String input = p4change.backslash("/a/b/c/");
        String output = util.substitute("s/<here>/" + input + "/", tosubstitute);
        assertEquals("xx/a/b/c/xx", output);
    }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

        if ( email == null )
        {
            return false;
        }

        Perl5Util matchAsciiPat = new Perl5Util();
        if ( !matchAsciiPat.match( LEGAL_ASCII_PATTERN, email ) )
        {
            return false;
        }

        // Check the whole email address structure
        Perl5Util emailMatcher = new Perl5Util();
        if ( !emailMatcher.match( EMAIL_PATTERN, email ) )
        {
            return false;
        }

        if ( email.endsWith( "." ) )
        {
            return false;
        }

        if ( !isValidUser( emailMatcher.group( 1 ) ) )
        {
            return false;
        }

        if ( !isValidDomain( emailMatcher.group( 2 ) ) )
        {
            return false;
        }

        return true;
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

     * Returns true if the domain component of an email address is valid.
     */
    protected boolean isValidDomain( String domain )
    {
        boolean symbolic = false;
        Perl5Util ipAddressMatcher = new Perl5Util();

        if ( ipAddressMatcher.match( IP_DOMAIN_PATTERN, domain ) )
        {
            if ( !isValidIpAddress( ipAddressMatcher ) )
            {
                return false;
            }
        }
        else
        {
            // Domain is symbolic name
            Perl5Util domainMatcher = new Perl5Util();
            symbolic = domainMatcher.match( DOMAIN_PATTERN, domain );
        }

        if ( symbolic )
        {
            if ( !isValidSymbolicDomain( domain ) )
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    /**
     * Returns true if the user component of an email address is valid.
     */
    protected boolean isValidUser( String user )
    {
        Perl5Util userMatcher = new Perl5Util();
        return userMatcher.match( USER_PATTERN, user );
    }
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

    protected boolean isValidSymbolicDomain( String domain )
    {
        String[] domainSegment = new String[10];
        boolean match = true;
        int i = 0;
        Perl5Util atomMatcher = new Perl5Util();

        while ( match )
        {
            match = atomMatcher.match( ATOM_PATTERN, domain );
            if ( match )
            {
                domainSegment[i] = atomMatcher.group( 1 );
                int l = domainSegment[i].length() + 1;
                domain =
                    ( l >= domain.length() )
                    ? ""
                    : domain.substring( l );
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

            return true;
        }

        value = replace( value, " ", "%20" );

        Perl5Util matchUrlPat = new Perl5Util();
        Perl5Util matchAsciiPat = new Perl5Util();

        if ( !matchAsciiPat.match( LEGAL_ASCII_PATTERN, value ) )
        {
            return false;
        }

        // Check the whole url address structure
View Full Code Here

Examples of org.apache.oro.text.perl.Perl5Util

        if ( scheme == null )
        {
            return false;
        }

        Perl5Util schemeMatcher = new Perl5Util();
        if ( !schemeMatcher.match( SCHEME_PATTERN, scheme ) )
        {
            return false;
        }

        if ( this.options.isOff( ALLOW_ALL_SCHEMES ) )
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.