class TextApplication {

    public void setUri(final String applicationUri)
            throws IllegalArgumentException {
        if (applicationUri == null) {
            uri = null;
        } else {
            final URI application;
            try {
                application = new URI(applicationUri);
            } catch (URISyntaxException e) {
                throw new IllegalArgumentException(e);
            }
            uri = application;
        }
    }

}