306307308309310311312313314315316317
if(contains(name)) { throw new IllegalArgumentException("A property with this name " + "already exists in the custom properties"); } CTProperty p = props.getProperties().addNewProperty(); int pid = nextPid(); p.setPid(pid); p.setFmtid(FORMAT_ID); p.setName(name); return p; }
320321322323324325326327
* Add a new string property * * @throws IllegalArgumentException if a property with this name already exists */ public void addProperty(String name, String value){ CTProperty p = add(name); p.setLpwstr(value); }
330331332333334335336337
* Add a new double property * * @throws IllegalArgumentException if a property with this name already exists */ public void addProperty(String name, double value){ CTProperty p = add(name); p.setR8(value); }
340341342343344345346347
* Add a new integer property * * @throws IllegalArgumentException if a property with this name already exists */ public void addProperty(String name, int value){ CTProperty p = add(name); p.setI4(value); }
350351352353354355356357
* Add a new boolean property * * @throws IllegalArgumentException if a property with this name already exists */ public void addProperty(String name, boolean value){ CTProperty p = add(name); p.setBool(value); }
316317318319320321322323324325326327
360361362363364365366367