Package org.ametys.runtime.parameter
Class ParameterHelper
java.lang.Object
org.ametys.runtime.parameter.ParameterHelper
Deprecated.
All of this helper methods are now in the new Parameter API classes
This class handles all needed to use typed parameters
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
castValue
(String value, ParameterHelper.ParameterType type) Deprecated.Cast a untyped value (string) to an object of the typestatic DateTimeFormatter
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'.stringToType
(String type) Deprecated.Convert a string containing a type to its valueDeprecated.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
Deprecated.Return the readable name of a typestatic String
valueToString
(Object value) Deprecated.Converts known types to string
-
Method Details
-
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
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
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
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
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
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
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
-