public class PropertySheet
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMP_LOG_LEVEL |
Constructor and Description |
---|
PropertySheet(java.lang.Class<? extends Configurable> confClass,
java.lang.String name,
ConfigurationManager cm,
RawPropertyData rpd) |
PropertySheet(Configurable configurable,
java.lang.String name,
RawPropertyData rpd,
ConfigurationManager ConfigurationManager) |
Modifier and Type | Method and Description |
---|---|
protected PropertySheet |
clone() |
boolean |
equals(java.lang.Object obj)
Returns true if two property sheet define the same object in terms of configuration.
|
java.lang.Boolean |
getBoolean(java.lang.String name)
Gets the value associated with this name
|
Configurable |
getComponent(java.lang.String name)
Gets a component associated with the given parameter name.
|
java.lang.Class<? extends Configurable> |
getComponentClass(java.lang.String propName)
Returns the class of of a registered component property without instantiating it.
|
<T> java.util.List<T> |
getComponentList(java.lang.String name,
java.lang.Class<T> tclass)
Gets a list of components associated with the given parameter name
|
java.lang.Class<? extends Configurable> |
getConfigurableClass() |
double |
getDouble(java.lang.String name)
Gets the value associated with this name
|
float |
getFloat(java.lang.String name)
Gets the value associated with this name
|
java.lang.String |
getInstanceName() |
int |
getInt(java.lang.String name)
Gets the value associated with this name
|
java.util.logging.Logger |
getLogger()
Returns a logger to use for this configurable component.
|
Configurable |
getOwner() |
S4PropWrapper |
getProperty(java.lang.String name,
java.lang.Class<?> propertyClass)
Returns the property names
name which is still wrapped into the annotation instance. |
java.lang.Object |
getRaw(java.lang.String name)
Gets the raw value associated with this name
|
java.lang.Object |
getRawNoReplacement(java.lang.String name)
Gets the raw value associated with this name, no global symbol replacement is performed.
|
java.util.Collection<java.lang.String> |
getRegisteredProperties() |
java.util.List<java.net.URL> |
getResourceList(java.lang.String name)
Parses the string with multiple URL's separated by ;.
|
java.lang.String |
getString(java.lang.String name)
Gets the value associated with this name
|
java.util.List<java.lang.String> |
getStringList(java.lang.String name)
Gets a list of float numbers associated with the given parameter name
|
PropertyType |
getType(java.lang.String propName)
Returns the type of the given property.
|
java.util.Collection<java.lang.String> |
getUndefinedMandatoryProps() |
int |
hashCode() |
boolean |
isInstanciated() |
void |
setBoolean(java.lang.String name,
java.lang.Boolean value)
Sets the given property to the given name
|
void |
setCM(ConfigurationManager cm) |
void |
setComponent(java.lang.String name,
java.lang.String cmName,
Configurable value)
Sets the given property to the given name
|
void |
setComponentList(java.lang.String name,
java.util.List<java.lang.String> valueNames,
java.util.List<Configurable> value)
Sets the given property to the given name
|
void |
setDouble(java.lang.String name,
double value)
Sets the given property to the given name
|
void |
setInstanceName(java.lang.String newInstanceName) |
void |
setInt(java.lang.String name,
int value)
Sets the given property to the given name
|
void |
setString(java.lang.String name,
java.lang.String value)
Sets the given property to the given name
|
java.lang.String |
toString() |
boolean |
validate()
Validates a configuration, by ensuring that only valid property-names have been used to configure the component.
|
public static final java.lang.String COMP_LOG_LEVEL
public PropertySheet(Configurable configurable, java.lang.String name, RawPropertyData rpd, ConfigurationManager ConfigurationManager)
public PropertySheet(java.lang.Class<? extends Configurable> confClass, java.lang.String name, ConfigurationManager cm, RawPropertyData rpd)
public S4PropWrapper getProperty(java.lang.String name, java.lang.Class<?> propertyClass) throws PropertyException
name
which is still wrapped into the annotation instance.name
- the name of the propertypropertyClass
- the class of the propertyPropertyException
- if there is no such propertypublic java.lang.String getString(java.lang.String name) throws PropertyException
name
- the namePropertyException
public int getInt(java.lang.String name) throws PropertyException
name
- the namePropertyException
- if the named property is not of this typepublic float getFloat(java.lang.String name) throws PropertyException
name
- the namePropertyException
- if the named property is not of this typepublic double getDouble(java.lang.String name) throws PropertyException
name
- the namePropertyException
- if the named property is not of this typepublic java.lang.Boolean getBoolean(java.lang.String name) throws PropertyException
name
- the namePropertyException
- if the named property is not of this typepublic Configurable getComponent(java.lang.String name) throws PropertyException
name
- the parameter namePropertyException
- if the component does not exist or is of the wrong type.public java.lang.Class<? extends Configurable> getComponentClass(java.lang.String propName)
propName
- the name of the propertypublic java.util.List<java.lang.String> getStringList(java.lang.String name) throws InternalConfigurationException
name
- the parameter nameInternalConfigurationException
- if parameters are not double values.public <T> java.util.List<T> getComponentList(java.lang.String name, java.lang.Class<T> tclass) throws InternalConfigurationException
T
- parent componentname
- the parameter nametclass
- the class of the list elementsPropertyException
- if the component does not exist or is of the wrong type.InternalConfigurationException
public java.util.List<java.net.URL> getResourceList(java.lang.String name)
name
- list with URL'spublic java.lang.String getInstanceName()
public void setInstanceName(java.lang.String newInstanceName)
public boolean isInstanciated()
public Configurable getOwner()
public java.util.Collection<java.lang.String> getUndefinedMandatoryProps()
public java.lang.Class<? extends Configurable> getConfigurableClass()
public void setString(java.lang.String name, java.lang.String value) throws PropertyException
name
- the simple property namevalue
- to setPropertyException
- if error occurredpublic void setInt(java.lang.String name, int value) throws PropertyException
name
- the simple property namevalue
- the value for the propertyPropertyException
public void setDouble(java.lang.String name, double value) throws PropertyException
name
- the simple property namevalue
- the value for the propertyPropertyException
public void setBoolean(java.lang.String name, java.lang.Boolean value) throws PropertyException
name
- the simple property namevalue
- the value for the propertyPropertyException
public void setComponent(java.lang.String name, java.lang.String cmName, Configurable value) throws PropertyException
name
- the simple property namecmName
- the name of the configurable within the configuration manager (required for serialization only)value
- the value for the propertyPropertyException
public void setComponentList(java.lang.String name, java.util.List<java.lang.String> valueNames, java.util.List<Configurable> value) throws PropertyException
name
- the simple property namevalueNames
- the list of names of the configurables within the configuration manager (required for
serialization only)value
- the value for the propertyPropertyException
public java.lang.Object getRaw(java.lang.String name)
name
- the namepublic java.lang.Object getRawNoReplacement(java.lang.String name)
name
- the namepublic PropertyType getType(java.lang.String propName)
propName
- the name of the propertypublic java.util.logging.Logger getLogger()
implementation note: the logger became configured within the constructor of the parenting configuration manager.
PropertyException
- if an error occurspublic java.util.Collection<java.lang.String> getRegisteredProperties()
public void setCM(ConfigurationManager cm)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected PropertySheet clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean validate()