|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acegisecurity.acls.objectidentity.ObjectIdentityImpl
public class ObjectIdentityImpl
Simple implementation of AclObjectIdentity
.
Uses String
s to store the identity of the domain object instance. Also offers a constructor that uses
reflection to build the identity information.
Constructor Summary | |
---|---|
ObjectIdentityImpl(java.lang.Class javaType,
java.io.Serializable identifier)
|
|
ObjectIdentityImpl(java.lang.Object object)
Creates the ObjectIdentityImpl based on the passed
object instance. |
|
ObjectIdentityImpl(java.lang.String javaType,
java.io.Serializable identifier)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object arg0)
Important so caching operates properly. |
java.io.Serializable |
getIdentifier()
Obtains the actual identifier. |
java.lang.Class |
getJavaType()
Obtains the Java type represented by the domain object. |
int |
hashCode()
Important so caching operates properly. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ObjectIdentityImpl(java.lang.String javaType, java.io.Serializable identifier)
public ObjectIdentityImpl(java.lang.Class javaType, java.io.Serializable identifier)
public ObjectIdentityImpl(java.lang.Object object) throws IdentityUnavailableException
ObjectIdentityImpl
based on the passed
object instance. The passed object must provide a getId()
method, otherwise an exception will be thrown. The object passed will
be considered the javaType
, so if more control is required,
an alternate constructor should be used instead.
object
- the domain object instance to create an identity for
IdentityUnavailableException
- if identity could not be extractedMethod Detail |
---|
public boolean equals(java.lang.Object arg0)
Considers an object of the same class equal if it has the same
classname
and id
properties.
equals
in interface ObjectIdentity
equals
in class java.lang.Object
arg0
- object to compare
true
if the presented object matches this objectpublic java.io.Serializable getIdentifier()
ObjectIdentity
javaType
.Because ACLs are largely immutable, it is strongly recommended to use a synthetic identifier (such as a database sequence number for the primary key). Do not use an identifier with business meaning, as that business meaning may change.
getIdentifier
in interface ObjectIdentity
javaType
public java.lang.Class getJavaType()
ObjectIdentity
getJavaType
in interface ObjectIdentity
public int hashCode()
hashCode
in interface ObjectIdentity
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |