Here you can find the source of assertValidSwfValue(String value)
Parameter | Description |
---|---|
value | to assert |
public static String assertValidSwfValue(String value)
//package com.java2s; //License from project: Open Source License public class Main { /**/* www .j a v a 2 s.co m*/ * Assert the value passes the constraints for SWF fields like name, version, domain, taskList, identifiers. * * @param value to assert * * @return the parameter for method chaining */ public static String assertValidSwfValue(String value) { if (value != null) { if (value.length() == 0) { throw new AssertionError("Empty value not allowed"); } if (value.matches("\\s.*|.*\\s") || value.matches(".*[:/|\\u0000-\\u001f\\u007f-\\u009f].*") || value.contains("arn")) { throw new AssertionError( "Value contains one or more bad characters: '" + value + "'"); } } return value; } }