public RestrictionPattern getPattern()

in src/main/java/org/apache/sling/oak/restrictions/impl/SlingRestrictionProviderImpl.java [94:116]


    public RestrictionPattern getPattern(@Nullable String oakPath, @NotNull Set<Restriction> restrictions) {

        if (oakPath != null && !restrictions.isEmpty()) {
            for (Restriction r : restrictions) {
                String name = r.getDefinition().getName();
                if (SLING_RESOURCE_TYPES.equals(name)) {
                    ResourceTypePattern resourceTypePattern = new ResourceTypePattern(r.getProperty().getValue(Type.STRINGS), oakPath, false);
                    LOG.trace(
                            "Returning resourceTypePattern={} for rep:slingResourceTypes in getPattern(String,Set<Restriction>)",
                            resourceTypePattern);
                    return resourceTypePattern;
                } else if(SLING_RESOURCE_TYPES_WITH_DESCENDANTS.equals(name)) {
                    ResourceTypePattern resourceTypePattern = new ResourceTypePattern(r.getProperty().getValue(Type.STRINGS), oakPath, true);
                    LOG.trace(
                            "Returning resourceTypePattern={} for rep:slingResourceTypesWithChildren in getPattern(String,Set<Restriction>)",
                            resourceTypePattern);
                    return resourceTypePattern;
                }
            }
        }

        return RestrictionPattern.EMPTY;
    }