pl.mbdev.openstage
Class IppDateField

java.lang.Object
  extended by pl.mbdev.openstage.Xml
      extended by pl.mbdev.openstage.XmlFormItem
          extended by pl.mbdev.openstage.IppDateField

public class IppDateField
extends XmlFormItem

A field with a date and time that can be added to IppForm. Date and time from such field will be sent to a remote server when a form is submitted.

 Copyright 2011 Mateusz Bysiek,
     mb@mbdev.pl, http://mbdev.pl/
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
     http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 

Author:
Mateusz Bysiek

Nested Class Summary
static class IppDateField.Default
          Defines the possible kinds of default values of the IppDateField.
static class IppDateField.Mode
          Defines possible modes of an IppDateField.
 
Field Summary
private  java.lang.String dateKey
          Key that will identify date from this field when the form is submitted to a remote server.
private  IppDateField.Default defaultValue
          Kind of the default value, from IppDateField.Mode.
private  IppDateField.Mode mode
          Mode of this date field, value comes from IppDateField.Mode.
private  java.lang.String timeKey
          Key that will identify time from this field when the form is submitted to a remote server.
 
Constructor Summary
IppDateField(java.lang.String label, java.util.GregorianCalendar dateTime, IppDateField.Mode mode, java.lang.String dateKey, java.lang.String timeKey)
          Creates new date field that will have a default date and time provided in a dateTime parameter.
IppDateField(java.lang.String label, java.util.TimeZone timeZone, java.lang.String date, java.lang.String time, IppDateField.Mode mode, IppDateField.Default defaultValue, java.lang.String dateKey, java.lang.String timeKey)
           
 
Method Summary
protected  java.lang.StringBuffer attributesToXmlString()
          Should be overridden by classes that have some attributes.
 
Methods inherited from class pl.mbdev.openstage.XmlFormItem
add
 
Methods inherited from class pl.mbdev.openstage.Xml
add, add, addAndReturn, attributeToXml, firstAttributesToXmlString, getContents, getLogicalRoot, getParent, getSubNode, getSubNodeIndex, getSubNodes, getXmlHeader, isEmpty, logicalAdd, sendTo, setContents, setParent, subObjectsCount, subObjectsToXmlString, toXmlString, wrapWithIppItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mode

private final IppDateField.Mode mode
Mode of this date field, value comes from IppDateField.Mode.


defaultValue

private final IppDateField.Default defaultValue
Kind of the default value, from IppDateField.Mode.


dateKey

private final java.lang.String dateKey
Key that will identify date from this field when the form is submitted to a remote server.


timeKey

private final java.lang.String timeKey
Key that will identify time from this field when the form is submitted to a remote server.

Constructor Detail

IppDateField

public IppDateField(java.lang.String label,
                    java.util.GregorianCalendar dateTime,
                    IppDateField.Mode mode,
                    java.lang.String dateKey,
                    java.lang.String timeKey)
Creates new date field that will have a default date and time provided in a dateTime parameter.

Parameters:
label - label of this date field
dateTime - date and time that will be set as a default value
mode - mode of this date field, value comes from IppDateField.Mode
dateKey - key that will identify date from this field when the form is submitted to a remote server
timeKey - key that will identify time from this field when the form is submitted to a remote server

IppDateField

public IppDateField(java.lang.String label,
                    java.util.TimeZone timeZone,
                    java.lang.String date,
                    java.lang.String time,
                    IppDateField.Mode mode,
                    IppDateField.Default defaultValue,
                    java.lang.String dateKey,
                    java.lang.String timeKey)
Parameters:
label - label of this date field
timeZone - any time zone available in Java
date - string representing a date, in YYYY-MM-DD format
time - string representing the time, in HH:MM:SS.mmm format
mode - mode of this date field, value comes from IppDateField.Mode
defaultValue - kind of the default value
dateKey - key that will identify date from this field when the form is submitted to a remote server
timeKey - key that will identify time from this field when the form is submitted to a remote server
Method Detail

attributesToXmlString

protected java.lang.StringBuffer attributesToXmlString()
Description copied from class: Xml
Should be overridden by classes that have some attributes.

Overrides:
attributesToXmlString in class Xml
Returns:
XML-text containing all attributes of the object