Class RegularExpressionService

  • All Implemented Interfaces:
    fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService

    public class RegularExpressionService
    extends java.lang.Object
    implements fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
    Regular expression service
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void formatRichTextAttributes​(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
      Format in HTML richText attributes of a regularExpression
      java.util.List<fr.paris.lutece.portal.business.regularexpression.RegularExpression> getAllRegularExpression()
      return a list of regular expression
      java.util.List<fr.paris.lutece.portal.business.regularexpression.RegularExpression> getAllRegularExpression​(boolean bForEditor)
      return a list of regular expression
      fr.paris.lutece.portal.business.regularexpression.RegularExpression getRegularExpressionByKey​(int nKey)
      return the regular expression object whose identifier is specified in parameter
      fr.paris.lutece.portal.business.regularexpression.RegularExpression getRegularExpressionByKey​(int nKey, boolean bForEditor)
      return the regular expression object whose identifier is specified in parameter
      boolean isMatches​(java.lang.String strValueToTest, fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
      return true if the value in parameter verify the regular expression
      boolean isMatches​(java.lang.String strValueToTest, java.lang.String strPattern)
      return true if the value in parameter verify the pattern
      boolean isPatternValide​(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
      return false if the expression's syntax is invalid
      boolean isPatternValide​(java.lang.String strPattern)
      return false if the pattern is invalid
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RegularExpressionService

        public RegularExpressionService()
    • Method Detail

      • isPatternValide

        public boolean isPatternValide​(java.lang.String strPattern)
        return false if the pattern is invalid
        Specified by:
        isPatternValide in interface fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
        Parameters:
        strPattern - the pattern to test
        Returns:
        false if the pattern is invalid
      • isPatternValide

        public boolean isPatternValide​(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
        return false if the expression's syntax is invalid
        Specified by:
        isPatternValide in interface fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
        Parameters:
        regularExpression - the regular expression object to test
        Returns:
        false if the expression's syntax is invalid
      • isMatches

        public boolean isMatches​(java.lang.String strValueToTest,
                                 java.lang.String strPattern)
        return true if the value in parameter verify the pattern
        Specified by:
        isMatches in interface fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
        Parameters:
        strValueToTest - the value to test
        strPattern - the regular expression Pattern
        Returns:
        true if the value in parameter verify the pattern
      • isMatches

        public boolean isMatches​(java.lang.String strValueToTest,
                                 fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
        return true if the value in parameter verify the regular expression
        Specified by:
        isMatches in interface fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
        Parameters:
        strValueToTest - the value to test
        regularExpression - the regular expression
        Returns:
        true if the value verify the regular expression
      • getRegularExpressionByKey

        public fr.paris.lutece.portal.business.regularexpression.RegularExpression getRegularExpressionByKey​(int nKey)
        return the regular expression object whose identifier is specified in parameter
        Specified by:
        getRegularExpressionByKey in interface fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
        Parameters:
        nKey - the regular expression key
        Returns:
        the regular expression object whose identifier is specified in parameter
      • getRegularExpressionByKey

        public fr.paris.lutece.portal.business.regularexpression.RegularExpression getRegularExpressionByKey​(int nKey,
                                                                                                             boolean bForEditor)
        return the regular expression object whose identifier is specified in parameter
        Parameters:
        nKey - the regular expression key
        bForEditor - True if the template is to be displayed in an editor
        Returns:
        the regular expression object whose identifier is specified in parameter
      • getAllRegularExpression

        public java.util.List<fr.paris.lutece.portal.business.regularexpression.RegularExpression> getAllRegularExpression()
        return a list of regular expression
        Specified by:
        getAllRegularExpression in interface fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
        Returns:
        all regular expression
      • getAllRegularExpression

        public java.util.List<fr.paris.lutece.portal.business.regularexpression.RegularExpression> getAllRegularExpression​(boolean bForEditor)
        return a list of regular expression
        Parameters:
        bForEditor - True if the template is to be displayed in an editor
        Returns:
        all regular expression
      • formatRichTextAttributes

        public static void formatRichTextAttributes​(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
                                             throws fr.paris.lutece.portal.service.editor.RichTextParsingException
        Format in HTML richText attributes of a regularExpression
        Parameters:
        regularExpression - The regularExpression to modify
        Throws:
        fr.paris.lutece.portal.service.editor.RichTextParsingException