commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bspeak...@apache.org
Subject svn commit: r588359 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Date Thu, 25 Oct 2007 21:09:57 GMT
Author: bspeakmon
Date: Thu Oct 25 14:09:57 2007
New Revision: 588359

URL: http://svn.apache.org/viewvc?rev=588359&view=rev
Log:
- added static factory method and private static default instance

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=588359&r1=588358&r2=588359&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
(original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Thu Oct 25 14:09:57 2007
@@ -176,6 +176,19 @@
     protected String[] defaultSchemes = {"http", "https", "ftp"};
 
     /**
+     * Singleton instance of this class with default schemes and options.
+     */
+    private static final UrlValidator DEFAULT_URL_VALIDATOR = new UrlValidator();
+
+    /**
+     * Returns the singleton instance of this class with default schemes and options.
+     * @return singleton instance with default schemes and options
+     */
+    public static UrlValidator getInstance() {
+        return DEFAULT_URL_VALIDATOR;    
+    }
+
+    /**
      * Create a UrlValidator with default properties.
      */
     public UrlValidator() {



Mime
View raw message