Package jodd.util

Class StringTemplateMatcher.StringTemplateMatcherCompiled

  • Enclosing class:
    StringTemplateMatcher

    public class StringTemplateMatcher.StringTemplateMatcherCompiled
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] fixed  
      private int macrosCount  
      private java.lang.String[] names  
      private java.lang.String[] patterns  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int macrosCount()
      Returns macros count.
      StringTemplateMatcher.Match[] match​(java.lang.String input)
      Returns all the matches or the empty array if no matches found.
      boolean matches​(java.lang.String input)
      Returns true if the input matches the compiled pattern.
      java.lang.String[] names()  
      java.lang.String[] patterns()
      Returns all patterns.
      private java.lang.String[] process​(java.lang.String input, boolean match)
      Process input in two modes: matching mode and extracting mode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • macrosCount

        private final int macrosCount
      • names

        private final java.lang.String[] names
      • patterns

        private final java.lang.String[] patterns
      • fixed

        private final java.lang.String[] fixed
    • Constructor Detail

      • StringTemplateMatcherCompiled

        private StringTemplateMatcherCompiled​(int macrosCount)
      • StringTemplateMatcherCompiled

        private StringTemplateMatcherCompiled()
    • Method Detail

      • names

        public java.lang.String[] names()
      • patterns

        public java.lang.String[] patterns()
        Returns all patterns. Some elements may be null if some macro does not define a pattern.
      • macrosCount

        public int macrosCount()
        Returns macros count.
      • matches

        public boolean matches​(java.lang.String input)
        Returns true if the input matches the compiled pattern.
      • match

        public StringTemplateMatcher.Match[] match​(java.lang.String input)
        Returns all the matches or the empty array if no matches found.
      • process

        private java.lang.String[] process​(java.lang.String input,
                                           boolean match)
        Process input in two modes: matching mode and extracting mode.
        Returns:
        string array of extracted macro values (null element is allowed) or null