org.crsh.plugin
Class PropertyManager

java.lang.Object
  extended by org.crsh.plugin.PropertyManager

 class PropertyManager
extends Object

Author:
Julien Viet

Field Summary
private static Logger log
          .
private  Map<String,Property<?>> properties
          .
 
Constructor Summary
PropertyManager()
           
 
Method Summary
<T> Property<T>
getProperty(PropertyDescriptor<T> desc)
          Returns a property or null if it cannot be found.
private
<T> Property<T>
getProperty(String propertyName, Class<T> type)
          Returns a property or null if it cannot be found.
<T> T
getPropertyValue(PropertyDescriptor<T> desc)
          Returns a property value or null if it cannot be found.
(package private)
<T> void
parseProperty(PropertyDescriptor<T> desc, String value)
          Set a context property to a new value.
(package private)
<T> void
setProperty(PropertyDescriptor<T> desc, T value)
          Set a context property to a new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log
.


properties

private final Map<String,Property<?>> properties
.

Constructor Detail

PropertyManager

PropertyManager()
Method Detail

getPropertyValue

public <T> T getPropertyValue(PropertyDescriptor<T> desc)
                   throws NullPointerException
Returns a property value or null if it cannot be found.

Type Parameters:
T - the property parameter type
Parameters:
desc - the property descriptor
Returns:
the property value
Throws:
NullPointerException - if the descriptor argument is null

getProperty

public <T> Property<T> getProperty(PropertyDescriptor<T> desc)
                        throws NullPointerException
Returns a property or null if it cannot be found.

Type Parameters:
T - the property parameter type
Parameters:
desc - the property descriptor
Returns:
the property object
Throws:
NullPointerException - if the descriptor argument is null

getProperty

private <T> Property<T> getProperty(String propertyName,
                                    Class<T> type)
                         throws NullPointerException
Returns a property or null if it cannot be found.

Type Parameters:
T - the property parameter type
Parameters:
propertyName - the name of the property
type - the property type
Returns:
the property object
Throws:
NullPointerException - if any argument is null

setProperty

<T> void setProperty(PropertyDescriptor<T> desc,
                     T value)
           throws NullPointerException
Set a context property to a new value. If the provided value is null, then the property is removed.

Type Parameters:
T - the property parameter type
Parameters:
desc - the property descriptor
value - the property value
Throws:
NullPointerException - if the descriptor argument is null

parseProperty

<T> void parseProperty(PropertyDescriptor<T> desc,
                       String value)
             throws NullPointerException,
                    IllegalArgumentException
Set a context property to a new value.

Type Parameters:
T - the property parameter type
Parameters:
desc - the property descriptor
value - the property value
Throws:
NullPointerException - if the descriptor argument or the value is null
IllegalArgumentException - if the string value cannot be converted to the property type


Copyright © 2015 eXo Platform SAS. All Rights Reserved.