Skip to content

Commit

Permalink
slight changes to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
iSnow committed Apr 23, 2018
1 parent a2f86fe commit 22fcfef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class User {
@Column annoatation indicates a property that you want it to be serialized to excel.
By default, if no "name" attribute is provided the excel column name will be taken from the property name.

Now same way as before but this time using bean writer instead of simple:
Now we'll write the same data as before but this time using bean writer instead of simple:
```java
Xcelite xcelite = new Xcelite();
XceliteSheet sheet = xcelite.createSheet("users");
Expand All @@ -74,7 +74,7 @@ xcelite.write(new File("users_doc.xlsx"));
```
This will create a sheet with 4 columns plus header row: Firstname, Lastname, id and birthDate.
Naturally, the excel column types will be Text for FirstName and LastName, Number for id and Date for birthDate.
If you'de prefer that "id" column will be written as Text instead of Number, use
If you prefer that "id" column should be written as Text instead of Number, use

```java
@Column(ignoreType=true)
Expand Down Expand Up @@ -130,7 +130,7 @@ private List<String> mailAddresses;
```
The CSVColumnValueConverter takes a collection of objects and serializes it to a comma seperated String.
Alternately when deserializing, the converter takes a comma seperated String and deserializes it to a collection of Objects.
So writing a collection of users will result with a cloumn named "Emails" and the column data will look someting like that:
So writing a collection of users will result with a column named "Emails" and the column data will look someting like that:
[email protected],[email protected],[email protected]

When reading the sheet to a collection of Users, the column "Emails" will be deserialized to an ArrayList.
Expand Down Expand Up @@ -172,7 +172,7 @@ private Map<String, List<String>> dynamicCols;

What about reading from Excel sheet using dynamic columns?

Well, luckily it works both ways. If your bean contains @AnyColumn property, any column in your Excel sheet that is not mapped to a specific property in your bean will be injected to the @AnyColumn annotated Map property. If a converter is declared then the value will be deserialized using the converter before injected to the map.
Well, luckily it works both ways. If your bean contains an @AnyColumn property, any column in your Excel sheet that is not mapped to a specific property in your bean will be injected to the @AnyColumn annotated Map property. If a converter is declared then the value will be deserialized using the converter before injected to the map.
By default, Xcelite will use HashMap implementation for the Map when deserializing. If you'de prefer a different implementation use the 'as' attribute.
For instance, if you want your map to be sorted by column names using a TreeMap, just do:
```java
Expand Down

0 comments on commit 22fcfef

Please sign in to comment.