|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.tutorial.property.list.ListPropertyTutorial
@Document(title="List Properties", sortKey="basics0100") @DocCategory(value="basics") public class ListPropertyTutorial
This tutorial introduces how declare properties for list values.
List of properties are defined like this:
Constructor Summary | |
---|---|
ListPropertyTutorial() |
Method Summary | |
---|---|
void |
blankAsSeparator() Therefore the pipe is also a valid delimiter. |
void |
pipeAsSeparator() Therefore the pipe is also a valid delimiter. |
void |
propertyWithSpecialStrings() Every non-alpha-numeric character serves as a delimiter. |
void |
propertyWithValueOfTypeListOfEnums() Lists of enums are declared like this: Accessing a list of values is straight forward. |
void |
propertyWithValueOfTypeListOfInteger() Lists of integers are declared like this: Accessing a list of values is straight forward. |
void |
propertyWithValueOfTypeListOfString() Lists of strings are declared like this: Accessing a list of values is straight forward. |
void |
propertyWithValueOfTypeListOfUrl() Lists of URLs are declared like this: Accessing a list of values is straight forward. |
void |
separators() The elements are split by any non-alphanumeric character. |
void |
setUp() |
void |
urlsSeparatedByNewlines() But you may also separate URLs by whitespaces alone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListPropertyTutorial()
Method Detail |
---|
public void setUp()
@DocChapter public void propertyWithValueOfTypeListOfString()
Lists of strings are declared like this:
Accessing a list of values is straight forward.
@DocChapter public void propertyWithValueOfTypeListOfInteger()
Lists of integers are declared like this:
Accessing a list of values is straight forward.
@DocChapter public void separators()
The elements are split by any non-alphanumeric character.
@DocSection public void pipeAsSeparator()
Therefore the pipe is also a valid delimiter.
@DocSection public void blankAsSeparator()
Therefore the pipe is also a valid delimiter.
@DocSection public void propertyWithSpecialStrings()
Every non-alpha-numeric character serves as a delimiter. We use Apache's common-beanutils for the conversion of values.
As you can see in the properties file, elements that contain spaces or a separator are set in double quotes.
@DocChapter public void propertyWithValueOfTypeListOfUrl() throws Exception
Lists of URLs are declared like this:
Accessing a list of values is straight forward.
Since a comma is a valid character in an URL, the comma is not a valid separator to specify URLs. The default separation character is the pipe (|
). Therefore URLs are best separated one on each line with a leading pipe.
Exception
@DocSection public void urlsSeparatedByNewlines() throws Exception
But you may also separate URLs by whitespaces alone.
Exception
@DocChapter public void propertyWithValueOfTypeListOfEnums()
Lists of enums are declared like this:
Accessing a list of values is straight forward.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |