public class OdsoFieldMapDataCollection
Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }
Constructor Summary |
---|
Property Getters/Setters Summary | ||
---|---|---|
int | getCount() | |
Gets the number of elements contained in the collection.
|
||
OdsoFieldMapData | get(int index) | |
void | set(intindex, OdsoFieldMapData value) | |
Gets or sets an item in this collection. |
Method Summary | ||
---|---|---|
int | add(OdsoFieldMapData value) | |
Adds an object to the end of this collection.
|
||
void | clear() | |
Removes all elements from this collection.
|
||
java.util.Iterator<OdsoFieldMapData> | iterator() | |
Returns an iterator object that can be used to iterate over all items in the collection.
|
||
void | removeAt(int index) | |
Removes the element at the specified index.
|
public int getCount()
Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }
public OdsoFieldMapData get(int index) / public void set(int index, OdsoFieldMapData value)
Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }
public int add(OdsoFieldMapData value)
value
- The object to add. Cannot be null.Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }
public void clear()
Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }
public java.util.Iterator<OdsoFieldMapData> iterator()
Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }
public void removeAt(int index)
index
- The zero-based index of the element.Example:
Shows how to access the collection of data that maps data source columns to merge fields.Document doc = new Document(getMyDir() + "OdsoData.doc"); // This collection defines how columns from an external data source will be mapped to predefined MERGEFIELD, // ADDRESSBLOCK and GREETINGLINE fields during a mail merge OdsoFieldMapDataCollection fieldMapDataCollection = doc.getMailMergeSettings().getOdso().getFieldMapDatas(); Assert.assertEquals(fieldMapDataCollection.getCount(), 30); int index = 0; for (OdsoFieldMapData data : fieldMapDataCollection) { System.out.println(MessageFormat.format("Field map data index #{0}, type \"{1}\":", index++, data.getType())); if (data.getType() != OdsoFieldMappingType.NULL) { System.out.println(MessageFormat.format("\tColumn named {0}, number {1} in the data source mapped to merge field named {2}.", data.getName(), data.getColumn(), data.getMappedName())); } else { System.out.println("\tNo valid column to field mapping data present."); } Assert.assertNotEquals(data, data.deepClone()); }