Skip to content

NDefValueException

com.rvi.domain.exception.NDefValueException · Class · SocialCard 1.0.3

Report invalid data in an individual NDEF record.

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.

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.

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.

NDefUri · NDefText · NDefContact · NDefWifi · NDefEncodingException

Method signatures in the Javadoc · All API types