Get the package name for a object.
@param obj The object to get the package name for.
@return the object's class's pacakge name.
@throws NullPointerException if obj is null.
769427
public static String getPackageName(Object obj)
	{
		if(obj == null)
			throw new NullPointerException("obj is null");
		return getPackageName(obj.getClass());
	}
417069
public static String getAppName() {
		String appName=System.getProperty(JKContextConstants.JK_APP_NAME);
		if (appName == null) {
			String mainClassName = JKDebugUtil.getMainClassName();
			return mainClassName.substring(0, mainClassName.lastIndexOf("."));
		}
		return appName;
	}
269340
public static PackageDescriptor forName(String packageName,
                                            ClassLoader classLoader) {
        
        PackageDescriptor pd = new PackageDescriptor(packageName);
        if (classLoader == null) {
            classLoader = ClassLoader.getSystemClassLoader();
        }
        
        if (packageName == null || packageName.trim().length() == 0) {
            return pd;
        }
        
        String packageInfoClassName = packageName;

        if (!packageInfoClassName.endsWith(".")) {
            packageInfoClassName = packageInfoClassName + ".";
        }
        
        packageInfoClassName = packageInfoClassName + "PackageInfo";


        Class<?> packageInfoClass = null;
        
        try {
            if (classLoader != null) {
                packageInfoClass = 
                    classLoader.loadClass(packageInfoClassName);
            }
            else {
                packageInfoClass = Class.forName(packageInfoClassName);
            }
        }
        catch (Throwable t) {
        }

        if (packageInfoClass != null) {
            try {
                initFromPackageInfo(pd, packageInfoClass);
            }
            catch (Throwable t) {
            }
        }
        else {

            Package pkg = null;
            
            if (classLoader != null) {
                // Get around getPackage's protected access
                PackageLoader packageLoader = 
                    new PackageLoader(classLoader);
                
                pkg = packageLoader.getPackage(packageName);
            }
            
            if (pkg == null) {
                pkg = Package.getPackage(packageName);
            }                        

            if (pkg != null) {
                initFromPackage(pd, pkg);
            }
        }

        return pd;
    }
1037598
def get_classname(obj):
    
    if isinstance(obj, javabridge.JB_Object):
        cls = javabridge.call(obj, "getClass", "()Ljava/lang/Class;")
        return javabridge.call(cls, "getName", "()Ljava/lang/String;")
    elif inspect.isclass(obj):
        return obj.__module__ + "." + obj.__name__
    else:
        return get_classname(obj.__class__)
1033585
public String reflectionName() {
    return enclosingClassName != null
        ? (enclosingClassName.reflectionName() + '$' + simpleName)
        : (packageName.isEmpty() ? simpleName : packageName + '.' + simpleName);
  }
233411
public static String getSimpleClassName(final Object object) {

    return object != null ? object.getClass().getSimpleName() : NULL_STRING;
  }
925066
def get_object_name(object):
    

    if type(object) is property:
        return object.fget.__name__
    elif hasattr(object, "__name__"):
        return object.__name__
    elif hasattr(object, "__class__"):
        return object.__class__.__name__
    else:
        return NULL_OBJECT_NAME
849120
public String getNameByReflection(Object obj)
    {
        Object name = null;
        try {
            java.lang.reflect.Method method = obj.getClass().getMethod("getName");
            
            if (method != null)
                name = method.invoke(obj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (name == null)
            return null;
        else
            return name.toString();
    }
884932
public static Object[] getFieldsValue(Object obj) {
		if (null != obj) {
			final Field[] fields = getFields(obj.getClass());
			if (null != fields) {
				final Object[] values = new Object[fields.length];
				for (int i = 0; i < fields.length; i++) {
					values[i] = getFieldValue(obj, fields[i]);
				}
				return values;
			}
		}
		return null;
	}
282258
public String getFullPackageName(String classProjectID, String classPackageName)
    {
        if (classProjectID == null)
            return DBConstants.BLANK;
        String packageName = classProjectPackages.get(classProjectID);
        if (packageName == null)
            return null;    // This class is not accessible
        if (packageName.startsWith("."))
            packageName = Constants.ROOT_PACKAGE.substring(0, Constants.ROOT_PACKAGE.length() - 1) + packageName;
        if (classPackageName == null)
            classPackageName = DBConstants.BLANK;
        if (classPackageName.startsWith("."))
            packageName = packageName + classPackageName;
        else if (classPackageName.length() > 0)
            packageName = classPackageName;
        return packageName;
    }
1263628
public static String[] getNames(Object object) {
		if (object == null) {
			return null;
		}
		Class<? extends Object> klass = object.getClass();
		Field[] fields = klass.getFields();
		int length = fields.length;
		if (length == 0) {
			return null;
		}
		String[] names = new String[length];
		for (int i = 0; i < length; i += 1) {
			names[i] = fields[i].getName();
		}
		return names;
	}
1137623
function getObjectClassname (listener) {
    if (!listener) return DEFAULT_LISTENER;
    if (typeof listener === 'string') return listener;
    var constr = listener.constructor;
    return constr.name || constr.toString().split(/ |\(/, 2)[1];
}
1332365
private static void getClassPackageNames(Class<?> clazz, Map<String, Class<?>> packageNames) {
    if (isPrivate(clazz)) {
      throw new IllegalArgumentException(PrettyPrinter.format(
          "Unable to inject an instance of %s because it is a private class.", clazz));
    } else if (!isPublic(clazz)) {
      packageNames.put(clazz.getPackage().getName(), clazz);
    }

    Class<?> enclosingClass = clazz.getEnclosingClass();
    if (enclosingClass != null) {
      getClassPackageNames(enclosingClass, packageNames);
    }
  }
1295189
public static String getName(Object obj) {
		try {
			return obj.getClass().getAnnotation(XmlRootElement.class).name();
		} catch (NullPointerException e) {
			return obj.getClass().getAnnotation(XmlType.class).name();
		}
	}
1194448
protected String getExpectedPackageName(EObject model) {
		final URI fileURI = model.eResource().getURI();
		for (final Pair<IStorage, IProject> storage: this.storage2UriMapper.getStorages(fileURI)) {
			if (storage.getFirst() instanceof IFile) {
				final IPath fileWorkspacePath = storage.getFirst().getFullPath();
				final IJavaProject javaProject = JavaCore.create(storage.getSecond());
				return extractProjectPath(fileWorkspacePath, javaProject);
			}
		}
		return null;
	}
1340909
static String getParentPackageName(final String packageOrClassName) {
        if (packageOrClassName.isEmpty()) {
            return null;
        }
        final int lastDotIdx = packageOrClassName.lastIndexOf('.');
        return lastDotIdx < 0 ? "" : packageOrClassName.substring(0, lastDotIdx);
    }
1158074
public static String getName(ObjectMeta entity) {
    if (entity != null) {
      return Utils.coalesce(entity.getName(),
        getAdditionalPropertyText(entity.getAdditionalProperties(), "id"),
        entity.getUid());
    } else {
      return null;
    }
  }