private String getHostObjectName()

in src/main/java/org/apache/sling/scripting/javascript/helper/SlingWrapFactory.java [74:94]


    private String getHostObjectName(Class<?> javaClass) {
        if (javaClass == null || isExcluded(javaClass)) {
            return null;
        }
        String hostObjectName = wrappers.get(javaClass);
        if (hostObjectName == null) {
            // before SLING-383 the superclass was tested first,
            // but for Version and VersionHistory this would get
            // a Node wrapper, that's not what we want
            final Class<?>[] javaInterfaces = javaClass.getInterfaces();
            for (int i = 0; i < javaInterfaces.length && hostObjectName == null; i++) {
                hostObjectName = getHostObjectName(javaInterfaces[i]);
            }

            if (hostObjectName == null) {
                hostObjectName = getHostObjectName(javaClass.getSuperclass());
            }
        }

        return hostObjectName;
    }