Example usage for com.liferay.portal.kernel.util Validator isVariableTerm

List of usage examples for com.liferay.portal.kernel.util Validator isVariableTerm

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util Validator isVariableTerm.

Prototype

public static boolean isVariableTerm(String s) 

Source Link

Document

Returns true if the string is a valid variable term, meaning it begins with "[$" and ends with "$]".

Usage

From source file:com.liferay.portlet.blogs.action.ConfigurationActionImpl.java

License:Open Source License

protected void validateEmailFrom(ActionRequest actionRequest) throws Exception {

    String emailFromName = getParameter(actionRequest, "emailFromName");
    String emailFromAddress = getParameter(actionRequest, "emailFromAddress");

    if (Validator.isNull(emailFromName)) {
        SessionErrors.add(actionRequest, "emailFromName");
    } else if (!Validator.isEmailAddress(emailFromAddress) && !Validator.isVariableTerm(emailFromAddress)) {

        SessionErrors.add(actionRequest, "emailFromAddress");
    }//from  w w  w  . ja  v a 2  s  .com
}