public HApiType getType()

in src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java [370:384]


    public HApiType getType(ResourceResolver resolver, Resource typeResource) throws RepositoryException {
        if (null == typeResource) return new AbstractHapiTypeImpl("Abstract");

        String typePath = typeResource.getPath();
        LOG.debug("Trying to get type {}; cache: {}", typePath, types);
        if (this.types.containsKey(typePath)) {
            LOG.debug("Returning type {} from cache", typePath);
            return this.types.get(typePath);
        } else {
            LOG.debug("Creating type {} in cache", typePath);
            HApiType type = hApiUtil.fromPath(resolver, typePath);
            this.types.put(type.getPath(), type);
            return type;
        }
    }