public class DefaultProfileTransaction extends java.lang.Object implements java.beans.PropertyChangeListener, ProfileTransaction
DEFAULT_VALUE
Constructor and Description |
---|
DefaultProfileTransaction(DefaultProfile profile) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener for changes to profile or bean properties of this
transaction.
|
void |
apply()
Applies this transaction to the profile from which it was created.
|
Profile |
createProfile(java.lang.String name)
Creates a profile from this transaction.
|
ExtensionBean |
getBean(java.lang.String id,
boolean force)
Gets a specific bean of this transaction.
|
BeanDefinition |
getDefinition(java.lang.String id)
Gets the definition of a specific bean of this transaction.
|
java.util.Collection<BeanDefinition> |
getDefinitions()
Gets the definitions of the beans of this transaction.
|
MultiMap<java.lang.String,ValueHandle> |
getPendingChangedValues()
Gets the changed bean properties, relative to the underlying profile, of
this transaction.
|
Profile |
getProfile()
Gets the profile which this transaction modifies.
|
boolean |
isEnabled(java.lang.String id)
Gets tbe enabled property of a specific bean of this transaction.
|
boolean |
isModified()
Gets whether profile or bean properties have been changed by this transaction.
|
boolean |
isModified(java.lang.String id)
Gets whether properties of a specific bean have been changed.
|
boolean |
isSealed()
Gets the sealed property of this transaction.
|
void |
propertyChange(java.beans.PropertyChangeEvent event) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener for changes to properties of beans of this transaction.
|
void |
revert()
Reverts changed bean properties to their initial values.
|
void |
setEnabled(java.lang.String id,
boolean enabled)
Sets tbe enabled property of a specific bean of this transaction.
|
void |
setProperties(Profile profile)
Sets all bean properties of this transaction from a profile.
|
void |
setProperties(Profile profile,
java.lang.String id)
Sets all bean properties of a specific bean of this transaction from a profile.
|
void |
setProperties(ProfileTransaction thatTransaction)
Sets all bean properties of this transaction from another transaction.
|
void |
setSealed(boolean newValue)
Sets the sealed property of this transaction.
|
java.lang.String |
toString() |
public DefaultProfileTransaction(DefaultProfile profile)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
ProfileTransaction
BeanDefinition
.addPropertyChangeListener
in interface ProfileTransaction
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
ProfileTransaction
removePropertyChangeListener
in interface ProfileTransaction
public Profile getProfile()
ProfileTransaction
getProfile
in interface ProfileTransaction
public java.util.Collection<BeanDefinition> getDefinitions()
ProfileTransaction
getDefinitions
in interface ProfileTransaction
public BeanDefinition getDefinition(java.lang.String id)
ProfileTransaction
getDefinition
in interface ProfileTransaction
id
- the id of the bean.public boolean isSealed()
ProfileTransaction
isSealed
in interface ProfileTransaction
public void setSealed(boolean newValue)
ProfileTransaction
setSealed
in interface ProfileTransaction
public boolean isEnabled(java.lang.String id)
ProfileTransaction
isEnabled
in interface ProfileTransaction
id
- the id of the bean.BeanDefinition.hasEnabledProperty()
public void setEnabled(java.lang.String id, boolean enabled)
ProfileTransaction
setEnabled
in interface ProfileTransaction
id
- the id of the bean.enabled
- the new value of the enabled property of the bean.public MultiMap<java.lang.String,ValueHandle> getPendingChangedValues()
ProfileTransaction
getPendingChangedValues
in interface ProfileTransaction
public ExtensionBean getBean(java.lang.String id, boolean force)
ProfileTransaction
getBean
in interface ProfileTransaction
id
- The id of the bean.force
- Whether to force the defining extension of the bean to load.public boolean isModified()
ProfileTransaction
isModified
in interface ProfileTransaction
public boolean isModified(java.lang.String id)
ProfileTransaction
isModified
in interface ProfileTransaction
public void apply()
ProfileTransaction
apply
in interface ProfileTransaction
public void revert()
ProfileTransaction
revert
in interface ProfileTransaction
public Profile createProfile(java.lang.String name)
ProfileTransaction
createProfile
in interface ProfileTransaction
name
- The name of the new profile.public void setProperties(Profile profile)
ProfileTransaction
setProperties
in interface ProfileTransaction
profile
- The profile supplying the property values to set.public void setProperties(Profile profile, java.lang.String id)
ProfileTransaction
setProperties
in interface ProfileTransaction
profile
- The profile supplying the property values to set.id
- The id of the bean.public void setProperties(ProfileTransaction thatTransaction)
ProfileTransaction
setProperties
in interface ProfileTransaction
thatTransaction
- The transaction supplying the property values to set.public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
public java.lang.String toString()
toString
in class java.lang.Object