de.smartics.properties.tutorial.property.list
Class ListPropertyTutorial

Package class diagram package ListPropertyTutorial
java.lang.Object
  extended by de.smartics.properties.tutorial.property.list.ListPropertyTutorial

@Document(title="List Properties",
          sortKey="basics0100")
@DocCategory(value="basics")
public class ListPropertyTutorial
     
     
extends Object

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

ListPropertyTutorial

public ListPropertyTutorial()
Method Detail

setUp

public void setUp()

propertyWithValueOfTypeListOfString

@DocChapter
public void propertyWithValueOfTypeListOfString()

Lists of strings are declared like this:

Accessing a list of values is straight forward.


propertyWithValueOfTypeListOfInteger

@DocChapter
public void propertyWithValueOfTypeListOfInteger()

Lists of integers are declared like this:

Accessing a list of values is straight forward.


separators

@DocChapter
public void separators()

The elements are split by any non-alphanumeric character.


pipeAsSeparator

@DocSection
public void pipeAsSeparator()

Therefore the pipe is also a valid delimiter.


blankAsSeparator

@DocSection
public void blankAsSeparator()

Therefore the pipe is also a valid delimiter.


propertyWithSpecialStrings

@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.


propertyWithValueOfTypeListOfUrl

@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.

Throws:
Exception

urlsSeparatedByNewlines

@DocSection
public void urlsSeparatedByNewlines()
                             throws Exception

But you may also separate URLs by whitespaces alone.

Throws:
Exception

propertyWithValueOfTypeListOfEnums

@DocChapter
public void propertyWithValueOfTypeListOfEnums()

Lists of enums are declared like this:

Accessing a list of values is straight forward.



Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.