Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui.validate
Class DateValidater

java.lang.Object
  |
  +--oracle.cabo.ui.validate.BaseClientValidater
        |
        +--oracle.cabo.ui.validate.DateValidater
All Implemented Interfaces:
ClientValidater, Formatter, ServerValidater

public class DateValidater
extends BaseClientValidater
implements Formatter

Validater for validating dates and times using a pattern for a Simple Date pattern or date and time style constants of the DateFormat.

See Also:
DateFormat,


Field Summary
static int FULL
          Constant for full style pattern.
static int LONG
          Constant for long style pattern.
static int MEDIUM
          Constant for medium style pattern.
static int NO_STYLE
          Style flag indicating that no style should be used for this paramter,
static int SHORT
          Constant for short style pattern.
static int SHORTISH
          SHORT pattern with no year abbreviation.
 
Fields inherited from interface oracle.cabo.ui.validate.ServerValidater
NO_CONTENT_ERROR_OFFSET, UNKNOWN_ERROR_OFFSET
 
Constructor Summary
DateValidater()
          Creates a DateValidator for short times and days.
DateValidater(int timeStyle)
          Creates a DateValidator with the specified DateFormat time style.
DateValidater(int timeStyle, int dateStyle)
          Creates a DateValidator with the specified DateFormat time and date styles.
DateValidater(java.lang.String pattern)
          Creates a DateValidator with the specified SimpleDateFormat format pattern.
DateValidater(java.lang.String pattern, java.lang.String secondaryPattern)
          Creates a DateValidator with the specified SimpleDateFormat format pattern and a secondary pattern.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String formatObject(java.lang.Object data, LocaleContext localeContext)
          Formats the value into a String in a potentially Locale-specific manner.
 int getColumns()
          Deprecated. in favor of getColumns(LocaleContext localeContext)
 int getColumns(LocaleContext localeContext)
          Returns the number of columns of text a field should have to fully display the contents of a valid string.
 int getDateStyle()
           
protected  java.lang.String getHTMLLibReference()
          Returns the name of the Javascript code that this validator requires.
protected  java.lang.String getHTMLValidation(RenderingContext context)
           
 java.lang.String getPattern()
           
 int getTimeStyle()
           
 java.lang.String getValidationFormat(RenderingContext context, UINode node)
           
 int hashCode()
           
 java.lang.Object parseString(java.lang.String value, LocaleContext localeContext)
          Returns the value as a Date.
 java.text.ParseException[] validate(RenderingContext context, java.lang.String value)
           
 void writeDependencies(RenderingContext context, UINode node)
          Opportunity for the CLientValidater to write any of its dependencies to the output.
 
Methods inherited from class oracle.cabo.ui.validate.BaseClientValidater
getLookAndFeelString, getValidation, getWMLValidation, logError
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_STYLE

public static final int NO_STYLE
Style flag indicating that no style should be used for this paramter,

FULL

public static final int FULL
Constant for full style pattern.

LONG

public static final int LONG
Constant for long style pattern.

MEDIUM

public static final int MEDIUM
Constant for medium style pattern.

SHORT

public static final int SHORT
Constant for short style pattern.

SHORTISH

public static final int SHORTISH
SHORT pattern with no year abbreviation. For Dates, this ensures that a full 4 digit pattern is used for years.
Constructor Detail

DateValidater

public DateValidater()
Creates a DateValidator for short times and days.

DateValidater

public DateValidater(java.lang.String pattern)
Creates a DateValidator with the specified SimpleDateFormat format pattern.

DateValidater

public DateValidater(java.lang.String pattern,
                     java.lang.String secondaryPattern)
Creates a DateValidator with the specified SimpleDateFormat format pattern and a secondary pattern.
Parameters:
pattern - a primary pattern; this will be used to format strings
secondaryPattern - a second pattern, which will be used as a second attempt to parse a string, but is never used for formatting strings.

DateValidater

public DateValidater(int timeStyle)
Creates a DateValidator with the specified DateFormat time style.

DateValidater

public DateValidater(int timeStyle,
                     int dateStyle)
Creates a DateValidator with the specified DateFormat time and date styles. Use the NO_STYLE to have one of the styles ignored.
Method Detail

writeDependencies

public void writeDependencies(RenderingContext context,
                              UINode node)
                       throws java.io.IOException
Description copied from class: BaseClientValidater
Opportunity for the CLientValidater to write any of its dependencies to the output. For HTML, this will typically be imports of JavaScript libraries.
Overrides:
writeDependencies in class BaseClientValidater

getPattern

public final java.lang.String getPattern()

getColumns

public int getColumns(LocaleContext localeContext)
Returns the number of columns of text a field should have to fully display the contents of a valid string.

getColumns

public int getColumns()
Deprecated. in favor of getColumns(LocaleContext localeContext)


getTimeStyle

public final int getTimeStyle()

getDateStyle

public final int getDateStyle()

validate

public java.text.ParseException[] validate(RenderingContext context,
                                           java.lang.String value)

parseString

public java.lang.Object parseString(java.lang.String value,
                                    LocaleContext localeContext)
                             throws java.text.ParseException
Returns the value as a Date.
Specified by:
parseString in interface Formatter

formatObject

public java.lang.String formatObject(java.lang.Object data,
                                     LocaleContext localeContext)
Description copied from interface: Formatter
Formats the value into a String in a potentially Locale-specific manner.
Specified by:
formatObject in interface Formatter

getValidationFormat

public java.lang.String getValidationFormat(RenderingContext context,
                                            UINode node)
Overrides:
getValidationFormat in class BaseClientValidater

getHTMLValidation

protected java.lang.String getHTMLValidation(RenderingContext context)
Overrides:
getHTMLValidation in class BaseClientValidater

getHTMLLibReference

protected java.lang.String getHTMLLibReference()
Returns the name of the Javascript code that this validator requires.
Overrides:
getHTMLLibReference in class BaseClientValidater

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.