private Collection<ExcludedPath> getIndexingPolicyExcludePaths(Class<?> domainClass) { final Collection<ExcludedPath> pathsCollection = new ArrayList<>(); final DocumentIndexingPolicy annotation = domainClass.getAnnotation(DocumentIndexingPolicy.class); if (annotation == null || annotation.excludePaths() == null || annotation.excludePaths().length == 0) { return null; // Align the default value of IndexingPolicy } final String[] rawPaths = annotation.excludePaths(); for (final String path : rawPaths) { pathsCollection.add(new ExcludedPath(path)); } return pathsCollection; } }
@Override void populatePropertyBag() { // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.None && this.getIncludedPaths().size() == 0 && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(); includedPath.setPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } if (this.includedPaths != null) { for (IncludedPath includedPath : this.includedPaths) { includedPath.populatePropertyBag(); } super.set(Constants.Properties.INCLUDED_PATHS, this.includedPaths); } if (this.excludedPaths != null) { for (ExcludedPath excludedPath : this.excludedPaths) { excludedPath.populatePropertyBag(); } super.set(Constants.Properties.EXCLUDED_PATHS, this.excludedPaths); } } }
private Collection<ExcludedPath> getIndexingPolicyExcludePaths(Class<?> domainClass) { final Collection<ExcludedPath> pathsCollection = new ArrayList<>(); final DocumentIndexingPolicy annotation = domainClass.getAnnotation(DocumentIndexingPolicy.class); if (annotation == null || annotation.excludePaths() == null || annotation.excludePaths().length == 0) { return null; // Align the default value of IndexingPolicy } final String[] rawPaths = annotation.excludePaths(); for (final String path : rawPaths) { pathsCollection.add(new ExcludedPath(path)); } return pathsCollection; } }