Package org.ametys.runtime.parameter
Class ParameterHelper
- java.lang.Object
-
- org.ametys.runtime.parameter.ParameterHelper
-
@Deprecated public final class ParameterHelper extends Object
Deprecated.All of this helper methods are now in the new Parameter API classesThis class handles all needed to use typed parameters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameterHelper.ParameterTypeDeprecated.UseElementType
-
Field Summary
Fields Modifier and Type Field Description private static DateTimeFormatter__ISO_OFFSET_DATE_TIMEDeprecated.The ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30.000+01:00'.private static org.slf4j.Logger_loggerDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description privateParameterHelper()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static void_saxConfigurationObject(ContentHandler handler, String name, Object value)Deprecated.static ObjectcastValue(String value, ParameterHelper.ParameterType type)Deprecated.Cast a untyped value (string) to an object of the typestatic DateTimeFormattergetISODateTimeFormatter()Deprecated.Get the ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30.000+01:00'.static ParameterHelper.ParameterTypestringToType(String type)Deprecated.Convert a string containing a type to its valuestatic Map<String,Object>toJSON(Parameter parameter)Deprecated.Convert the parameter in a JSON mapstatic voidtoSAXEnumerator(ContentHandler handler, Enumerator enumerator)Deprecated.SAX parameter enumeratorstatic voidtoSAXParameter(ContentHandler handler, Parameter parameter, Object value)Deprecated.SAX a parameterstatic voidtoSAXParameterInternal(ContentHandler handler, Parameter parameter, Object value)Deprecated.SAX a parameter except the root tagstatic voidtoSAXValidator(ContentHandler handler, Validator validator)Deprecated.SAX parameter validatorstatic StringtypeToString(ParameterHelper.ParameterType type)Deprecated.Return the readable name of a typestatic StringvalueToString(Object value)Deprecated.Converts known types to string
-
-
-
Field Detail
-
__ISO_OFFSET_DATE_TIME
private static DateTimeFormatter __ISO_OFFSET_DATE_TIME
Deprecated.The ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30.000+01:00'.
-
_logger
private static org.slf4j.Logger _logger
Deprecated.
-
-
Constructor Detail
-
ParameterHelper
private ParameterHelper()
Deprecated.
-
-
Method Detail
-
getISODateTimeFormatter
public static DateTimeFormatter getISODateTimeFormatter()
Deprecated.Get the ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30.000+01:00'. This formatter is similar toDateTimeFormatter.ISO_OFFSET_DATE_TIMEbut force 3-digits milliseconds.- Returns:
- ISO date-time formatter
-
typeToString
public static String typeToString(ParameterHelper.ParameterType type)
Deprecated.Return the readable name of a type- Parameters:
type- Type to convert- Returns:
- Returns the name of the type
- Throws:
IllegalArgumentException- If the type is unknwon
-
stringToType
public static ParameterHelper.ParameterType stringToType(String type)
Deprecated.Convert a string containing a type to its value- Parameters:
type- Name of the type- Returns:
- Type
- Throws:
IllegalArgumentException- if the type is unknown
-
castValue
public static Object castValue(String value, ParameterHelper.ParameterType type)
Deprecated.Cast a untyped value (string) to an object of the type- Parameters:
value- Value to casttype- Type to cast value in- Returns:
- An object of the type 'type' with value 'value', or null if type is unknown or value cannot be cast
-
valueToString
public static String valueToString(Object value)
Deprecated.Converts known types to string- Parameters:
value- Typed value- Returns:
- String readable by the config bean
- Throws:
IllegalArgumentException- if the object is a InputStream
-
toSAXParameter
public static void toSAXParameter(ContentHandler handler, Parameter parameter, Object value) throws SAXException, ProcessingException
Deprecated.SAX a parameter- Parameters:
handler- The content handler where to SAXparameter- The parameter to SAXvalue- The parameter value. Can be null.- Throws:
SAXException- If an error occurred while SAXingProcessingException- If an error occurred
-
toSAXParameterInternal
public static void toSAXParameterInternal(ContentHandler handler, Parameter parameter, Object value) throws SAXException, ProcessingException
Deprecated.SAX a parameter except the root tag- Parameters:
handler- The content handler where to SAXparameter- The parameter to SAXvalue- The parameter value. Can be null.- Throws:
SAXException- If an error occurred while SAXingProcessingException- If an error occurred
-
toSAXEnumerator
public static void toSAXEnumerator(ContentHandler handler, Enumerator enumerator) throws SAXException, ProcessingException
Deprecated.SAX parameter enumerator- Parameters:
handler- The content handler where to SAXenumerator- The enumerator to SAX- Throws:
SAXException- If an error occurred to SAXProcessingException- If an error occurred
-
toSAXValidator
public static void toSAXValidator(ContentHandler handler, Validator validator) throws SAXException
Deprecated.SAX parameter validator- Parameters:
handler- The content handler where to SAXvalidator- The validator to SAX- Throws:
SAXException- If an error occurred while SAXing
-
_saxConfigurationObject
private static void _saxConfigurationObject(ContentHandler handler, String name, Object value) throws SAXException
Deprecated.- Throws:
SAXException
-
toJSON
public static Map<String,Object> toJSON(Parameter parameter) throws ProcessingException
Deprecated.Convert the parameter in a JSON map- Parameters:
parameter- The parameter to convert- Returns:
- The Parameter as a map
- Throws:
ProcessingException- If an error occurred when converting the parameter
-
-