org.exoplatform.container.xml
Class Deserializer

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

public class Deserializer
extends java.lang.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 java.lang.Boolean resolveBoolean(java.lang.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 java.lang.Double resolveDouble(java.lang.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 java.lang.Integer resolveInteger(java.lang.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 java.lang.Long resolveLong(java.lang.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 java.lang.String resolveString(java.lang.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 java.lang.String resolveString(java.lang.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 java.lang.Boolean resolveBoolean(java.lang.String s)
                                        throws java.lang.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:
java.lang.IllegalArgumentException - if the argument is not correct

resolveInteger

public static java.lang.Integer resolveInteger(java.lang.String s)
                                        throws java.lang.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:
java.lang.IllegalArgumentException - if the argument is not correct

resolveLong

public static java.lang.Long resolveLong(java.lang.String s)
                                  throws java.lang.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:
java.lang.IllegalArgumentException - if the argument is not correct

resolveDouble

public static java.lang.Double resolveDouble(java.lang.String s)
                                      throws java.lang.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:
java.lang.IllegalArgumentException - if the argument is not correct


Copyright © 2010 eXo Platform SAS. All Rights Reserved.