org.apache.felix.ipojo.architecture
Class PropertyDescription

java.lang.Object
  extended by org.apache.felix.ipojo.architecture.PropertyDescription

public class PropertyDescription
extends Object

Property Information.

Author:
Felix Project Team

Constructor Summary
PropertyDescription(Property prop)
          Constructor.
PropertyDescription(String name, String type, String value)
          Constructor.
PropertyDescription(String name, String type, String value, boolean immutable)
          Constructor.
 
Method Summary
 String getName()
          Gets the current property name.
 Object getObjectValue(BundleContext context)
          Gets the object value of the current immutable property.
 String getType()
          Gets the current property type.
 String getValue()
          Gets the current property value.
 boolean isImmutable()
          Is the property immutable.
 boolean isMandatory()
          Is the property mandatory.
 void setMandatory()
          Sets the property as mandatory.
 void setValue(Object value)
          Sets the property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyDescription

public PropertyDescription(String name,
                           String type,
                           String value)
Constructor.

Parameters:
name - the name of the property
type - the type of the property
value - the default value of the property, can be null

PropertyDescription

public PropertyDescription(Property prop)
Constructor.

Parameters:
prop - the attache Property object.

PropertyDescription

public PropertyDescription(String name,
                           String type,
                           String value,
                           boolean immutable)
Constructor.

Parameters:
name - the name of the property
type - the type of the property
value - the default value (String form) of the property, can be null
immutable - the property is immutable.
Method Detail

getName

public String getName()
Gets the current property name.

Returns:
the property name.

getType

public String getType()
Gets the current property type.

Returns:
the property type.

getValue

public String getValue()
Gets the current property value.

Returns:
the default value for the property, null if the property hasn't a value..

setValue

public void setValue(Object value)
Sets the property value. This method can only be called on 'living' property (properties with a Property object).

Parameters:
value - the new value.

isImmutable

public boolean isImmutable()
Is the property immutable.

Returns:
true if the property is immutable.

setMandatory

public void setMandatory()
Sets the property as mandatory.


isMandatory

public boolean isMandatory()
Is the property mandatory.

Returns:
true if the property is mandatory, false otherwise.

getObjectValue

public Object getObjectValue(BundleContext context)
Gets the object value of the current immutable property.

Parameters:
context - the bundle context to use to load classes.
Returns:
the object value of the current property or null if the current value is null.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.