Java Code Examples for java.net.URI.getClass()

The following are Jave code examples for showing how to use getClass() of the java.net.URI class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: omero-ms-queue   File: UriTest.java   View Source Code Vote up 5 votes
@SuppressWarnings("unchecked")
private void assertSerializeAndDeserialize(URI initialValue) {
    Class<URI> valueType = (Class<URI>) initialValue.getClass();
    TypeToken<URI> typeToken = new TypeToken<URI>(){}; 
    
    assertWriteThenReadGivesInitialValue(initialValue, valueType);
    assertWriteThenReadGivesInitialValue(initialValue, typeToken);
}
 
Example 2
Project: javaide   File: SimpleJavaFileObject.java   View Source Code Vote up 5 votes
/**
 * Construct a SimpleJavaFileObject of the given kind and with the
 * given URI.
 *
 * @param uri  the URI for this file object
 * @param kind the kind of this file object
 */
protected SimpleJavaFileObject(URI uri, Kind kind) {
    // null checks
    uri.getClass();
    kind.getClass();
    if (uri.getPath() == null)
        throw new IllegalArgumentException("URI must have a path: " + uri);
    this.uri = uri;
    this.kind = kind;
}
 
Example 3
Project: OpenJSharp   File: SimpleJavaFileObject.java   View Source Code Vote up 5 votes
/**
 * Construct a SimpleJavaFileObject of the given kind and with the
 * given URI.
 *
 * @param uri  the URI for this file object
 * @param kind the kind of this file object
 */
protected SimpleJavaFileObject(URI uri, Kind kind) {
    // null checks
    uri.getClass();
    kind.getClass();
    if (uri.getPath() == null)
        throw new IllegalArgumentException("URI must have a path: " + uri);
    this.uri = uri;
    this.kind = kind;
}