com.aspose.words
Class FieldBuilder

java.lang.Object
    extended by com.aspose.words.FieldBuilder

public class FieldBuilder 
extends java.lang.Object

Builds a field from field code tokens (arguments and switches).

Constructor Summary
FieldBuilder(int fieldType)
           Initializes an instance of the FieldBuilder class.
 
Method Summary
FieldBuilderaddArgument(FieldArgumentBuilder argument)
           Adds a field's argument represented by FieldArgumentBuilder to the field's code.
FieldBuilderaddArgument(FieldBuilder argument)
           Adds a child field represented by another FieldBuilder to the field's code.
FieldBuilderaddArgument(double argument)
           Adds a field's argument.
FieldBuilderaddArgument(int argument)
           Adds a field's argument.
FieldBuilderaddArgument(java.lang.String argument)
           Adds a field's argument.
FieldBuilderaddSwitch(java.lang.String switchName)
           Adds a field's switch.
FieldBuilderaddSwitch(java.lang.String switchName, double switchArgument)
           Adds a field's switch.
FieldBuilderaddSwitch(java.lang.String switchName, int switchArgument)
           Adds a field's switch.
FieldBuilderaddSwitch(java.lang.String switchName, java.lang.String switchArgument)
           Adds a field's switch.
FieldbuildAndInsert(Inline refNode)
           Builds and inserts a field into the document before the specified inline node.
FieldbuildAndInsert(Paragraph refNode)
           Builds and inserts a field into the document to the end of the specified paragraph.
 

Constructor Detail

FieldBuilder

public FieldBuilder(int fieldType)
Initializes an instance of the FieldBuilder class.
Parameters:
fieldType - A FieldType value. The type of the field to build.

Method Detail

addArgument

public FieldBuilder addArgument(FieldArgumentBuilder argument)
Adds a field's argument represented by FieldArgumentBuilder to the field's code. This overload is used when the argument consists of a mixture of different parts such as child fields, nodes, and plain text.

addArgument

public FieldBuilder addArgument(FieldBuilder argument)
Adds a child field represented by another FieldBuilder to the field's code. This overload is used when the argument consists of a single child field.

addArgument

public FieldBuilder addArgument(double argument)
Adds a field's argument.
Parameters:
argument - The argument value.

addArgument

public FieldBuilder addArgument(int argument)
Adds a field's argument.
Parameters:
argument - The argument value.

addArgument

public FieldBuilder addArgument(java.lang.String argument)
Adds a field's argument.
Parameters:
argument - The argument value.

addSwitch

public FieldBuilder addSwitch(java.lang.String switchName)
Adds a field's switch. This overload adds a flag (switch without argument).
Parameters:
switchName - The switch name.

addSwitch

public FieldBuilder addSwitch(java.lang.String switchName, double switchArgument)
Adds a field's switch.
Parameters:
switchName - The switch name.
switchArgument - The switch value.

addSwitch

public FieldBuilder addSwitch(java.lang.String switchName, int switchArgument)
Adds a field's switch.
Parameters:
switchName - The switch name.
switchArgument - The switch value.

addSwitch

public FieldBuilder addSwitch(java.lang.String switchName, java.lang.String switchArgument)
Adds a field's switch.
Parameters:
switchName - The switch name.
switchArgument - The switch value.

buildAndInsert

public Field buildAndInsert(Inline refNode)
                    throws java.lang.Exception
Builds and inserts a field into the document before the specified inline node.
Returns:
A Field object that represents the inserted field.

buildAndInsert

public Field buildAndInsert(Paragraph refNode)
                    throws java.lang.Exception
Builds and inserts a field into the document to the end of the specified paragraph.
Returns:
A Field object that represents the inserted field.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.