Spring Security Framework

org.springframework.security
Class ConfigAttributeDefinition

java.lang.Object
  extended by org.springframework.security.ConfigAttributeDefinition
All Implemented Interfaces:
Serializable

public class ConfigAttributeDefinition
extends Object
implements Serializable

Holds a group of ConfigAttributes that are associated with a given secure object target - effectively a Collection.

Once created, the object is immutable.

All the ConfigAttributeDefinitions associated with a given AbstractSecurityInterceptor are stored in an ObjectDefinitionSource.

Version:
$Id$
Author:
Ben Alex
See Also:
Serialized Form

Field Summary
static ConfigAttributeDefinition NO_ATTRIBUTES
           
 
Constructor Summary
ConfigAttributeDefinition(ConfigAttribute attribute)
          Creates a ConfigAttributeDefinition containing a single attribute.
ConfigAttributeDefinition(List configAttributes)
          Creates an immutable ConfigAttributeDefinition from the supplied list of ConfigAttribute objects.
ConfigAttributeDefinition(String attribute)
          Creates a ConfigAttributeDefinition containing a single attribute
ConfigAttributeDefinition(String[] attributeTokens)
          Builds a collection of ConfigAttributes from an array of String tokens, each of which will be wrapped in a SecurityConfig instance.
 
Method Summary
 boolean contains(ConfigAttribute configAttribute)
          Indicates whether the specified ConfigAttribute is contained within this ConfigAttributeDefinition.
static ConfigAttributeDefinition createFiltered(Collection unfilteredInput)
          Creates a ConfigAttributeDefinition by including only those attributes which implement ConfigAttribute.
 boolean equals(Object obj)
           
 Collection getConfigAttributes()
          Returns the internal collection of ConfigAttributes defined by this ConfigAttributeDefinition.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ATTRIBUTES

public static final ConfigAttributeDefinition NO_ATTRIBUTES
Constructor Detail

ConfigAttributeDefinition

public ConfigAttributeDefinition(String attribute)
Creates a ConfigAttributeDefinition containing a single attribute

Parameters:
attribute - the String name of the attribute (converted internally to a SecurityConfig instance).

ConfigAttributeDefinition

public ConfigAttributeDefinition(ConfigAttribute attribute)
Creates a ConfigAttributeDefinition containing a single attribute.


ConfigAttributeDefinition

public ConfigAttributeDefinition(String[] attributeTokens)
Builds a collection of ConfigAttributes from an array of String tokens, each of which will be wrapped in a SecurityConfig instance.

Parameters:
attributeTokens - the tokens which will be turned into attributes.

ConfigAttributeDefinition

public ConfigAttributeDefinition(List configAttributes)
Creates an immutable ConfigAttributeDefinition from the supplied list of ConfigAttribute objects.

Method Detail

createFiltered

public static ConfigAttributeDefinition createFiltered(Collection unfilteredInput)
Creates a ConfigAttributeDefinition by including only those attributes which implement ConfigAttribute.

Parameters:
unfilteredInput - a collection of various elements, zero or more which implement ConfigAttribute (can also be null)
Returns:
a ConfigAttributeDefinition if at least one ConfigAttribute was present, or null if none implemented it

contains

public boolean contains(ConfigAttribute configAttribute)
Indicates whether the specified ConfigAttribute is contained within this ConfigAttributeDefinition.

Parameters:
configAttribute - the attribute to locate
Returns:
true if the specified ConfigAttribute is contained, false otherwise

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getConfigAttributes

public Collection getConfigAttributes()
Returns the internal collection of ConfigAttributes defined by this ConfigAttributeDefinition.

Allows AccessDecisionManagers and other classes to loop through every configuration attribute associated with a target secure object.

Returns:
the configuration attributes stored in this instance.

toString

public String toString()
Overrides:
toString in class Object

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.