org.openliberty.openaz.pep
Class SimpleJavaObjectMapper

java.lang.Object
  extended by org.openliberty.openaz.pep.SimpleJavaObjectMapper
All Implemented Interfaces:
JavaObjectMapper

public class SimpleJavaObjectMapper
extends java.lang.Object
implements JavaObjectMapper

Default implementation of JavObjectMapper. It supports the mapping of

to AzWrapperRequestObject

Author:
Josh Bregman, Rich Levinson, Prateek Mishra

Constructor Summary
SimpleJavaObjectMapper()
          Create a SimpleJavaObjectMapper
 
Method Summary
 boolean canMapObject(java.lang.Object obj)
          Determines if this Mapper can map the type of class that that is passed in as a parameter.
 java.util.Set<java.lang.Class> getSupportedClasses()
          Returns the set of class objects supported by this Mapper
<T extends java.lang.Enum<T>>
AzWrapperRequestObject<T>
map(java.lang.Object javaObject, AzWrapperRequestObject<T> azWrapperObject)
          Maps a Java Object to one or more AzAttributes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJavaObjectMapper

public SimpleJavaObjectMapper()
Create a SimpleJavaObjectMapper

Method Detail

getSupportedClasses

public java.util.Set<java.lang.Class> getSupportedClasses()
Returns the set of class objects supported by this Mapper

Specified by:
getSupportedClasses in interface JavaObjectMapper
Returns:
a set of class objects

canMapObject

public boolean canMapObject(java.lang.Object obj)
Determines if this Mapper can map the type of class that that is passed in as a parameter. Basically involves checking that the class matches one of a set of known classes that can be mapped.

Specified by:
canMapObject in interface JavaObjectMapper
Parameters:
obj - Java Object (ex: Permission) which needs to be mapped to an AzWrapperRequestObject
Returns:
true if this JavaObjectMapper can map the obj, false otherwise

map

public <T extends java.lang.Enum<T>> AzWrapperRequestObject<T> map(java.lang.Object javaObject,
                                                                   AzWrapperRequestObject<T> azWrapperObject)
                                                        throws PepException
Maps a Java Object to one or more AzAttributes. In general a Java Object can contain several attributes that may be needed as AzAttributes in the decision process.

Specified by:
map in interface JavaObjectMapper
Returns:
Throws:
PepException