Yes, there are multiple ways you can achieve this. But first of all if this is read only lib then it must be holding that filter for a specific purpose. Don't you think you are trying to defy the purpose behind the validation filter?
What's the purpose / aim behind implementing such logic or custom validator?