BeanIO 2.0.4

org.beanio.internal.util
Class StringUtil

java.lang.Object
  extended by org.beanio.internal.util.StringUtil

public final class StringUtil
extends Object

Utility class for working with Strings.

Since:
2.0
Author:
Kevin Seim

Nested Class Summary
static interface StringUtil.PropertySource
          A source of property values.
 
Method Summary
static String doPropertySubstitution(String text, Properties properties)
          Substitutes ${key,default} place holders with their property values.
static String doPropertySubstitution(String text, StringUtil.PropertySource properties)
          Substitutes ${key,default} place holders with their property values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doPropertySubstitution

public static String doPropertySubstitution(String text,
                                            Properties properties)
                                     throws IllegalArgumentException
Substitutes ${key,default} place holders with their property values.

Parameters:
text - the template text
properties - the user provided property values
Returns:
the text after property substitution
Throws:
IllegalArgumentException - if a property value does not exist

doPropertySubstitution

public static String doPropertySubstitution(String text,
                                            StringUtil.PropertySource properties)
                                     throws IllegalArgumentException
Substitutes ${key,default} place holders with their property values.

Parameters:
text - the template text
properties - the user provided property values
Returns:
the text after property substitution
Throws:
IllegalArgumentException - if a property value does not exist

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim