org.odftoolkit.simple.common.field
Class VariableField

java.lang.Object
  extended by org.odftoolkit.simple.Component
      extended by org.odftoolkit.simple.common.field.Field
          extended by org.odftoolkit.simple.common.field.VariableField

public class VariableField
extends Field

ODF document can contain variables, which are processed or displayed as VariableFields. In an ODF file, variable declarations shall precede in document order any use of those variable declarations.

Since:
0.5

Nested Class Summary
static class VariableField.VariableType
          A VariableType represents the type of the variable field.
 
Nested classes/interfaces inherited from class org.odftoolkit.simple.common.field.Field
Field.FieldType
 
Method Summary
 void displayField(OdfElement refElement)
          Display this variable field after the reference OdfElement.
 Field.FieldType getFieldType()
          Return the type of this field.
 OdfElement getOdfElement()
          Return the instance of OdfElement which presents this structure.
 String getVariableName()
          Get the variable field name.
 void updateField(String value, OdfElement refElement)
          Reset the value of this variable field after the reference OdfElement.
 
Methods inherited from class org.odftoolkit.simple.Component
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

updateField

public void updateField(String value,
                        OdfElement refElement)
Reset the value of this variable field after the reference OdfElement.

Note: For user variable, the value of all fields in the document that display the user variable will be reset.

Parameters:
value - the new value of this variable field.
refElement - the reference OdfElement. The variable field will be appended after this element. For user variable, this parameter can be null.

displayField

public void displayField(OdfElement refElement)
Display this variable field after the reference OdfElement.

Parameters:
refElement - the reference OdfElement. The variable field will be appended after this element.

getVariableName

public String getVariableName()
Get the variable field name.

Returns:
the variable field name

getOdfElement

public OdfElement getOdfElement()
Description copied from class: Component
Return the instance of OdfElement which presents this structure.

Specified by:
getOdfElement in class Component
Returns:
the instance of OdfElement

getFieldType

public Field.FieldType getFieldType()
Description copied from class: Field
Return the type of this field.

Specified by:
getFieldType in class Field
Returns:
the type of this field.


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.