com.aspose.words
Class MappedDataFieldCollection

java.util.TreeMap
    extended by com.aspose.words.MappedDataFieldCollection

public class MappedDataFieldCollection 
extends java.util.TreeMap

Allows to automatically map between names of fields in your data source and names of mail merge fields in the document.

This is implemented as a collection of string keys into string values. The keys are the names of mail merge fields in the document and the values are the names of fields in your data source.

Example:

Shows how to add a mapping when a merge field in a document and a data field in a data source have different names.
doc.getMailMerge().getMappedDataFields().add("MyFieldName_InDocument", "MyFieldName_InDataSource");
See Also:
MailMerge, MailMerge.MappedDataFields

Property Getters/Setters Summary
java.lang.Stringget(java.lang.String documentFieldName)
voidset(java.lang.String documentFieldName, java.lang.String value)
           Gets or sets the name of the field in the data source associated with the specified mail merge field.
 
Method Summary
voidadd(java.lang.String documentFieldName, java.lang.String dataSourceFieldName)
           Adds a new field mapping.
booleancontains(java.lang.String dataSourceFieldName)
           Determines whether a mapping from the specified field in the data source exists in the collection.
booleancontainsKey(java.lang.String documentFieldName)
           Determines whether a mapping from the specified field in the document exists in the collection.
voidremove(java.lang.String documentFieldName)
           Removes a field mapping.
 

Property Getters/Setters Detail

get/set

public java.lang.String get(java.lang.String documentFieldName) / public void set(java.lang.String documentFieldName, java.lang.String value)
Gets or sets the name of the field in the data source associated with the specified mail merge field.

Method Detail

add

public void add(java.lang.String documentFieldName, java.lang.String dataSourceFieldName)
Adds a new field mapping.
Parameters:
documentFieldName - Case-sensitive name of the mail merge field in the document.
dataSourceFieldName - Case-sensitive name of the field in the data source.

Example:

Shows how to add a mapping when a merge field in a document and a data field in a data source have different names.
doc.getMailMerge().getMappedDataFields().add("MyFieldName_InDocument", "MyFieldName_InDataSource");

remove

public void remove(java.lang.String documentFieldName)
Removes a field mapping.
Parameters:
documentFieldName - Case-sensitive name of the mail merge field in the document.

contains

public boolean contains(java.lang.String dataSourceFieldName)
Determines whether a mapping from the specified field in the data source exists in the collection.
Parameters:
dataSourceFieldName - Case-sensitive name of the field in the data source.
Returns:
True if item is found in the collection; otherwise, false.

containsKey

public boolean containsKey(java.lang.String documentFieldName)
Determines whether a mapping from the specified field in the document exists in the collection.
Parameters:
documentFieldName - Case-sensitive name of the mail merge field in the document.
Returns:
True if item is found in the collection; otherwise, false.

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