Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acegisecurity.userdetails.memory
Class UserMapEditor  view UserMapEditor download UserMapEditor.java

java.lang.Object
  extended byjava.beans.PropertyEditorSupport
      extended byorg.acegisecurity.userdetails.memory.UserMapEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class UserMapEditor
extends java.beans.PropertyEditorSupport

Property editor to assist with the setup of a UserMap.

The format of entries should be:

username=password,grantedAuthority[,grantedAuthority][,enabled|disabled]

The password must always be the first entry after the equals. The enabled or disabled keyword can appear anywhere (apart from the first entry reserved for the password). If neither enabled or disabled appear, the default is enabled. At least one granted authority must be listed.

The username represents the key and duplicates are handled the same was as duplicates would be in Java Properties files.

If the above requirements are not met, the invalid entry will be silently ignored.

This editor always assumes each entry has a non-expired account and non-expired credentials. However, it does honour the user enabled/disabled flag as described above.

Version:
$Id: UserMapEditor.java,v 1.10 2005/11/29 13:10:09 benalex Exp $

Field Summary
 
Fields inherited from class java.beans.PropertyEditorSupport
 
Constructor Summary
UserMapEditor()
           
 
Method Summary
static UserMap addUsersFromProperties(UserMap userMap, java.util.Properties props)
           
 void setAsText(java.lang.String s)
          Sets the value as text.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserMapEditor

public UserMapEditor()
Method Detail

setAsText

public void setAsText(java.lang.String s)
               throws java.lang.IllegalArgumentException
Description copied from class: java.beans.PropertyEditorSupport
Sets the value as text. In this class, you cannot count on setAsText() doing anything useful across implementations. Implementation Note: In this implementation it checks if the String is "null", and if it is, sets the value to null, otherwise it throws an IllegalArgumentException.


addUsersFromProperties

public static UserMap addUsersFromProperties(UserMap userMap,
                                             java.util.Properties props)