public org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties getUnderlyingProperties() { return props.getProperties(); }
cust.props.save(out, DEFAULT_XML_OPTIONS);
custPart = pkg.getPart(custRel.getRelationship(0)); if (custPart == null) { cust = new CustomProperties((org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument)NEW_CUST_INSTANCE.copy()); } else { org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props = org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument.Factory.parse( cust = new CustomProperties((org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument)NEW_CUST_INSTANCE.copy());
custPart = pkg.getPart(custRel.getRelationship(0)); if (custPart == null) { cust = new CustomProperties((org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument)NEW_CUST_INSTANCE.copy()); } else { org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props = org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument.Factory.parse( cust = new CustomProperties((org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument)NEW_CUST_INSTANCE.copy());
/** * Check if a property with this name already exists in the collection of custom properties * * @param name the name to check * @return whether a property with the given name exists in the custom properties */ public boolean contains(String name) { for(CTProperty p : props.getProperties().getPropertyList()) { if(p.getName().equals(name)) return true; } return false; }
} else { custPart = null; cust = new CustomProperties((org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument)NEW_CUST_INSTANCE.copy());
cust.props.save(out, xmlOptions); out.close();
/** * Retrieve the custom property with this name, or null if none exists. * * You will need to test the various isSetX methods to work out * what the type of the property is, before fetching the * appropriate value for it. * * @param name the name of the property to fetch * * @return the custom property with this name, or null if none exists */ public CTProperty getProperty(String name) { for(CTProperty p : props.getProperties().getPropertyList()) { if(p.getName().equals(name)) { return p; } } return null; } }
cust.props.save(out, DEFAULT_XML_OPTIONS);
/** * Generate next id that uniquely relates a custom property * * @return next property id starting with 2 */ protected int nextPid() { int propid = 1; for(CTProperty p : props.getProperties().getPropertyList()) { if(p.getPid() > propid) propid = p.getPid(); } return propid + 1; }
/** * Add a new property * * @param name the property name * @throws IllegalArgumentException if a property with this name already exists */ private CTProperty add(String name) { 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; }
public org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties getUnderlyingProperties() { return props.getProperties(); }
public org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties getUnderlyingProperties() { return props.getProperties(); }
/** * Check if a property with this name already exists in the collection of custom properties * * @param name the name to check * @return whether a property with the given name exists in the custom properties */ public boolean contains(String name) { for(CTProperty p : props.getProperties().getPropertyList()) { if(p.getName().equals(name)) return true; } return false; }
/** * Check if a property with this name already exists in the collection of custom properties * * @param name the name to check * @return whether a property with the given name exists in the custom properties */ public boolean contains(String name){ for(CTProperty p : props.getProperties().getPropertyList()){ if(p.getName().equals(name)) return true; } return false; } }
/** * Retrieve the custom property with this name, or null if none exists. * * You will need to test the various isSetX methods to work out * what the type of the property is, before fetching the * appropriate value for it. * * @param name the name of the property to fetch * * @return the custom property with this name, or null if none exists */ public CTProperty getProperty(String name) { for(CTProperty p : props.getProperties().getPropertyList()) { if(p.getName().equals(name)) { return p; } } return null; } }
/** * Generate next id that uniquely relates a custom property * * @return next property id starting with 2 */ protected int nextPid(){ int propid = 1; for(CTProperty p : props.getProperties().getPropertyList()){ if(p.getPid() > propid) propid = p.getPid(); } return propid + 1; }
/** * Generate next id that uniquely relates a custom property * * @return next property id starting with 2 */ protected int nextPid() { int propid = 1; for(CTProperty p : props.getProperties().getPropertyList()) { if(p.getPid() > propid) propid = p.getPid(); } return propid + 1; }
/** * Add a new property * * @param name the property name * @throws IllegalArgumentException if a property with this name already exists */ private CTProperty add(String name) { 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; }
/** * Add a new property * * @param name the property name * @throws IllegalArgumentException if a property with this name already exists */ private CTProperty add(String name) { 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; }