Class RegularExpressionService

java.lang.Object
fr.paris.lutece.plugins.regularexpression.service.RegularExpressionService
All Implemented Interfaces:
fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService

@ApplicationScoped public class RegularExpressionService extends Object implements fr.paris.lutece.portal.service.regularexpression.IRegularExpressionService
Regular expression service
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    formatRichTextAttributes(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
    Format in HTML richText attributes of a regularExpression
    List<fr.paris.lutece.portal.business.regularexpression.RegularExpression>
    return a list of regular expression
    List<fr.paris.lutece.portal.business.regularexpression.RegularExpression>
    getAllRegularExpression(boolean bForEditor)
    return a list of regular expression
    fr.paris.lutece.portal.business.regularexpression.RegularExpression
    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(String strValueToTest, fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression)
    return true if the value in parameter verify the regular expression
    boolean
    isMatches(String strValueToTest, 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(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 Details

    • RegularExpressionService

      public RegularExpressionService()
  • Method Details

    • isPatternValide

      public boolean isPatternValide(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(String strValueToTest, 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(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 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 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