org.openpermis.editor.policy.adapter
Class BasicAdapterTrader

java.lang.Object
  extended by org.openpermis.editor.policy.adapter.BasicAdapterTrader
All Implemented Interfaces:
AdapterTrader

public class BasicAdapterTrader
extends Object
implements AdapterTrader

A basic implementation of an AdapterTrader.

Since:
0.3.0

Field Summary
private  org.picocontainer.MutablePicoContainer pico
           
 
Constructor Summary
BasicAdapterTrader()
          Creates a basic adapter trader.
 
Method Summary
<T extends Adaptee<?>>
T
adaptTo(Object object, Class<T> adapteeType)
          Adapts an object to the adaptee type.
private static org.picocontainer.MutablePicoContainer createContainer(org.picocontainer.PicoContainer parent)
          Creates a pico container and fill it with all combinations of objects and adaptee types.
private static String createKey(Class<?> adapteeType, Class<?> objectType)
          Creates a unique key that identifies an objecgt/adapter type pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pico

private final org.picocontainer.MutablePicoContainer pico
Constructor Detail

BasicAdapterTrader

public BasicAdapterTrader()
Creates a basic adapter trader.

Since:
0.3.0
Method Detail

createContainer

private static final org.picocontainer.MutablePicoContainer createContainer(org.picocontainer.PicoContainer parent)
Creates a pico container and fill it with all combinations of objects and adaptee types.

Since:
0.3.0

createKey

private static String createKey(Class<?> adapteeType,
                                Class<?> objectType)
Creates a unique key that identifies an objecgt/adapter type pair.

Parameters:
adapteeType - the type of adapter for which to retrieve the key.
objectType - the object type, may be null for default type.
Returns:
the key requested, never null.
Since:
0.3.0

adaptTo

public <T extends Adaptee<?>> T adaptTo(Object object,
                                        Class<T> adapteeType)
Description copied from interface: AdapterTrader
Adapts an object to the adaptee type.

Specified by:
adaptTo in interface AdapterTrader
Parameters:
object - the object to adapt.
adapteeType - the type to adapt to.
Since:
0.3.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG