If user means end user and attribute value will be dynamic, you must validate it for yourself. If user means developer who will use this tag, you can use special api. search google for TLV (tag library validation)
If you are writing a tag used by other developers and you want to validate the value of the attribute, then you may consider using TagExtraInfo (tei) classes. You could override the isValid() method to return true/false. A TagData object is passed to this method which contains the attribute values. This works at translation time and hence if your attribute supports runtime translation (rtexpr value = true), this will not work.