org.constretto
Interface ConstrettoConfiguration

All Superinterfaces:
java.lang.Iterable<Property>

public interface ConstrettoConfiguration
extends java.lang.Iterable<Property>

Client interface.

Author:
Kaare Nilsen

Method Summary
 void addTag(java.lang.String... newtag)
           
<T> T
as(java.lang.Class<T> configurationClass)
           
 ConstrettoConfiguration at(java.lang.String expression)
           
<K> K
evaluateTo(java.lang.Class<K> targetClass, java.lang.String expression)
          Looks up an expression in the configuration.
<K> K
evaluateTo(java.lang.String expression, K defaultValue)
          Looks up an expression in the configuration.
 java.lang.Boolean evaluateToBoolean(java.lang.String expression)
           
 java.lang.Byte evaluateToByte(java.lang.String expression)
           
 java.lang.Double evaluateToDouble(java.lang.String expression)
           
 java.lang.Float evaluateToFloat(java.lang.String expression)
           
 java.lang.Integer evaluateToInt(java.lang.String expression)
           
 java.lang.Long evaluateToLong(java.lang.String expression)
           
 java.lang.Short evaluateToShort(java.lang.String expression)
           
 java.lang.String evaluateToString(java.lang.String expression)
           
 ConstrettoConfiguration from(java.lang.String expression)
           
 boolean hasValue(java.lang.String expression)
           
<T> T
on(T objectToConfigure)
           
 void removeTag(java.lang.String... newTag)
           
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

evaluateTo

<K> K evaluateTo(java.lang.String expression,
                 K defaultValue)
             throws ConstrettoExpressionException
Looks up an expression in the configuration.

Type Parameters:
K - The target Type
Parameters:
expression - The expression to look up
defaultValue - The value to return of no value found for the expression
Returns:
The converted value for the expression, or the passed default value if expression not found, or conversion error occured.
Throws:
ConstrettoExpressionException - If a valid converter is not found for the target Type

evaluateTo

<K> K evaluateTo(java.lang.Class<K> targetClass,
                 java.lang.String expression)
             throws ConstrettoExpressionException,
                    ConstrettoConversionException
Looks up an expression in the configuration.

Type Parameters:
K - the target Type
Parameters:
targetClass - the class to convert the value
expression - the expression to look up
Returns:
The converted value for the expression.
Throws:
ConstrettoExpressionException - if the expression is malformed, or a value not found for the expression
ConstrettoConversionException - If a conversion error occures for the resolved value

evaluateToString

java.lang.String evaluateToString(java.lang.String expression)
                                  throws ConstrettoException
Throws:
ConstrettoException

evaluateToBoolean

java.lang.Boolean evaluateToBoolean(java.lang.String expression)
                                    throws ConstrettoException
Throws:
ConstrettoException

evaluateToDouble

java.lang.Double evaluateToDouble(java.lang.String expression)
                                  throws ConstrettoException
Throws:
ConstrettoException

evaluateToLong

java.lang.Long evaluateToLong(java.lang.String expression)
                              throws ConstrettoException
Throws:
ConstrettoException

evaluateToFloat

java.lang.Float evaluateToFloat(java.lang.String expression)
                                throws ConstrettoException
Throws:
ConstrettoException

evaluateToInt

java.lang.Integer evaluateToInt(java.lang.String expression)
                                throws ConstrettoException
Throws:
ConstrettoException

evaluateToShort

java.lang.Short evaluateToShort(java.lang.String expression)
                                throws ConstrettoException
Throws:
ConstrettoException

evaluateToByte

java.lang.Byte evaluateToByte(java.lang.String expression)
                              throws ConstrettoException
Throws:
ConstrettoException

as

<T> T as(java.lang.Class<T> configurationClass)
     throws ConstrettoException
Throws:
ConstrettoException

on

<T> T on(T objectToConfigure)
     throws ConstrettoException
Throws:
ConstrettoException

at

ConstrettoConfiguration at(java.lang.String expression)
                           throws ConstrettoException
Throws:
ConstrettoException

from

ConstrettoConfiguration from(java.lang.String expression)
                             throws ConstrettoException
Throws:
ConstrettoException

hasValue

boolean hasValue(java.lang.String expression)
                 throws ConstrettoException
Throws:
ConstrettoException

addTag

void addTag(java.lang.String... newtag)
            throws ConstrettoException
Throws:
ConstrettoException

removeTag

void removeTag(java.lang.String... newTag)
               throws ConstrettoException
Throws:
ConstrettoException


Copyright © 2008-2011. All Rights Reserved.