|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.tutorial.property.expressions.PropertyExpressionsTutorial
@Document(title="Property Expressions", sortKey="basics0060") @DocCategory(value="basics") public class PropertyExpressionsTutorial
This tutorial introduces how to add expressions to the property declaration.
Expressions allow to declare default values and to construct property values out of other property values.
Constructor Summary | |
---|---|
PropertyExpressionsTutorial() |
Method Summary | |
---|---|
void |
composedUrlValue() The URL property of homePageUrl is per default constructed by host and port . |
void |
overrideValues() If the default values of properties are overridden, the expressions take the correct current value (as you would expect). |
void |
overrideValuesAtRuntime() So here is the example where we change a read-write property, using a properties key. |
void |
overrideValuesAtRuntimeFailsForReadOnlyProperties() If the property is changed, the composed property also reflects the change (as one would expect). |
void |
setUp() |
void |
simpleIntValue() The property port defaults to 808 . |
void |
simpleStringValue() The property host defaults to localhost . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyExpressionsTutorial()
Method Detail |
---|
public void setUp()
@DocSection public void simpleStringValue()
The property host
defaults to localhost
.
@DocSection public void simpleIntValue()
The property port
defaults to 808
.
@DocSection public void composedUrlValue() throws MalformedURLException
The URL property of homePageUrl
is per default constructed by host
and port
.
MalformedURLException
@DocSection public void overrideValues() throws MalformedURLException
If the default values of properties are overridden, the expressions take the correct current value (as you would expect).
The properties definition is this:
Here is how we access the home page URL property:
MalformedURLException
@DocSection public void overrideValuesAtRuntimeFailsForReadOnlyProperties() throws MalformedURLException
If the property is changed, the composed property also reflects the change (as one would expect). But the property has to be marked as AccessType.READ_WRITE
.
MalformedURLException
@DocSection public void overrideValuesAtRuntime() throws MalformedURLException
So here is the example where we change a read-write property, using a properties key.
MalformedURLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |