Skip to content

NDefEncodingException

com.rvi.application.exception.NDefEncodingException · Class · SocialCard 1.0.3

Report invalid input to the NDEF encoder.

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.

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.

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.

NDefEncoder · NDefUri · NDefValueException

Method signatures in the Javadoc · All API types