# com.bea.p13n.controls.profile
PropertyControlImpl Class

public class PropertyControlImpl
extends `Object`
implements `ControlSource`, `PropertyControl`

Control to access and modify user properties.

Using EntityPropertyCache as the container for the returned properties, as opposed to a Map, makes it clear to the user how the properties should be extracted from the cache. The EntityPropertyCache stores properties as a HashMap of PropertySetKey/propertyValue, where PropertySetKey is the propertySet/propertyName pair.

You may get the backing HashMap of the EntityPropertyCache by calling its getMap() method, then step through it as follows: `if ( ! cache.isEmpty()) { Iterator = cache.getMap().entrySet().iterator(); while ( iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); PropertyMapKey pmKey = (PropertyMapKey)entry.getKey(); String propertySetName = pmKey.getPropertySetName(); String propertyName = pmKey.getPropertyName(); Object value = entry.getValue(); } }`

Related Topics

com.bea.wlw.netui.pagegroup.PageGroup
``SessionHelper``
``PropertyMapKey``
``EntityPropertyCache``
com.bea.p13n.usermgmt.ProfileWrapper

Hierarchy
  `Object`
  `PropertyControlImpl`

All Implemented Interfaces
  `Control`, `Control`, `ControlSource`, `PropertyControl`, `Serializable`

## Constructor Summary

PropertyControlImpl()

## Method Summary

`public `EntityPropertyCache`` | `getProperties`(`ProfileWrapper` pw) Get all properties for this profile, and return as an EntityPropertyCache.
`public `EntityPropertyCache`` | `getPropertiesFromKeys`(`ProfileWrapper` pw, `Set` propertyMapKeys) Get all properties that match the set of PropertyMapKeys for this profile
`public `EntityPropertyCache`` | `getPropertiesFromSet`(`ProfileWrapper` pw, `String` propertySetName) Get all properties for named property set for this profile, and return as an EntityPropertyCache.
`public `Object`` | `getProperty`(`ProfileWrapper` pw, `String` propertySet, `String` property) Get an individual property.
`public `Object`` | `removeProperty`(`ProfileWrapper` pw, `String` propertySet, `String` propertyName) Remove a property from the profile
`public void` | `setProperties`(`ProfileWrapper` pw, `EntityPropertyCache` cache) Set properties in this EntityPropertyCache back into the user's profile.
`public void` | `setProperty`(`ProfileWrapper` pw, `String` propertySet, `String` property, `Object` value) Set an individual property.

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from class `com.bea.p13n.controls.profile.`PropertyControl``
``getProperties`, `getPropertiesFromKeys`, `getPropertiesFromSet`, `getProperty`, `removeProperty`, `setProperties`, `setProperty``

## Constructor Detail

### PropertyControlImpl

    public PropertyControlImpl()

## Method Detail

### getProperties(ProfileWrapper) Method

    public EntityPropertyCache getProperties(ProfileWrapper pw)
         throws ProfileNotFoundException, P13nControlException

Get all properties for this profile, and return as an EntityPropertyCache.

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

#### Returns

an EntityPropertyCache of the retrieved properties, or null if there are no properties

#### Exceptions

``ProfileNotFoundException``
``P13nControlException``

### getPropertiesFromKeys(ProfileWrapper, Set) Method

    public EntityPropertyCache getPropertiesFromKeys(ProfileWrapper pw,
                                                     Set propertyMapKeys)
         throws ProfileNotFoundException, P13nControlException

Get all properties that match the set of PropertyMapKeys for this profile

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

propertyMapKeys
  Set of PropertyMapKeys for which all properties will be retrieved

#### Returns

an EntityPropertyCache of the retrieved properties or null if there are no properties

#### Exceptions

``ProfileNotFoundException``
``P13nControlException``

### getPropertiesFromSet(ProfileWrapper, String) Method

    public EntityPropertyCache getPropertiesFromSet(ProfileWrapper pw,
                                                    String propertySetName)
         throws ProfileNotFoundException, P13nControlException

Description copied from `PropertyControl.getPropertiesFromSet(ProfileWrapper, String)`
Get all properties for named property set for this profile, and return as an EntityPropertyCache.

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

propertySetName

#### Returns

an EntityPropertyCache of the retrieved properties, or null if there are no properties

#### Exceptions

``ProfileNotFoundException``
``P13nControlException``

### getProperty(ProfileWrapper, String, String) Method

    public Object getProperty(ProfileWrapper pw,
                              String propertySet,
                              String property)
         throws ProfileNotFoundException, P13nControlException

Get an individual property.

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

propertySet
  name of the property set containing the property to retrieve

property
  name of the property to retrieve

#### Returns

the retrieved property, or null if not found

#### Exceptions

``ProfileNotFoundException``
``P13nControlException``

### removeProperty(ProfileWrapper, String, String) Method

    public Object removeProperty(ProfileWrapper pw,
                                 String propertySet,
                                 String propertyName)
         throws ProfileNotFoundException, P13nControlException

Remove a property from the profile

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

propertySet
  the property set containing the property

propertyName
  the name of the property to retrieve

#### Returns

the old value of the property

#### Exceptions

``ProfileNotFoundException``
``P13nControlException``

### setProperties(ProfileWrapper, EntityPropertyCache) Method

    public void setProperties(ProfileWrapper pw,
                              EntityPropertyCache cache)
         throws ProfileNotFoundException, PropertyValidationException, P13nControlException

Set properties in this EntityPropertyCache back into the user's profile.

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

cache
  the cache containing the properties to set. See javadocs at the top of this class for more info on the EntityPropertyCache

#### Exceptions

``ProfileNotFoundException``
``PropertyValidationException``
``P13nControlException``

### setProperty(ProfileWrapper, String, String, Object) Method

    public void setProperty(ProfileWrapper pw,
                            String propertySet,
                            String property,
                            Object value)
         throws ProfileNotFoundException, PropertyValidationException, P13nControlException

Set an individual property.

#### Parameters

pw
  The ProfileWrapper representing the user profile for which the properties are to be retrieved

propertySet
  name of the property set containing the property to set

property
  name of the property to set

value
  value of the property to set

#### Exceptions

``ProfileNotFoundException``
``PropertyValidationException``
``P13nControlException``