Package org.exoplatform.container.xml
Class Deserializer
java.lang.Object
org.exoplatform.container.xml.Deserializer
A deserializer used by JIBX that resolve system properties to allow runtime configuration.
- Version:
- $Revision$
- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the variable to use to get the current container name as a suffix if the current container is a portal container, the value of the variable will be "-${portal-container-name}", it will be an empty String otherwisestatic final StringThe prefix of the name of all the variables tied to the current portal container -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThis methods will remove useless characters from the givenStringand return the resultstatic BooleanResolve 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 anIllegalArgumentExceptionis thrownstatic DoubleResolve a double value with the following algorithm: Resolve any system property in the input value Attempt to parse the value using theDouble.parseDouble(String)method and returns its value. If the parsing fails then throws anIllegalArgumentExceptionstatic IntegerResolve an integer value with the following algorithm: Resolve any system property in the input value Attempt to parse the value using theInteger.parseInt(String)method and returns its value. If the parsing fails then throws anIllegalArgumentExceptionstatic LongResolve a long value with the following algorithm: Resolve any system property in the input value Attempt to parse the value using theLong.parseLong(String)method and returns its value. If the parsing fails then throws anIllegalArgumentExceptionstatic StringThis method will first resolves the variables then it will clean the resultsstatic StringResolve a string value.static StringresolveVariables(String input) Resolve the variables of type ${my.var} for the current context which is composed of the system properties and the portal container settingsstatic StringresolveVariables(String input, Map<String, Object> props) Resolve the variables of type ${my.var} for the current context which is composed of the system properties, the portal container settings and the given settings
-
Field Details
-
EXO_CONTAINER_PROP_NAME
The name of the variable to use to get the current container name as a suffix if the current container is a portal container, the value of the variable will be "-${portal-container-name}", it will be an empty String otherwise- See Also:
-
PORTAL_CONTAINER_VARIABLE_PREFIX
The prefix of the name of all the variables tied to the current portal container- See Also:
-
-
Constructor Details
-
Deserializer
public Deserializer()
-
-
Method Details
-
resolveString
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
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
IllegalArgumentExceptionis thrown
- Parameters:
s- the input value- Returns:
- the resolve value
- Throws:
IllegalArgumentException- if the argument is not correct
-
resolveInteger
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
- Parameters:
s- the input value- Returns:
- the resolve value
- Throws:
IllegalArgumentException- if the argument is not correct
-
resolveLong
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
- Parameters:
s- the input value- Returns:
- the resolve value
- Throws:
IllegalArgumentException- if the argument is not correct
-
resolveDouble
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
- Parameters:
s- the input value- Returns:
- the resolve value
- Throws:
IllegalArgumentException- if the argument is not correct
-
resolveVariables
Resolve the variables of type ${my.var} for the current context which is composed of the system properties and the portal container settings- Parameters:
input- the input value- Returns:
- the resolve value
-
resolveVariables
Resolve the variables of type ${my.var} for the current context which is composed of the system properties, the portal container settings and the given settings- Parameters:
input- the input valueprops- a set of parameters to add for the variable resolution- Returns:
- the resolve value
-
cleanString
This methods will remove useless characters from the givenStringand return the result- Parameters:
s- the input value- Returns:
nullif the input value isnull,s.trim()otherwise
-
resolveNClean
This method will first resolves the variables then it will clean the results- Parameters:
s- the input value- Returns:
- the resolve and clean value
-