org.exoplatform.container.xml
Class Deserializer

java.lang.Object
  extended by org.exoplatform.container.xml.Deserializer

public class Deserializer
extends Object

A deserializer used by JIBX that resolve system properties to allow runtime configuration.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
Deserializer()
           
 
Method Summary
static Boolean resolveBoolean(String s)
          Resolve a boolean value with the following algorithm: Resolve any system property in the input value If the input value is null then the returned value is null If the value is equals to the string litteral true ignoring the case then true is returned If the value is equals to the string litteral false ignoring the case then false is returned Otherwise an IllegalArgumentException is thrown
static Double resolveDouble(String s)
          Resolve a double value with the following algorithm: Resolve any system property in the input value Attempt to parse the value using the Double.parseDouble(String) method and returns its value. If the parsing fails then throws an IllegalArgumentException
static Integer resolveInteger(String s)
          Resolve an integer value with the following algorithm: Resolve any system property in the input value Attempt to parse the value using the Integer.parseInt(String) method and returns its value. If the parsing fails then throws an IllegalArgumentException
static Long resolveLong(String s)
          Resolve a long value with the following algorithm: Resolve any system property in the input value Attempt to parse the value using the Long.parseLong(String) method and returns its value. If the parsing fails then throws an IllegalArgumentException
static String resolveString(String s)
          Resolve a string value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deserializer

public Deserializer()
Method Detail

resolveString

public static String resolveString(String s)
Resolve a string value. If the input value is null then the returned value is null.

Parameters:
s - the input value
Returns:
the resolve value

resolveBoolean

public static Boolean resolveBoolean(String s)
                              throws IllegalArgumentException
Resolve a boolean value with the following algorithm:
  1. Resolve any system property in the input value
  2. If the input value is null then the returned value is null
  3. If the value is equals to the string litteral true ignoring the case then true is returned
  4. If the value is equals to the string litteral false ignoring the case then false is returned
  5. Otherwise an IllegalArgumentException is thrown

Parameters:
s - the input value
Returns:
the resolve value
Throws:
IllegalArgumentException - if the argument is not correct

resolveInteger

public static Integer resolveInteger(String s)
                              throws IllegalArgumentException
Resolve an integer value with the following algorithm:
  1. Resolve any system property in the input value
  2. Attempt to parse the value using the Integer.parseInt(String) method and returns its value.
  3. If the parsing fails then throws an IllegalArgumentException

Parameters:
s - the input value
Returns:
the resolve value
Throws:
IllegalArgumentException - if the argument is not correct

resolveLong

public static Long resolveLong(String s)
                        throws IllegalArgumentException
Resolve a long value with the following algorithm:
  1. Resolve any system property in the input value
  2. Attempt to parse the value using the Long.parseLong(String) method and returns its value.
  3. If the parsing fails then throws an IllegalArgumentException

Parameters:
s - the input value
Returns:
the resolve value
Throws:
IllegalArgumentException - if the argument is not correct

resolveDouble

public static Double resolveDouble(String s)
                            throws IllegalArgumentException
Resolve a double value with the following algorithm:
  1. Resolve any system property in the input value
  2. Attempt to parse the value using the Double.parseDouble(String) method and returns its value.
  3. If the parsing fails then throws an IllegalArgumentException

Parameters:
s - the input value
Returns:
the resolve value
Throws:
IllegalArgumentException - if the argument is not correct


Copyright © 2009 eXo Platform SAS. All Rights Reserved.