com.ibm.dse.base
Class MaximumLength
java.lang.Object
|
+--com.ibm.dse.base.FormatElement
|
+--com.ibm.dse.base.FormatDecorator
|
+--com.ibm.dse.base.MaximumLength
- public class MaximumLength
- extends FormatDecorator
This decorator checks that the length of the formatted String does not exceed
the limit defined by its maxLength attribute.
- See Also:
- Serialized Form
Constructor Summary |
MaximumLength()
This is the default constructor used to create a MaximumLength object. |
MaximumLength(java.lang.String aName)
This is the constructor used by the Externalizer to create a MaximumLength object. |
Method Summary |
java.lang.String |
addDecoration(java.lang.String aString)
Truncates the input String if it is longer than the value of the maxLength attribute. |
int |
getMaxLength()
Returns the value of maxLength. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a MaximumLength with the Tag attributes. |
java.lang.String |
removeDecoration(java.lang.String aString)
Returns the input String unmodified unless if its length exceeds the value of the maxLength attribute. |
void |
setMaxLength(int aMaxLength)
Sets the value of maxLength. |
Vector |
toStrings()
Returns a visual representation of the decorator. |
Methods inherited from class com.ibm.dse.base.FormatDecorator |
extract,
format,
format,
getDataElementName,
getDecorated,
getName,
isConstant,
rootDecorated,
rootDecorator,
setDecorated,
toString,
unformat,
unformat |
Methods inherited from class com.ibm.dse.base.FormatElement |
exceptionInfo,
externalizer,
format,
getExternalizer,
getTagName,
isCacheable,
readExternal,
readExternal,
readObject,
reinitialize,
removeExternal,
setDataElementName,
setExternalizer,
setName,
setSize,
toTags,
unformat,
writeExternal,
writeExternal |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
maxLength
public int maxLength
MaximumLength
public MaximumLength()
- This is the default constructor used to create a MaximumLength object.
MaximumLength
public MaximumLength(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the Externalizer to create a MaximumLength object.
- Parameters:
aString
- java.lang.String
addDecoration
public java.lang.String addDecoration(java.lang.String aString)
- Truncates the input String if it is longer than the value of the maxLength attribute.
- Overrides:
- addDecoration in class FormatDecorator
- Parameters:
aString
- String- Returns:
- String
getMaxLength
public int getMaxLength()
- Returns the value of maxLength.
- Returns:
- int
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
- Initializes a MaximumLength with the Tag attributes.
- Overrides:
- initializeFrom in class FormatElement
- Parameters:
aTag
- com.ibm.dse.base.Tag- Returns:
- java.lang.Object
removeDecoration
public java.lang.String removeDecoration(java.lang.String aString)
throws DSEInvalidArgumentException
- Returns the input String unmodified unless if its length exceeds the value of the maxLength attribute.
- Overrides:
- removeDecoration in class FormatDecorator
- Parameters:
aString
- String- Returns:
- String
setMaxLength
public void setMaxLength(int aMaxLength)
- Sets the value of maxLength.
- Parameters:
aMaxLength
- int
toStrings
public Vector toStrings()
- Returns a visual representation of the decorator.
- Overrides:
- toStrings in class FormatDecorator
- Returns:
- java.lang.String