Examples of GlobCompiler


Examples of org.apache.oro.text.GlobCompiler

        private Boolean exact;

        public GlobMatcher(String expression) throws PatternSyntaxException {
            this.expression = expression;
            try {
                pattern = new GlobCompiler().compile(expression);
            } catch (MalformedPatternException e) {
                throw new PatternSyntaxException(e.getMessage(), expression, 0);
            }
        }
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

    private static class GlobMatcher implements Matcher {
        private Pattern pattern;

        public GlobMatcher(String expression) throws PatternSyntaxException {
            try {
                pattern = new GlobCompiler().compile(expression);
            } catch (MalformedPatternException e) {
                throw new PatternSyntaxException(e.getMessage(), expression, 0);
            }
        }
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

    // FIXME: parsers should be pooled for better performance.
    @SuppressWarnings("unchecked")
    private void initialize()
    {
        PatternCompiler compiler         = new GlobCompiler();
        List<Pattern>   compiledpatterns;

        //
        //  We cache compiled patterns in the engine, since their creation is
        //  really expensive
        //
        compiledpatterns = (List<Pattern>)m_engine.getAttribute( INLINE_IMAGE_PATTERNS );

        if( compiledpatterns == null )
        {
            compiledpatterns = new ArrayList<Pattern>(20);
            Collection ptrns = getImagePatterns( m_engine );

            //
            //  Make them into Regexp Patterns.  Unknown patterns
            //  are ignored.
            //
            for( Iterator i = ptrns.iterator(); i.hasNext(); )
            {
                try
                {
                    compiledpatterns.add( compiler.compile( (String)i.next(),
                                                            GlobCompiler.DEFAULT_MASK|GlobCompiler.READ_ONLY_MASK ) );
                }
                catch( MalformedPatternException e )
                {
                    log.error("Malformed pattern in properties: ", e );
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

            if( value != null && 0 < value.length() && !STR_GLOBSTAR.equals( value ) )
            {
                try
                {
                    PatternCompiler pc = new GlobCompiler();

                    String[] ptrns = StringUtils.split( value, STR_COMMA );

                    result = new Pattern[ptrns.length];

                    for( int n = 0; n < ptrns.length; n++ )
                    {
                        result[n] = pc.compile( ptrns[n] );
                    }
                }
                catch( MalformedPatternException e )
                {
                    throw new PluginException( "Parameter " + name + " has a malformed pattern: " + e.getMessage() );
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

        if( s != null )
        {
            try
            {
                PatternCompiler pc = new GlobCompiler();

                String[] ptrns = StringUtils.split( s, "," );

                m_exclude = new Pattern[ptrns.length];

                for( int i = 0; i < ptrns.length; i++ )
                {
                    m_exclude[i] = pc.compile( ptrns[i] );
                }
            }
            catch( MalformedPatternException e )
            {
                throw new PluginException("Exclude-parameter has a malformed pattern: "+e.getMessage());
            }
        }

        // TODO: Cut-n-paste, refactor
        s = (String) params.get( PARAM_INCLUDE );

        if( s != null )
        {
            try
            {
                PatternCompiler pc = new GlobCompiler();

                String[] ptrns = StringUtils.split( s, "," );

                m_include = new Pattern[ptrns.length];

                for( int i = 0; i < ptrns.length; i++ )
                {
                    m_include[i] = pc.compile( ptrns[i] );
                }
            }
            catch( MalformedPatternException e )
            {
                throw new PluginException("Include-parameter has a malformed pattern: "+e.getMessage());
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

    private static class GlobMatcher implements Matcher {
        private Pattern _pattern;

        public GlobMatcher(String expression) throws PatternSyntaxException {
            try {
                _pattern = new GlobCompiler().compile(expression);
            } catch (MalformedPatternException e) {
                throw new PatternSyntaxException(e.getMessage(), expression, 0);
            }
        }
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

    private static class GlobMatcher implements Matcher {
        private Pattern _pattern;

        public GlobMatcher(String expression) throws PatternSyntaxException {
            try {
                _pattern = new GlobCompiler().compile(expression);
            } catch (MalformedPatternException e) {
                throw new PatternSyntaxException(e.getMessage(), expression, 0);
            }
        }
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

            if( value != null && 0 < value.length() && !STR_GLOBSTAR.equals( value ) )
            {
                try
                {
                    PatternCompiler pc = new GlobCompiler();

                    String[] ptrns = StringUtils.split( value, STR_COMMA );

                    result = new Pattern[ptrns.length];

                    for( int n = 0; n < ptrns.length; n++ )
                    {
                        result[n] = pc.compile( ptrns[n] );
                    }
                }
                catch( MalformedPatternException e )
                {
                    throw new PluginException( "Parameter " + name + " has a malformed pattern: " + e.getMessage() );
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

        if( s != null )
        {
            try
            {
                PatternCompiler pc = new GlobCompiler();

                String[] ptrns = StringUtils.split( s, "," );

                m_exclude = new Pattern[ptrns.length];

                for( int i = 0; i < ptrns.length; i++ )
                {
                    m_exclude[i] = pc.compile( ptrns[i] );
                }
            }
            catch( MalformedPatternException e )
            {
                throw new PluginException("Exclude-parameter has a malformed pattern: "+e.getMessage());
            }
        }

        // TODO: Cut-n-paste, refactor
        s = params.get( PARAM_INCLUDE );

        if( s != null )
        {
            try
            {
                PatternCompiler pc = new GlobCompiler();

                String[] ptrns = StringUtils.split( s, "," );

                m_include = new Pattern[ptrns.length];

                for( int i = 0; i < ptrns.length; i++ )
                {
                    m_include[i] = pc.compile( ptrns[i] );
                }
            }
            catch( MalformedPatternException e )
            {
                throw new PluginException("Include-parameter has a malformed pattern: "+e.getMessage());
View Full Code Here

Examples of org.apache.oro.text.GlobCompiler

    // FIXME: parsers should be pooled for better performance.
    @SuppressWarnings("unchecked")
    private void initialize()
    {
        PatternCompiler compiler         = new GlobCompiler();
        List<Pattern>   compiledpatterns;

        //
        //  We cache compiled patterns in the engine, since their creation is
        //  really expensive
        //
        compiledpatterns = (List<Pattern>)m_engine.getAttribute( INLINE_IMAGE_PATTERNS );

        if( compiledpatterns == null )
        {
            compiledpatterns = new ArrayList<Pattern>(20);
            Collection< String > ptrns = m_engine.getAllInlinedImagePatterns();

            //
            //  Make them into Regexp Patterns.  Unknown patterns
            //  are ignored.
            //
            for( Iterator< String > i = ptrns.iterator(); i.hasNext(); )
            {
                try
                {
                    compiledpatterns.add( compiler.compile( i.next(),
                                                            GlobCompiler.DEFAULT_MASK|GlobCompiler.READ_ONLY_MASK ) );
                }
                catch( MalformedPatternException e )
                {
                    log.error("Malformed pattern in properties: ", e );
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.