com.aspose.words

Class MappedDataFieldCollection

  • java.lang.Object
    • com.aspose.words.MappedDataFieldCollection
  • All Implemented Interfaces:
    java.lang.Iterable
    public class MappedDataFieldCollection 
    extends java.lang.Object

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
intgetCount()
Gets the number of elements contained in the collection.
java.lang.Stringget(java.lang.String documentFieldName)
void
set(java.lang.StringdocumentFieldName, java.lang.Stringvalue)
           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.
voidclear()
Removes all elements from the collection.
booleancontainsKey(java.lang.String documentFieldName)
Determines whether a mapping from the specified field in the document exists in the collection.
booleancontainsValue(java.lang.String dataSourceFieldName)
Determines whether a mapping from the specified field in the data source exists in the collection.
java.util.Iterator<java.util.Map.Entry<java.lang.String, java.lang.String>>iterator()
Returns a dictionary iterator object that can be used to iterate over all items in the collection.
voidremove(java.lang.String documentFieldName)
Removes a field mapping.
 

    • Property Getters/Setters Detail

      • getCount

        public int getCount()
        
        Gets the number of elements contained in the collection.
      • 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");
      • clear

        public void clear()
        Removes all elements from the collection.
      • 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.
      • containsValue

        public boolean containsValue(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.
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.String, java.lang.String>> iterator()
        Returns a dictionary iterator object that can be used to iterate over all items in the collection.
      • 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.