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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidformatRichTextAttributes(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression) Format in HTML richText attributes of a regularExpressionList<fr.paris.lutece.portal.business.regularexpression.RegularExpression>return a list of regular expressionList<fr.paris.lutece.portal.business.regularexpression.RegularExpression>getAllRegularExpression(boolean bForEditor) return a list of regular expressionfr.paris.lutece.portal.business.regularexpression.RegularExpressiongetRegularExpressionByKey(int nKey) return the regular expression object whose identifier is specified in parameterfr.paris.lutece.portal.business.regularexpression.RegularExpressiongetRegularExpressionByKey(int nKey, boolean bForEditor) return the regular expression object whose identifier is specified in parameterbooleanisMatches(String strValueToTest, fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression) return true if the value in parameter verify the regular expressionbooleanreturn true if the value in parameter verify the patternbooleanisPatternValide(fr.paris.lutece.portal.business.regularexpression.RegularExpression regularExpression) return false if the expression's syntax is invalidbooleanisPatternValide(String strPattern) return false if the pattern is invalid
-
Constructor Details
-
RegularExpressionService
public RegularExpressionService()
-
-
Method Details
-
isPatternValide
return false if the pattern is invalid- Specified by:
isPatternValidein interfacefr.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:
isPatternValidein interfacefr.paris.lutece.portal.service.regularexpression.IRegularExpressionService- Parameters:
regularExpression- the regular expression object to test- Returns:
- false if the expression's syntax is invalid
-
isMatches
return true if the value in parameter verify the pattern- Specified by:
isMatchesin interfacefr.paris.lutece.portal.service.regularexpression.IRegularExpressionService- Parameters:
strValueToTest- the value to teststrPattern- 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:
isMatchesin interfacefr.paris.lutece.portal.service.regularexpression.IRegularExpressionService- Parameters:
strValueToTest- the value to testregularExpression- 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:
getRegularExpressionByKeyin interfacefr.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 keybForEditor- 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:
getAllRegularExpressionin interfacefr.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
-