NDefValueException
com.rvi.domain.exception.NDefValueException · Class · SocialCard 1.0.3
Report invalid data in an individual NDEF record.
When to use it
Section titled “When to use it”Catch it at an input boundary where you know which field the user is editing. A missing URI scheme, malformed text language tag, invalid contact and incompatible Wi-Fi settings can all reach this exception.
Java example
Section titled “Java example”try { new NDefTextCreator().text("My portfolio").language("!").build();} catch (final NDefValueException failure) { System.err.println(failure.getMessage());}Java imports
import com.rvi.application.creator.NDefTextCreator;import com.rvi.domain.exception.NDefValueException;Replace ! with a language tag such as en or de-CH.
How it works
Section titled “How it works”The domain records validate their inputs in their constructors. The record builders invoke those constructors in build(). In particular, using a builder leaves validation until the value is built.
Related API
Section titled “Related API”NDefUri · NDefText · NDefContact · NDefWifi · NDefEncodingException