Java Reflection Field Check isJavaClass(Field field)

Here you can find the source of isJavaClass(Field field)

Description

is Java Class

License

Open Source License

Declaration

public static boolean isJavaClass(Field field) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Field;

public class Main {

    public static boolean isJavaClass(Field field) {
        Class<?> fieldType = field.getType();
        boolean isBaseClass = false;
        if (fieldType.isArray()) {
            isBaseClass = false;/*from  ww w  .j  a  v a2  s. c o  m*/
        } else if (fieldType.isPrimitive() || fieldType.getPackage() == null
                || fieldType.getPackage().getName().equals("java.lang")
                || fieldType.getPackage().getName().equals("java.math")
                || fieldType.getPackage().getName().equals("java.util")) {
            isBaseClass = true;
        }
        return isBaseClass;
    }
}

Related

  1. getAllFieldsNoCache(Class realClass, Class upperClass)
  2. getFieldAttribute(Class entityClass, String fieldName)
  3. getFields(Class klass)
  4. getFieldSize(Class clazz)
  5. isFieldAutoBindable(Class clazz)
  6. putCachedSerializerForClass(Class instanceType, Class customFieldSerializer)