本文整理匯總了Java中org.springframework.util.Assert.doesNotContain方法的典型用法代碼示例。如果您正苦於以下問題:Java Assert.doesNotContain方法的具體用法?Java Assert.doesNotContain怎麽用?Java Assert.doesNotContain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.util.Assert
的用法示例。
在下文中一共展示了Assert.doesNotContain方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validate
import org.springframework.util.Assert; //導入方法依賴的package包/類
@Override
public void validate() {
Assert.hasLength(networkId, "networkId must have length");
Assert.doesNotContain(networkId, "/", "slash not allowed in networkIds");
Assert.notEmpty(addresses, "addresses must not be empty - did DNS resolution fail?");
Assert.notEmpty(ports, "ports must not be empty");
}
示例2: setEnterMessage
import org.springframework.util.Assert; //導入方法依賴的package包/類
/**
* Set the template used for method entry log messages.
* This template can contain any of the following placeholders:
* <ul>
* <li>{@code $[targetClassName]}</li>
* <li>{@code $[targetClassShortName]}</li>
* <li>{@code $[argumentTypes]}</li>
* <li>{@code $[arguments]}</li>
* </ul>
*/
public void setEnterMessage(String enterMessage) throws IllegalArgumentException {
Assert.hasText(enterMessage, "'enterMessage' must not be empty");
checkForInvalidPlaceholders(enterMessage);
Assert.doesNotContain(enterMessage, PLACEHOLDER_RETURN_VALUE,
"enterMessage cannot contain placeholder [" + PLACEHOLDER_RETURN_VALUE + "]");
Assert.doesNotContain(enterMessage, PLACEHOLDER_EXCEPTION,
"enterMessage cannot contain placeholder [" + PLACEHOLDER_EXCEPTION + "]");
Assert.doesNotContain(enterMessage, PLACEHOLDER_INVOCATION_TIME,
"enterMessage cannot contain placeholder [" + PLACEHOLDER_INVOCATION_TIME + "]");
this.enterMessage = enterMessage;
}
示例3: setExitMessage
import org.springframework.util.Assert; //導入方法依賴的package包/類
/**
* Set the template used for method exit log messages.
* This template can contain any of the following placeholders:
* <ul>
* <li>{@code $[targetClassName]}</li>
* <li>{@code $[targetClassShortName]}</li>
* <li>{@code $[argumentTypes]}</li>
* <li>{@code $[arguments]}</li>
* <li>{@code $[returnValue]}</li>
* <li>{@code $[invocationTime]}</li>
* </ul>
*/
public void setExitMessage(String exitMessage) {
Assert.hasText(exitMessage, "'exitMessage' must not be empty");
checkForInvalidPlaceholders(exitMessage);
Assert.doesNotContain(exitMessage, PLACEHOLDER_EXCEPTION,
"exitMessage cannot contain placeholder [" + PLACEHOLDER_EXCEPTION + "]");
this.exitMessage = exitMessage;
}
示例4: setExceptionMessage
import org.springframework.util.Assert; //導入方法依賴的package包/類
/**
* Set the template used for method exception log messages.
* This template can contain any of the following placeholders:
* <ul>
* <li>{@code $[targetClassName]}</li>
* <li>{@code $[targetClassShortName]}</li>
* <li>{@code $[argumentTypes]}</li>
* <li>{@code $[arguments]}</li>
* <li>{@code $[exception]}</li>
* </ul>
*/
public void setExceptionMessage(String exceptionMessage) {
Assert.hasText(exceptionMessage, "'exceptionMessage' must not be empty");
checkForInvalidPlaceholders(exceptionMessage);
Assert.doesNotContain(exceptionMessage, PLACEHOLDER_RETURN_VALUE,
"exceptionMessage cannot contain placeholder [" + PLACEHOLDER_RETURN_VALUE + "]");
Assert.doesNotContain(exceptionMessage, PLACEHOLDER_INVOCATION_TIME,
"exceptionMessage cannot contain placeholder [" + PLACEHOLDER_INVOCATION_TIME + "]");
this.exceptionMessage = exceptionMessage;
}