public class DefaultProfile extends Profile
| Constructor and Description |
|---|
DefaultProfile(ProfileDefinition definition, Profile profile) |
DefaultProfile(ProfileDefinition definition, java.lang.String name, java.net.URL url)
Creates a new predefined profile with all registered bean definitions configured from a profile file.
|
DefaultProfile(Profile profile, java.net.URL url) |
DefaultProfile(java.lang.String name, boolean sealed, BeanDefinition[] beans, java.lang.String... ids)
Creates a new
Profile with the beans with specified definitions included and the beans with specified ids enabled. |
DefaultProfile(java.lang.String name, java.net.URL url)
Creates a new profile with all registered analyzers configured from a profile file.
|
DefaultProfile(java.net.URL url) |
DefaultProfile(java.net.URL url, boolean seal, BeanDefinition... definitions) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener to be notified when changes are applied to this profile.
|
void |
applyChanges(ProfileTransaction transaction)
Apply the changes in a transaction to this profile.
|
ExtensionBean |
createBean(BeanDefinition definition, boolean force, java.util.Map<java.lang.String,ExtensionBean> context)
Creates an instance of a bean in this profile.
|
java.util.Map<java.lang.String,ExtensionBean> |
createBeans(boolean force)
Creates instances of all beans in this profile.
|
ProfileTransaction |
createTransaction()
Creates a transaction for this profile.
|
boolean |
equals(java.lang.Object object) |
ValueHandle |
getChangedValue(java.lang.String id, java.lang.String propertyName)
Gets the value of a property of a bean of this profile changed from its default value, null if not changed.
|
MultiMap<java.lang.String,ValueHandle> |
getChangedValues()
Gets the properties of beans of this profile changed from their default values.
|
java.util.Collection<ValueHandle> |
getChangedValues(java.lang.String id)
Gets the properties of a bean of this profile changed from their default values, or null if none.
|
java.lang.Object |
getDefaultValue(BeanDefinition definition, java.lang.String propertyName)
Gets the default value of a property of a bean of this profile.
|
ProfileDefinition |
getDefinition()
Gets the definition of this profile, or null if not a predefined profile.
|
BeanDefinition |
getDefinition(java.lang.String id)
Gets the definition of a specified bean in this profile, or null if none.
|
java.util.Collection<BeanDefinition> |
getDefinitions()
Gets the definitions of all beans in this profile.
|
java.lang.String |
getId()
Gets the id of this profile, or null if not a predefined profile.
|
java.lang.String |
getName()
Gets the name of this profile.
|
java.net.URL |
getURL()
Gets the URL from which to load properties of this profile, or null if this profile is not associated with a file.
|
int |
hashCode() |
boolean |
isEnabled(java.lang.String id)
Gets whether a bean in this profile is enabled.
|
boolean |
isSealed()
Gets whether this profile is sealed.
|
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener to be notified when changes are applied to this profile.
|
void |
save(java.net.URL url)
Saves this profile.
|
java.lang.String |
toString() |
public DefaultProfile(java.net.URL url)
throws java.io.IOException
java.io.IOException
public DefaultProfile(java.net.URL url,
boolean seal,
BeanDefinition... definitions)
throws java.io.IOException
java.io.IOException
public DefaultProfile(java.lang.String name,
java.net.URL url)
throws java.io.IOException
name - The name of the profile.url - The url of a profile file.java.io.IOException - if loading from the profile file fails.public DefaultProfile(ProfileDefinition definition, java.lang.String name, java.net.URL url) throws java.io.IOException
definition - The definition of this profile.name - The name of the profile.url - The url of a profile file.java.io.IOException - if loading from the profile file fails.
public DefaultProfile(java.lang.String name,
boolean sealed,
BeanDefinition[] beans,
java.lang.String... ids)
Profile with the beans with specified definitions included and the beans with specified ids enabled. If no ids are specified, none are enabled.name - The name of the profile.sealed - Whether the profile is sealed.beans - The bean definitions for the profile.ids - The bean definitions to enable for the profile.public DefaultProfile(Profile profile, java.net.URL url)
public DefaultProfile(ProfileDefinition definition, Profile profile)
public ProfileDefinition getDefinition()
ProfilegetDefinition in class Profilepublic java.lang.String getId()
Profilepublic java.lang.String getName()
Profilepublic java.net.URL getURL()
Profilepublic java.util.Collection<BeanDefinition> getDefinitions()
ProfilegetDefinitions in class Profilepublic BeanDefinition getDefinition(java.lang.String id)
ProfilegetDefinition in class Profileid - the id of the bean.public boolean isSealed()
Profilepublic java.util.Map<java.lang.String,ExtensionBean> createBeans(boolean force)
ProfileWhen force is true, loading classes is first tried with the Audit class loader before an unloaded extension is loaded.
createBeans in class Profileforce - Whether to load the extension defining this bean if needed.public ExtensionBean createBean(BeanDefinition definition, boolean force, java.util.Map<java.lang.String,ExtensionBean> context)
ProfileWhen force is true, loading classes is first tried with the Audit class loader before an unloaded extension is loaded.
The created bean is added to the context map, referenced beans are taken from the context map if present, otherwise they are created and added to the context map.
createBean in class Profiledefinition - The definition of the bean to load.force - Whether to load the extension defining this bean if needed.context - Context map for the created bean.public java.lang.Object getDefaultValue(BeanDefinition definition, java.lang.String propertyName) throws java.beans.IntrospectionException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
ProfilegetDefaultValue in class Profiledefinition - The definition of the bean.propertyName - The name of the property.java.beans.IntrospectionExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionpublic boolean isEnabled(java.lang.String id)
Profilepublic MultiMap<java.lang.String,ValueHandle> getChangedValues()
ProfilegetChangedValues in class Profilepublic java.util.Collection<ValueHandle> getChangedValues(java.lang.String id)
ProfilegetChangedValues in class Profilepublic ValueHandle getChangedValue(java.lang.String id, java.lang.String propertyName)
ProfilegetChangedValue in class Profileid - the id of the bean.propertyName - the name of the property.public ProfileTransaction createTransaction()
ProfilecreateTransaction in class Profilepublic void addChangeListener(javax.swing.event.ChangeListener listener)
ProfileaddChangeListener in class Profilepublic void removeChangeListener(javax.swing.event.ChangeListener listener)
ProfileremoveChangeListener in class Profilepublic void applyChanges(ProfileTransaction transaction)
ProfileapplyChanges in class Profilepublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object