Class Properties
- java.lang.Object
-
- org.eclipse.net4j.util.event.Notifier
-
- org.eclipse.net4j.util.lifecycle.Lifecycle
-
- org.eclipse.emf.ecp.internal.core.util.Registry<java.util.Map.Entry<java.lang.String,java.lang.String>,ECPPropertiesObserver>
-
- org.eclipse.emf.ecp.internal.core.util.Properties
-
- All Implemented Interfaces:
ECPProperties
,ECPDisposable.DisposeListener
,org.eclipse.net4j.util.event.INotifier
,org.eclipse.net4j.util.event.INotifier.INotifier2
,org.eclipse.net4j.util.lifecycle.IDeactivateable
,org.eclipse.net4j.util.lifecycle.ILifecycle
,org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
public class Properties extends Registry<java.util.Map.Entry<java.lang.String,java.lang.String>,ECPPropertiesObserver> implements ECPProperties
- Author:
- Eike Stepper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Properties.Property
-
Constructor Summary
Constructors Constructor Description Properties()
Default constructor.Properties(java.io.ObjectInput in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(java.lang.String key, java.lang.String value)
Adds a key-value-pair.ECPProperties
copy()
Creates a copy of the current set of properties.protected java.lang.String
getElementName(java.util.Map.Entry<java.lang.String,java.lang.String> element)
protected java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>>
getElementsToWrite()
java.util.Set<java.lang.String>
getKeys()
All stored keys.java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>>
getProperties()
All Properties.java.lang.String
getValue(java.lang.String name)
Get the value of a property identified by this key.boolean
hasProperties()
Whether any properties are stored.protected void
notifyObservers(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> oldProperties, java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> newProperties)
Notifies observers that the elements in the registry have changed.void
removeProperty(java.lang.String key)
Removes a property.void
write(java.io.ObjectOutput out)
-
Methods inherited from class org.eclipse.emf.ecp.internal.core.util.Registry
addObserver, changeElements, disposed, doChangeElements, elementsChanged, getElement, getElementCount, getElementNames, getElements, hasElement, hasElements, isDisposingElement, isRemoveDisposedElements, removeObserver
-
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
-
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecp.core.util.ECPProperties
addObserver, removeObserver
-
-
-
-
Method Detail
-
write
public void write(java.io.ObjectOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
addProperty
public void addProperty(java.lang.String key, java.lang.String value)
Adds a key-value-pair.- Specified by:
addProperty
in interfaceECPProperties
- Parameters:
key
- the key of the propertyvalue
- the value of the property
-
removeProperty
public void removeProperty(java.lang.String key)
Removes a property.- Specified by:
removeProperty
in interfaceECPProperties
- Parameters:
key
- of the property to remove
-
getValue
public java.lang.String getValue(java.lang.String name)
Get the value of a property identified by this key.- Specified by:
getValue
in interfaceECPProperties
- Parameters:
name
- the key of the property to find- Returns:
- the value of the property identified by the key or null
-
getKeys
public java.util.Set<java.lang.String> getKeys()
All stored keys.- Specified by:
getKeys
in interfaceECPProperties
- Returns:
- an array of all keys
-
getProperties
public java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> getProperties()
All Properties.- Specified by:
getProperties
in interfaceECPProperties
- Returns:
- an array of Key-Value-Pairs
-
hasProperties
public boolean hasProperties()
Whether any properties are stored.- Specified by:
hasProperties
in interfaceECPProperties
- Returns:
- true if at least 1 property was added, false otherwise
-
copy
public ECPProperties copy()
Creates a copy of the current set of properties.- Specified by:
copy
in interfaceECPProperties
- Returns:
- the copy of the current properties
-
getElementName
protected java.lang.String getElementName(java.util.Map.Entry<java.lang.String,java.lang.String> element)
- Specified by:
getElementName
in classRegistry<java.util.Map.Entry<java.lang.String,java.lang.String>,ECPPropertiesObserver>
- Parameters:
element
- the element to retrieve a name for.- Returns:
- the name of an element
-
getElementsToWrite
protected java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> getElementsToWrite()
-
notifyObservers
protected void notifyObservers(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> oldProperties, java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> newProperties) throws java.lang.Exception
Description copied from class:Registry
Notifies observers that the elements in the registry have changed.- Specified by:
notifyObservers
in classRegistry<java.util.Map.Entry<java.lang.String,java.lang.String>,ECPPropertiesObserver>
- Parameters:
oldProperties
- The old collection of elementsnewProperties
- The new collection of elements- Throws:
java.lang.Exception
-
-