401 * on {@link Navigator}.
402 *
403 * <p>
404 * It made me realize how difficult it is to define the common navigation
405 * layer for two different underlying reflection library. The other way
406 * is to throw away the entire parameterization and go to the wrapper approach.
407 */
408 public <T> Class<T> erasure(Type t) {
409 return eraser.visit(t, null);
410 }
411
412 public boolean isAbstract(Class clazz) {
413 return Modifier.isAbstract(clazz.getModifiers());
414 }
415
416 public boolean isFinal(Class clazz) {
417 return Modifier.isFinal(clazz.getModifiers());
418 }
419
420 /**
421 * Returns the {@link Type} object that represents {@code clazz<T1,T2,T3>}.
422 */
423 public Type createParameterizedType(Class rawType, Type... arguments) {
424 return new ParameterizedTypeImpl(rawType, arguments, null);
425 }
426
427 public boolean isArray(Type t) {
428 if (t instanceof Class) {
429 Class c = (Class) t;
430 return c.isArray();
431 }
432 if (t instanceof GenericArrayType) {
433 return true;
434 }
435 return false;
436 }
437
438 public boolean isArrayButNotByteArray(Type t) {
439 if (t instanceof Class) {
440 Class c = (Class) t;
441 return c.isArray() && c != byte[].class;
|
401 * on {@link Navigator}.
402 *
403 * <p>
404 * It made me realize how difficult it is to define the common navigation
405 * layer for two different underlying reflection library. The other way
406 * is to throw away the entire parameterization and go to the wrapper approach.
407 */
408 public <T> Class<T> erasure(Type t) {
409 return eraser.visit(t, null);
410 }
411
412 public boolean isAbstract(Class clazz) {
413 return Modifier.isAbstract(clazz.getModifiers());
414 }
415
416 public boolean isFinal(Class clazz) {
417 return Modifier.isFinal(clazz.getModifiers());
418 }
419
420 /**
421 * Returns the {@link Type} object that represents {@code clazz<T1,T2,T3>}.
422 */
423 public Type createParameterizedType(Class rawType, Type... arguments) {
424 return new ParameterizedTypeImpl(rawType, arguments, null);
425 }
426
427 public boolean isArray(Type t) {
428 if (t instanceof Class) {
429 Class c = (Class) t;
430 return c.isArray();
431 }
432 if (t instanceof GenericArrayType) {
433 return true;
434 }
435 return false;
436 }
437
438 public boolean isArrayButNotByteArray(Type t) {
439 if (t instanceof Class) {
440 Class c = (Class) t;
441 return c.isArray() && c != byte[].class;
|