|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.enterprise.fmt.IFmt
at.spardat.enterprise.fmt.AStringFmt
A formatter to validate the length and char set in strings.
| Field Summary | |
static int |
LOWER_CASE
Defines that this formatter makes all characters lowercase using the method Character. |
static int |
MAX_MAX_LEN
Defines an upper bound on a specified maximum length. |
static int |
UPPER_CASE
Defines that this formatter makes all characters uppercase |
| Fields inherited from class at.spardat.enterprise.fmt.IFmt |
DEFAULT, LAST_STYLE, MANDATORY, style_ |
| Constructor Summary | |
AStringFmt(int maxLen)
Constructs a length limited String formatter. |
|
AStringFmt(int maxLen,
int style)
Constructs a length limited String formatter. |
|
| Method Summary | |
java.lang.String |
format(java.lang.String internal)
Transforms an internal encoding to an external. |
static AStringFmt |
getInstance(int maxLen)
Returns a String formatter to limit the input length. |
static AStringFmt |
getInstance(int maxLen,
int style)
Returns a String formatter to limit the input length. |
static AStringFmt |
getInstance(int maxLen,
java.lang.String range)
Returns a String formatter to limit the input length. |
static AStringFmt |
getInstance(int maxLen,
java.lang.String range,
int style)
Returns a String formatter to limit the input length. |
static AStringFmt |
getInstance(int maxLen,
java.lang.String range,
int style,
java.lang.String regex,
java.lang.String bundleKey,
java.lang.String resBundle)
Returns a String formatter to limit the input length, the range of valid characters and a regular expression (according to the java.util.regex packet) for input validation. |
int |
getMaxLen()
Returns the maximum length a string accepted by this formatter may have. |
int |
getMinLen()
Returns the minimum length. |
boolean |
isLegalExternalChar(char aChar)
Examines whether a given character may be part of an external representation. |
boolean |
isLegalInternal(java.lang.String internal)
Determines if the given string is a legal internal representation. |
boolean |
isOneWay()
An IFmt is one way, if the external encoding may be generated out of the internal, but not vice versa. |
int |
maxLenOfExternal()
Returns the maximum length an external string representation may have. |
boolean |
mayBeAppliedTo(byte type)
Defines if this formatter is able to successfully format a specified type. |
java.lang.String |
parse(java.lang.String external)
Tries to transform an external encoding to an internal. |
java.lang.String |
parse2(java.lang.String external)
Does the parse without the mandatory-check |
void |
setMaxLen(int maxLen)
Sets the maximum string length this formatter accepts. |
void |
setMinLen(int minLen)
Sets the minimum length a string accepted must have. |
| Methods inherited from class at.spardat.enterprise.fmt.IFmt |
checkMandatory, clone, getStyle, isMandatory, setMandatory |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int UPPER_CASE
public static final int LOWER_CASE
public static final int MAX_MAX_LEN
| Constructor Detail |
public AStringFmt(int maxLen)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited.
public AStringFmt(int maxLen,
int style)
maxLen - the maximum length of an accepted string or -1, if no
length limitation should be imposed.style - may be MANDATORY.| Method Detail |
public static AStringFmt getInstance(int maxLen)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited.
public static AStringFmt getInstance(int maxLen,
int style)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited.style - may be MANDATORY which forces the input not to be empty or
UPPER_CASE or LOWER_CASE.
public static AStringFmt getInstance(int maxLen,
java.lang.String range)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited.range - a string denoting one or more character ranges.
See AStringFmtRange for a syntax description.
public static AStringFmt getInstance(int maxLen,
java.lang.String range,
int style)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited.range - a string denoting one or more character ranges.
See AStringFmtRange for a syntax description.style - may be MANDATORY which forces the input not be empty or
UPPER_CASE or LOWER_CASE.
public static AStringFmt getInstance(int maxLen,
java.lang.String range,
int style,
java.lang.String regex,
java.lang.String bundleKey,
java.lang.String resBundle)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited.range - a string denoting one or more character ranges.
See AStringFmtRange for a syntax description.style - may be MANDATORY which forces the input not be empty or
UPPER_CASE or LOWER_CASE.regex - a regular expression according to the java.util.regex packet.
The input string is validated by this expression.bundleKey - the resource bundle key of the error message,
which is shown in the case of a negative evalution of the regular expression.resBundle - the resource bundle name from which the error message
for negative evalution of the regular expression is taken.public void setMaxLen(int maxLen)
maxLen - the maximum length of an accepted string. May be -1, then
the length is unlimited (theoretically), but practically
set to MAX_MAX_LEN.public int getMaxLen()
public void setMinLen(int minLen)
public int getMinLen()
public java.lang.String parse(java.lang.String external)
IFmt
parse in class IFmtexternal - the external encoding
IFmt.parse(String)public java.lang.String parse2(java.lang.String external)
public java.lang.String format(java.lang.String internal)
IFmt
format in class IFmtinternal - the provided internal encoding. This String must satisfy the
condition isLegalInternal(), otherwise the behaviour of this
method is undefined.
IFmt.format(String)public int maxLenOfExternal()
IFmt
maxLenOfExternal in class IFmtIFmt.maxLenOfExternal()public boolean isLegalExternalChar(char aChar)
IFmt
isLegalExternalChar in class IFmtaChar - the character to check
IFmt.isLegalExternalChar(char)public boolean isLegalInternal(java.lang.String internal)
IFmt
isLegalInternal in class IFmtinternal - the internal encoding.
IFmt.isLegalInternal(String)public boolean isOneWay()
IFmt
isOneWay in class IFmtIFmt.isOneWay()public boolean mayBeAppliedTo(byte type)
IFmt
mayBeAppliedTo in class IFmttype - a type constant defined in Types.IFmt.mayBeAppliedTo(byte)
|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||