return put(new CustomProperty(p, key));
/** * Gets the custom properties. * * @return The custom properties. */ public CustomProperties getCustomProperties() { CustomProperties cps = null; if (getSectionCount() >= 2) { cps = new CustomProperties(); final Section section = getSections().get(1); final Map<Long,String> dictionary = section.getDictionary(); final Property[] properties = section.getProperties(); int propertyCount = 0; for (Property p : properties) { final long id = p.getID(); if (id == PropertyIDMap.PID_CODEPAGE) { cps.setCodepage((Integer)p.getValue()); } else if (id > PropertyIDMap.PID_CODEPAGE) { propertyCount++; final CustomProperty cp = new CustomProperty(p, dictionary.get(id)); cps.put(cp.getName(), cp); } } if (cps.size() != propertyCount) { cps.setPure(false); } } return cps; }
envelope.setOutputSoapObject(new CustomProperty(null, "request", "34"));
/** * <p>Sets the codepage.</p> * * @param codepage the codepage */ public void setCodepage(final int codepage) { final MutableProperty p = new MutableProperty(); p.setID(PropertyIDMap.PID_CODEPAGE); p.setType(Variant.VT_I2); p.setValue(Integer.valueOf(codepage)); put(new CustomProperty(p)); }
/** * <p>Sets the codepage.</p> * * @param codepage the codepage */ public void setCodepage(final int codepage) { final MutableProperty p = new MutableProperty(); p.setID(PropertyIDMap.PID_CODEPAGE); p.setType(Variant.VT_I2); p.setValue(Integer.valueOf(codepage)); put(new CustomProperty(p)); }
/** * <p>Adds a named date property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Date value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_FILETIME); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named double property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Double value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_R8); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named double property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Double value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_R8); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named integer property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Integer value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_I4); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named integer property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Integer value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_I4); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named date property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Date value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_FILETIME); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named long property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Long value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_I8); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named string property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final String value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_LPWSTR); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named string property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final String value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_LPWSTR); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named boolean property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Boolean value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_BOOL); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named long property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Long value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_I8); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
/** * <p>Adds a named boolean property.</p> * * @param name The property's name. * @param value The property's value. * @return the property that was stored under the specified name before, or * <code>null</code> if there was no such property before. */ public Object put(final String name, final Boolean value) { final MutableProperty p = new MutableProperty(); p.setID(-1); p.setType(Variant.VT_BOOL); p.setValue(value); final CustomProperty cp = new CustomProperty(p, name); return put(cp); }
final CustomProperty cp = new CustomProperty(p, dictionary.get(Long.valueOf(id))); cps.put(cp.getName(), cp);
final CustomProperty cp = new CustomProperty(p, dictionary.get(Long.valueOf(id))); cps.put(cp.getName(), cp);
/** * Gets the custom properties. * * @return The custom properties. */ public CustomProperties getCustomProperties() { CustomProperties cps = null; if (getSectionCount() >= 2) { cps = new CustomProperties(); final Section section = getSections().get(1); final Map<Long,String> dictionary = section.getDictionary(); final Property[] properties = section.getProperties(); int propertyCount = 0; for (Property p : properties) { final long id = p.getID(); if (id == PropertyIDMap.PID_CODEPAGE) { cps.setCodepage((Integer)p.getValue()); } else if (id > PropertyIDMap.PID_CODEPAGE) { propertyCount++; final CustomProperty cp = new CustomProperty(p, dictionary.get(id)); cps.put(cp.getName(), cp); } } if (cps.size() != propertyCount) { cps.setPure(false); } } return cps; }