class JMSMessagePropertySupport {

    public static void checkPropertyNameIsValid(String propertyName, boolean validateNames) throws IllegalArgumentException {
        if (propertyName == null) {
            throw new IllegalArgumentException("Property name must not be null");
        } else if (propertyName.length() == 0) {
            throw new IllegalArgumentException("Property name must not be the empty string");
        }

        if (validateNames) {
            checkIdentifierLetterAndDigitRequirements(propertyName);
            checkIdentifierIsntNullTrueFalse(propertyName);
            checkIdentifierIsntLogicOperator(propertyName);
        }
    }

}