Package com.helger.as2lib.params
Class AbstractParameterParser
- java.lang.Object
-
- com.helger.as2lib.params.AbstractParameterParser
-
- Direct Known Subclasses:
CompositeParameters
,DateParameters
,ExceptionParameters
,MessageMDNParameters
,MessageParameters
,RandomParameters
public abstract class AbstractParameterParser extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractParameterParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
format(String sFormat)
Fill in a format string with information from a ParameterParserabstract String
getParameter(String sKey)
abstract void
setParameter(String sKey, String sValue)
void
setParameters(String sEncodedParams)
Set parameters from a string, like "msg.sender.as2_id=ME,msg.headers.content-type=application/X12"void
setParameters(String sFormat, String sDelimiters, String sValue)
Set parameters from a string separated by delimiters.String
toString()
-
-
-
Method Detail
-
setParameter
public abstract void setParameter(@Nonnull String sKey, @Nonnull String sValue) throws AS2InvalidParameterException
- Throws:
AS2InvalidParameterException
-
getParameter
@Nullable public abstract String getParameter(@Nonnull String sKey) throws AS2InvalidParameterException
- Throws:
AS2InvalidParameterException
-
setParameters
public void setParameters(@Nonnull String sEncodedParams) throws AS2InvalidParameterException
Set parameters from a string, like "msg.sender.as2_id=ME,msg.headers.content-type=application/X12"- Parameters:
sEncodedParams
- string to parse- Throws:
AS2InvalidParameterException
- In case the string is incorrect
-
setParameters
public void setParameters(@Nullable String sFormat, @Nullable String sDelimiters, @Nonnull String sValue) throws AS2Exception
Set parameters from a string separated by delimiters.- Parameters:
sFormat
- Comma separated list of parameters to set, likemsg.sender.as2_id,msg.receiver.as2_id,msg.header.content-type
sDelimiters
- delimiters in string to parse, like "-."sValue
- string to parse, like"NORINCO-WALMART.application/X12"
- Throws:
AS2Exception
- In case the string is incorrect
-
format
@Nonnull public String format(@Nullable String sFormat) throws AS2InvalidParameterException
Fill in a format string with information from a ParameterParser- Parameters:
sFormat
- the format string to fill in. May benull
.- Returns:
- the filled in format string.
- Throws:
AS2InvalidParameterException
- In case the string is incorrect
-
-