NDefEncodingException
com.rvi.application.exception.NDefEncodingException · Class · SocialCard 1.0.3
Report invalid input to the NDEF encoder.
When to use it
Section titled “When to use it”Handle this around encoding to surface absent inputs or invalid URI arguments. Validate individual fields while building records, then handle encoding errors when you combine the records into a message.
Java example
Section titled “Java example”try { new NDefEncoder().encodeURI("rithush.dev");} catch (final NDefEncodingException failure) { System.err.println(failure.getMessage());}Java imports
import com.rvi.application.NDefEncoder;import com.rvi.application.exception.NDefEncodingException;Use an absolute URI such as https://rithush.dev to correct this input.
How it works
Section titled “How it works”The URI helpers use this exception for missing input and wrap NDefValueException with a cause when URI validation fails. encode() also throws it for an empty or null list or a null entry. Direct record construction can instead raise NDefValueException.