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> T
getProperty(PropertyDescriptor<T> desc)
          Returns a context property or null if it cannot be found.
(package private)
<T> T
getProperty(String propertyName, Class<T> type)
          Returns a context property or null if it cannot be found.
(package private)
<T> void
setProperty(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

getProperty

public <T> T getProperty(PropertyDescriptor<T> desc)
              throws NullPointerException
Returns a context property 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

<T> T getProperty(String propertyName,
                  Class<T> type)
        throws NullPointerException
Returns a context 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 value
Throws:
NullPointerException - if the descriptor 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

setProperty

<T> void setProperty(PropertyDescriptor<T> desc,
                     String value)
           throws NullPointerException,
                  IllegalArgumentException
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
IllegalArgumentException - if the string value cannot be converted to the property type


Copyright © 2014 eXo Platform SAS. All Rights Reserved.