IMC Epclient 5.0.3

at.spardat.enterprise.fmt
Class ADateFmtJavaUtilText

java.lang.Object
  extended byat.spardat.enterprise.fmt.IFmt
      extended byat.spardat.enterprise.fmt.ADateFmt
          extended byat.spardat.enterprise.fmt.ADateFmtJavaUtilText
All Implemented Interfaces:
java.lang.Cloneable

public class ADateFmtJavaUtilText
extends ADateFmt

This class wraps the default behaviour of the JDK regarding formatting and parsing of Dates. The provided styles are mapped to the corresponding styles of the class java.text.DateFormat.


Field Summary
 
Fields inherited from class at.spardat.enterprise.fmt.ADateFmt
FULL, LONG, MEDIUM, SHORT
 
Fields inherited from class at.spardat.enterprise.fmt.IFmt
DEFAULT, LAST_STYLE, MANDATORY, style_
 
Constructor Summary
ADateFmtJavaUtilText(int style, java.util.Locale l)
          Constructs an ADateFmt providing a style and a locale.
ADateFmtJavaUtilText(java.lang.String pattern, int style)
          Constructs an ADateFmt providing a pattern as specified in java.text.SimpleDateFormat.
ADateFmtJavaUtilText(java.lang.String pattern, int style, java.util.Locale locale)
          Constructs an ADateFmt providing a pattern as specified in java.text.SimpleDateFormat.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this;
 java.lang.String format(java.lang.String internal)
          Transforms an internal encoding to an external.
 boolean isLegalExternalChar(char aChar)
          Examines whether a given character may be part of an external 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.
 java.lang.String parse(java.lang.String external)
          Tries to transform an external encoding to an internal.
 
Methods inherited from class at.spardat.enterprise.fmt.ADateFmt
checkDateRange, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getMax, getMaxDate, getMin, getMinDate, isLegalInternal, mayBeAppliedTo, setMax, setMaxDate, setMin, setMinDate
 
Methods inherited from class at.spardat.enterprise.fmt.IFmt
checkMandatory, getStyle, isMandatory, setMandatory
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADateFmtJavaUtilText

public ADateFmtJavaUtilText(int style,
                            java.util.Locale l)
Constructs an ADateFmt providing a style and a locale.

Parameters:
style - one of MANDATORY, SHORT, MEDIUM, LONG or FULL.
l - the locale to use

ADateFmtJavaUtilText

public ADateFmtJavaUtilText(java.lang.String pattern,
                            int style)
Constructs an ADateFmt providing a pattern as specified in java.text.SimpleDateFormat.

Parameters:
pattern - see java.text.SimpleDateFormat
style - may be MANDATORY

ADateFmtJavaUtilText

public ADateFmtJavaUtilText(java.lang.String pattern,
                            int style,
                            java.util.Locale locale)
Constructs an ADateFmt providing a pattern as specified in java.text.SimpleDateFormat.

Parameters:
pattern - see java.text.SimpleDateFormat
style - may be MANDATORY
Method Detail

parse

public java.lang.String parse(java.lang.String external)
                       throws AParseException
Description copied from class: IFmt
Tries to transform an external encoding to an internal. Must not be called if isOneWay() yields true.

Specified by:
parse in class IFmt
Parameters:
external - the external encoding
Returns:
the internal encoding. May be the empty String, but never is null.
Throws:
AParseException - if the external encoding cannot be successfully parsed.
See Also:
IFmt.parse(String)

format

public java.lang.String format(java.lang.String internal)
Description copied from class: IFmt
Transforms an internal encoding to an external.

Specified by:
format in class IFmt
Parameters:
internal - the provided internal encoding. This String must satisfy the condition isLegalInternal(), otherwise the behaviour of this method is undefined.
Returns:
the external representation. May be the empty string, but is never null.
See Also:
IFmt.format(String)

maxLenOfExternal

public int maxLenOfExternal()
Description copied from class: IFmt
Returns the maximum length an external string representation may have.

Specified by:
maxLenOfExternal in class IFmt
Returns:
the maximum length or -1 if there is no known maximum.
See Also:
IFmt.maxLenOfExternal()

isLegalExternalChar

public boolean isLegalExternalChar(char aChar)
Description copied from class: IFmt
Examines whether a given character may be part of an external representation.

Specified by:
isLegalExternalChar in class IFmt
Parameters:
aChar - the character to check
Returns:
boolean if the character may be part of an external rep.
See Also:
IFmt.isLegalExternalChar(char)

isOneWay

public boolean isOneWay()
Description copied from class: IFmt
An IFmt is one way, if the external encoding may be generated out of the internal, but not vice versa.

Specified by:
isOneWay in class IFmt
Returns:
true, if format may be called, but parse not.
See Also:
IFmt.isOneWay()

clone

public java.lang.Object clone()
Description copied from class: IFmt
Returns a clone of this;

Overrides:
clone in class IFmt
See Also:
IFmt.clone()

IMC Epclient 5.0.3