public class EDIUtil
extends java.lang.Object
Constructor and Description |
---|
EDIUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
assertPrefix(EDIReader dataReader,
EDI_PREFIX prefix,
boolean errorOnFail)
Checks the prefix is as expected
If the prefix is not as expected an exception will be thrown
|
static java.lang.String |
ediToString(java.lang.String inputStr)
Takes an EDI String, removes all EDI escape characters
|
static java.lang.String |
getSiblingGroupId() |
static boolean |
isTruncateLongValues() |
static void |
parseId(java.lang.String id)
Ensures that the supplied id does not contain invalid characters.
|
static int |
parseStringAsInt(java.lang.String str) |
static void |
setSiblingGroupId(java.lang.String siblingGroupId) |
static void |
setTruncateLongValues(boolean newValue)
Setting this to true, requests that the EDI Data Writer truncate and round any observation value
longer than 15 characters.
|
static java.lang.String[] |
splitOnColon(java.lang.String str) |
static java.lang.String[] |
splitOnColon(java.lang.String str,
int expectedNumbersplits) |
static java.lang.String[] |
splitOnPlus(java.lang.String str) |
static java.lang.String[] |
splitOnPlus(java.lang.String str,
int expectedNumbersplits) |
static java.lang.String |
stringToEdi(java.lang.String inputStr)
Takes a string literal and converts it to an EDI valid string with escape characters
|
static java.lang.String |
stringToEDIFreeText(java.lang.String str,
int segmentLength,
int maxLength)
Takes a string literal and converts it to an EDI valid string.
|
static java.util.List<java.lang.String> |
stringToEDIFreeText(java.lang.String str,
int segmentLength,
int lineLength,
int maxRows)
Takes a string literal and converts it to an EDI valid list of Strings.
|
static java.lang.String |
stringToEDIWithMaxLength(java.lang.String inputStr,
int maxAllowedLength)
Takes a string literal and converts it to an EDI valid string with escape characters but it may truncate the string if it goes beyond
the specified maximum length.
|
static java.lang.String |
truncate(java.lang.String aStr)
Given a string, truncates it by rounding the value.
|
public static int parseStringAsInt(java.lang.String str)
public static java.lang.String stringToEdi(java.lang.String inputStr)
inputStr
- public static java.lang.String stringToEDIWithMaxLength(java.lang.String inputStr, int maxAllowedLength)
aStr
- The non-EDI stringmaxAllowedLength
- The maximum string length, but based on the original string. Only specifying a positive integers will have any effect.public static java.lang.String ediToString(java.lang.String inputStr)
inputStr
- public static java.lang.String stringToEDIFreeText(java.lang.String str, int segmentLength, int maxLength)
str
- The string to convertmaxLength
- The maximum permissible length of the Stringpublic static java.util.List<java.lang.String> stringToEDIFreeText(java.lang.String str, int segmentLength, int lineLength, int maxRows)
str
- The string to convertsegmentLength
- The maximum length before a segment is inserted into the StringlineLength
- The maximum permissible length of a single linemaxRows
- The maximum number of rows allowedpublic static void parseId(java.lang.String id)
id
- The id to checkjava.lang.IllegalArgumentException
- if the specified id is deemed to be invalidpublic static java.lang.String[] splitOnPlus(java.lang.String str)
public static java.lang.String[] splitOnPlus(java.lang.String str, int expectedNumbersplits)
public static java.lang.String[] splitOnColon(java.lang.String str)
public static java.lang.String[] splitOnColon(java.lang.String str, int expectedNumbersplits)
public static boolean assertPrefix(EDIReader dataReader, EDI_PREFIX prefix, boolean errorOnFail)
prefix
- public static java.lang.String truncate(java.lang.String aStr)
obsValue
- The String representing the observation valuepublic static java.lang.String getSiblingGroupId()
public static void setSiblingGroupId(java.lang.String siblingGroupId)
public static boolean isTruncateLongValues()
public static void setTruncateLongValues(boolean newValue)