PropertySetRepository Interface

com.bea.p13n.property
PropertySetRepository Interface

public interface PropertySetRepository

PropertySetRepository is an interface to be implemented by any part of the system that manages its own PropertySets. The PropertySetManager will maintain a mapping of property set types to property set repositories so that the appropriate repository will be queried when a PropertySet is requested.

To define a property set type to repository class mapping, create an entry in the PropertySetManager's deployment descriptor that follows this pattern:

   <env-entry>
     <env-entry-name>repository/USER</env-entry-name>
     <env-entry-type>java.lang.String</env-entry-type>
     <env-entry-value>com.bea.p13n.property.internal.PropertySetRepositoryImpl</env-entry-value>
   </env-entry>
 

This example maps the USER property set type to the default implementation of the PropertySetRepository interface.

Related Topics

PropertySet


All Known Implementing Classes
PropertySetRepositoryImpl, PropertySetRepositoryImpl

Method Summary

public boolean
addPropertySet(String name, PropertySet propertySet)
Add a PropertySet to the repository.
public void
clear()
Remove all PropertySets from the repository.
public PropertySet
getPropertySet(String name)
Retrieve the given PropertySet
public String[]
getPropertySetNames()
Retrieve a list of names of all PropertySet objects in this repository
public Map
getPropertySets()
Retrieve all PropertySet objects in this repository
public void
removePropertySet(String name)
Remove a PropertySet from the repository.

Method Detail

addPropertySet(String, PropertySet) Method

public boolean addPropertySet(String name, 
                              PropertySet propertySet)
throws UnsupportedOperationException
Add a PropertySet to the repository. If an implementation does not support this, an UnsupportedOperationException will be thrown. (some implementations may be read-only)

Parameters

name
the name to associate with ths PropertySet
propertySet
the PropertySet object itself

Returns

true if the PropertySet was modified, false if it was created

Exceptions

UnsupportedOperationException
if this is not supported

clear() Method

public void clear()
throws UnsupportedOperationException
Remove all PropertySets from the repository. If an implementation does not support this, an UnsupportedOperationException will be thrown. (some implementations may be read-only)

Exceptions

UnsupportedOperationException
if this is not supported

getPropertySet(String) Method

public PropertySet getPropertySet(String name)
Retrieve the given PropertySet

Parameters

name
the name of the PropertySet

Returns

the PropertySet object, or null if it is not found

getPropertySetNames() Method

public String[] getPropertySetNames()
Retrieve a list of names of all PropertySet objects in this repository

Returns

a String array of property set names, or null if none exist

getPropertySets() Method

public Map getPropertySets()
Retrieve all PropertySet objects in this repository

Returns

a Map of name/PropertySet pairs, or null if none exist

removePropertySet(String) Method

public void removePropertySet(String name)
throws UnsupportedOperationException
Remove a PropertySet from the repository. If an implementation does not support this, an UnsupportedOperationException will be thrown. (some implementations may be read-only)

Parameters

name
the name of the PropertySet to remove

Exceptions

UnsupportedOperationException
if this is not supported