|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.command.AbstractCommand
org.openpermis.editor.policy.command.PropertyChangeCommand
public class PropertyChangeCommand
Command that performs a property change.
Field Summary | |
---|---|
private Object |
bean
The bean to modify. |
private Object |
newValue
The value to set at the bean. |
private Object |
oldValue
The old value of the bean. |
private String |
property
The property to set. |
Constructor Summary | |
---|---|
PropertyChangeCommand(Object bean,
String property,
Object value)
Creates a property change command for the specified bean and property. |
Method Summary | |
---|---|
private static String |
createCommandName(Object bean,
String property)
Creates a name for the command. |
void |
execute(org.openpermis.policy.bean.PolicyBean policy)
Executes the command and stores necessary information to undo any changes. |
void |
undo(org.openpermis.policy.bean.PolicyBean policy)
Reverts any changes performed in Command.execute(org.openpermis.policy.bean.PolicyBean) . |
private void |
validate()
Validates that the bean specified has the given property with set and get access. |
Methods inherited from class org.openpermis.editor.policy.command.AbstractCommand |
---|
getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Object bean
private final String property
private final Object newValue
private Object oldValue
Constructor Detail |
---|
public PropertyChangeCommand(Object bean, String property, Object value)
bean
- the bean to modify, must not be null
.property
- the property to set, must not be null
or empty.value
- the value to set at the property.Method Detail |
---|
private static final String createCommandName(Object bean, String property)
bean
- the bean to modify.property
- the property to set.
private void validate()
IllegalArgumentException
- if the bean/property combo is invalid.public void execute(org.openpermis.policy.bean.PolicyBean policy)
Command
execute
in interface Command
execute
in class AbstractCommand
policy
- the policy to execute the command on.public void undo(org.openpermis.policy.bean.PolicyBean policy)
Command
Command.execute(org.openpermis.policy.bean.PolicyBean)
.
undo
in interface Command
undo
in class AbstractCommand
policy
- the policy to revert.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG