publicclassSimpleFileVisitor<T> implementsFileVisitor<T> { /** * Initializes a new instance of this class. */ protectedSimpleFileVisitor(){ }
/** * Invoked for a directory before entries in the directory are visited. * * <p> Unless overridden, this method returns {@link FileVisitResult#CONTINUE * CONTINUE}. */ @Override public FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs) throws IOException { Objects.requireNonNull(dir); Objects.requireNonNull(attrs); return FileVisitResult.CONTINUE; }
/** * Invoked for a file in a directory. * * <p> Unless overridden, this method returns {@link FileVisitResult#CONTINUE * CONTINUE}. */ @Override public FileVisitResult visitFile(T file, BasicFileAttributes attrs) throws IOException { Objects.requireNonNull(file); Objects.requireNonNull(attrs); return FileVisitResult.CONTINUE; }
/** * Invoked for a file that could not be visited. * * <p> Unless overridden, this method re-throws the I/O exception that prevented * the file from being visited. */ @Override public FileVisitResult visitFileFailed(T file, IOException exc) throws IOException { Objects.requireNonNull(file); throw exc; }
/** * Invoked for a directory after entries in the directory, and all of their * descendants, have been visited. * * <p> Unless overridden, this method returns {@link FileVisitResult#CONTINUE * CONTINUE} if the directory iteration completes without an I/O exception; * otherwise this method re-throws the I/O exception that caused the iteration * of the directory to terminate prematurely. */ @Override public FileVisitResult postVisitDirectory(T dir, IOException exc) throws IOException { Objects.requireNonNull(dir); if (exc != null) throw exc; return FileVisitResult.CONTINUE; } }
/** * Create a new BeanDefinitionVisitor, applying the specified * value resolver to all bean metadata values. * @param valueResolver the StringValueResolver to apply */ publicBeanDefinitionVisitor(StringValueResolver valueResolver){ Assert.notNull(valueResolver, "StringValueResolver must not be null"); this.valueResolver = valueResolver; }
/** * Create a new BeanDefinitionVisitor for subclassing. * Subclasses need to override the {@link #resolveStringValue} method. */ protectedBeanDefinitionVisitor(){ }
/** * Traverse the given BeanDefinition object and the MutablePropertyValues * and ConstructorArgumentValues contained in them. * @param beanDefinition the BeanDefinition object to traverse * @see #resolveStringValue(String) */ publicvoidvisitBeanDefinition(BeanDefinition beanDefinition){ visitParentName(beanDefinition); visitBeanClassName(beanDefinition); visitFactoryBeanName(beanDefinition); visitFactoryMethodName(beanDefinition); visitScope(beanDefinition); if (beanDefinition.hasPropertyValues()) { visitPropertyValues(beanDefinition.getPropertyValues()); } if (beanDefinition.hasConstructorArgumentValues()) { ConstructorArgumentValues cas = beanDefinition.getConstructorArgumentValues(); visitIndexedArgumentValues(cas.getIndexedArgumentValues()); visitGenericArgumentValues(cas.getGenericArgumentValues()); } } }