private List<DisplayerSettingsColumn> parseColumns( String columns ) {
if ( columns.length() > 0) {
String[] sa = columns.split( "," );
List<DisplayerSettingsColumn> l = new ArrayList<DisplayerSettingsColumn>( sa.length );
for ( int i = 0; i < sa.length; i++ ) {
DisplayerSettingsColumnImpl dsci = new DisplayerSettingsColumnImpl();
String[] idAlias = sa[i].trim().split( ":" );
if ( idAlias.length == 2 ) {
if ( StringUtils.isBlank( idAlias[ 0 ] ) && StringUtils.isBlank( idAlias[1] ) )
throw new IllegalArgumentException( "You must specify at least a column alias." );
if ( !StringUtils.isBlank( idAlias[1] ) ) {
dsci.setDisplayName( idAlias[ 1 ].trim() );
} else dsci.setDisplayName( idAlias[0].trim() );
if ( !StringUtils.isBlank( idAlias[0] ) ) dsci.setColumnId( idAlias[0].trim() );
} else {
if ( !StringUtils.isBlank( idAlias[0] ) ) dsci.setDisplayName( idAlias[0].trim() );
else throw new IllegalArgumentException( "You must specify at least a column alias." );
}
l.add( dsci );
}
return l;