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 class
ParameterHelper.ParameterType
Deprecated.UseElementType
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Object
castValue(String value, ParameterHelper.ParameterType type)
Deprecated.Cast a untyped value (string) to an object of the typestatic 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'.static ParameterHelper.ParameterType
stringToType(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 void
toSAXEnumerator(ContentHandler handler, Enumerator enumerator)
Deprecated.SAX parameter enumeratorstatic void
toSAXParameter(ContentHandler handler, Parameter parameter, Object value)
Deprecated.SAX a parameterstatic void
toSAXParameterInternal(ContentHandler handler, Parameter parameter, Object value)
Deprecated.SAX a parameter except the root tagstatic void
toSAXValidator(ContentHandler handler, Validator validator)
Deprecated.SAX parameter validatorstatic String
typeToString(ParameterHelper.ParameterType type)
Deprecated.Return the readable name of a typestatic String
valueToString(Object value)
Deprecated.Converts known types to string
-
-
-
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_TIME
but 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
-
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
-
-