java.lang.Object
com.independentsoft.office.odf.fields.Field
com.independentsoft.office.odf.fields.Date
All Implemented Interfaces:
IContentElement, IParagraphContent

public class Date extends Field
Displays a date, by default this is the current date. The date can be adjusted to display a date other than the current date.
  • Constructor Details

  • Method Details

    • getContentElements

      public List<IContentElement> getContentElements()
      Returns all content elements.
      Specified by:
      getContentElements in interface IContentElement
      Specified by:
      getContentElements in class Field
      Returns:
      A collection of content elements.
    • getParent

      public IContentElement getParent()
      Returns the parent content element.
      Specified by:
      getParent in interface IContentElement
      Overrides:
      getParent in class Field
      Returns:
      the parent
    • setParent

      public void setParent(IContentElement parent)
      Sets the parent content element.
      Specified by:
      setParent in interface IContentElement
      Overrides:
      setParent in class Field
      Parameters:
      parent - the new parent
    • clone

      public Date clone()
      Creates a new object that is a deep copy of the current instance.
      Specified by:
      clone in interface IContentElement
      Specified by:
      clone in interface IParagraphContent
      Specified by:
      clone in class Field
      Returns:
      A new object that is a copy of this instance.
    • toString

      public String toString()
      Converts the value of the current Date object to its equivalent string representation.
      Overrides:
      toString in class Object
      Returns:
      the string
    • getDateValue

      public String getDateValue()
      Gets the date value. This attribute can also be used to specify a future date. If no value is specified, whether the field is marked as fixed or not, the current date is assumed.
      Returns:
      the date value
    • setDateValue

      public void setDateValue(String dateValue)
      Sets the date value. This attribute can also be used to specify a future date. If no value is specified, whether the field is marked as fixed or not, the current date is assumed.
      Parameters:
      dateValue - the new date value
    • getStyle

      public String getStyle()
      Gets the data style to format a numeric value.
      Returns:
      the style
    • setStyle

      public void setStyle(String style)
      Sets the data style to format a numeric value.
      Parameters:
      style - the new style
    • getValue

      public String getValue()
      Gets date value.
      Returns:
      the value
    • setValue

      public void setValue(String value)
      Sets date value.
      Parameters:
      value - the new value
    • isFixed

      public boolean isFixed()
      Specifies whether the value of a field element is fixed. The defined values are: - false: value of field element may be replaced with a new value in future edits. - true: value of field element shall be preserved in future edits.
      Returns:
      true, if is fixed
    • setFixed

      public void setFixed(boolean isFixed)
      Specifies whether the value of a field element is fixed. The defined values are: - false: value of field element may be replaced with a new value in future edits. - true: value of field element shall be preserved in future edits.
      Parameters:
      isFixed - the new fixed
    • getAdjustment

      public String getAdjustment()
      Gets an adjustment to the value of a date field. If the time period is negative, it gets subtracted from the value of the date field, yielding a date before the current date.
      Returns:
      the adjustment
    • setAdjustment

      public void setAdjustment(String adjustment)
      Sets an adjustment to the value of a date field. If the time period is negative, it gets subtracted from the value of the date field, yielding a date before the current date.
      Parameters:
      adjustment - the new adjustment