Class DefaultPolicyLookup

java.lang.Object
name.matthewgreet.strutscommons.util.DefaultPolicyLookup
All Implemented Interfaces:
PolicyLookup

public class DefaultPolicyLookup extends Object implements PolicyLookup

Standard implementation of PolicyLookup that creates a Singleton instance from an initial configuration that returns the built-in form field policies and, if classpath scanning is enabled, automatically finds and adds bespoke ones. Once created, policies can be added and removed but scanning cannot be re-run. Uses ClassGraph for classpath scanning. If scanning enabled, scanning the entire classpath can impose a noticeable, three second delay, so it's recommended to set the known policy packages in configuration.