📄 documentsummaryinformation.java
字号:
*/ public int getMMClipCount() { return getPropertyIntValue(PropertyIDMap.PID_MMCLIPCOUNT); } /** * <p>Sets the mmclip count.</p> * * @param mmClipCount The mmclip count to set. */ public void setMMClipCount(final int mmClipCount) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_MMCLIPCOUNT, mmClipCount); } /** * <p>Removes the mmclip count.</p> */ public void removeMMClipCount() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_MMCLIPCOUNT); } /** * <p>Returns <code>true</code> when scaling of the thumbnail is * desired, <code>false</code> if cropping is desired.</p> * * @return The scale value */ public boolean getScale() { return getPropertyBooleanValue(PropertyIDMap.PID_SCALE); } /** * <p>Sets the scale.</p> * * @param scale The scale to set. */ public void setScale(final boolean scale) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_SCALE, scale); } /** * <p>Removes the scale.</p> */ public void removeScale() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_SCALE); } /** * <p>Returns the heading pair (or <code>null</code>) * <strong>when this method is implemented. Please note that the * return type is likely to change!</strong> * * @return The heading pair value */ public byte[] getHeadingPair() { notYetImplemented("Reading byte arrays "); return (byte[]) getProperty(PropertyIDMap.PID_HEADINGPAIR); } /** * <p>Sets the heading pair.</p> * * @param headingPair The heading pair to set. */ public void setHeadingPair(final byte[] headingPair) { notYetImplemented("Writing byte arrays "); } /** * <p>Removes the heading pair.</p> */ public void removeHeadingPair() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_HEADINGPAIR); } /** * <p>Returns the doc parts (or <code>null</code>) * <strong>when this method is implemented. Please note that the * return type is likely to change!</strong> * * @return The doc parts value */ public byte[] getDocparts() { notYetImplemented("Reading byte arrays"); return (byte[]) getProperty(PropertyIDMap.PID_DOCPARTS); } /** * <p>Sets the doc parts.</p> * * @param docparts The doc parts to set. */ public void setDocparts(final byte[] docparts) { notYetImplemented("Writing byte arrays"); } /** * <p>Removes the doc parts.</p> */ public void removeDocparts() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_DOCPARTS); } /** * <p>Returns the manager (or <code>null</code>).</p> * * @return The manager value */ public String getManager() { return (String) getProperty(PropertyIDMap.PID_MANAGER); } /** * <p>Sets the manager.</p> * * @param manager The manager to set. */ public void setManager(final String manager) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_MANAGER, manager); } /** * <p>Removes the manager.</p> */ public void removeManager() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_MANAGER); } /** * <p>Returns the company (or <code>null</code>).</p> * * @return The company value */ public String getCompany() { return (String) getProperty(PropertyIDMap.PID_COMPANY); } /** * <p>Sets the company.</p> * * @param company The company to set. */ public void setCompany(final String company) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_COMPANY, company); } /** * <p>Removes the company.</p> */ public void removeCompany() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_COMPANY); } /** * <p>Returns <code>true</code> if the custom links are dirty.</p> <p> * * @return The links dirty value */ public boolean getLinksDirty() { return getPropertyBooleanValue(PropertyIDMap.PID_LINKSDIRTY); } /** * <p>Sets the linksDirty.</p> * * @param linksDirty The links dirty value to set. */ public void setLinksDirty(final boolean linksDirty) { final MutableSection s = (MutableSection) getFirstSection(); s.setProperty(PropertyIDMap.PID_LINKSDIRTY, linksDirty); } /** * <p>Removes the links dirty.</p> */ public void removeLinksDirty() { final MutableSection s = (MutableSection) getFirstSection(); s.removeProperty(PropertyIDMap.PID_LINKSDIRTY); } /** * <p>Gets the custom properties.</p> * * @return The custom properties. * @since 2006-02-09 */ public CustomProperties getCustomProperties() { CustomProperties cps = null; if (getSectionCount() >= 2) { cps = new CustomProperties(); final Section section = (Section) getSections().get(1); final Map dictionary = section.getDictionary(); final Property[] properties = section.getProperties(); int propertyCount = 0; for (int i = 0; i < properties.length; i++) { final Property p = properties[i]; final long id = p.getID(); if (id != 0 && id != 1) { propertyCount++; final CustomProperty cp = new CustomProperty(p, (String) dictionary.get(new Long(id))); cps.put(cp.getName(), cp); } } if (cps.size() != propertyCount) cps.setPure(false); } return cps; } /** * <p>Sets the custom properties.</p> * * @param customProperties The custom properties * @since 2006-02-07 */ public void setCustomProperties(final CustomProperties customProperties) { ensureSection2(); final MutableSection section = (MutableSection) getSections().get(1); final Map dictionary = customProperties.getDictionary(); section.clear(); /* Set the codepage. If both custom properties and section have a * codepage, the codepage from the custom properties wins, else take the * one that is defined. If none is defined, take Unicode. */ int cpCodepage = customProperties.getCodepage(); if (cpCodepage < 0) cpCodepage = section.getCodepage(); if (cpCodepage < 0) cpCodepage = Constants.CP_UNICODE; customProperties.setCodepage(cpCodepage); section.setCodepage(cpCodepage); section.setDictionary(dictionary); for (final Iterator i = customProperties.values().iterator(); i.hasNext();) { final Property p = (Property) i.next(); section.setProperty(p); } } /** * <p>Creates section 2 if it is not already present.</p> * */ private void ensureSection2() { if (getSectionCount() < 2) { MutableSection s2 = new MutableSection(); s2.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[1]); addSection(s2); } } /** * <p>Removes the custom properties.</p> * * @since 2006-02-08 */ public void removeCustomProperties() { if (getSectionCount() >= 2) getSections().remove(1); else throw new HPSFRuntimeException("Illegal internal format of Document SummaryInformation stream: second section is missing."); } /** * <p>Throws an {@link UnsupportedOperationException} with a message text * telling which functionality is not yet implemented.</p> * * @param msg text telling was leaves to be implemented, e.g. * "Reading byte arrays". */ private void notYetImplemented(final String msg) { throw new UnsupportedOperationException(msg + " is not yet implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -