Class DrawingPropsIdTracker
java.lang.Object
org.docx4j.openpackaging.parts.WordprocessingML.DrawingPropsIdTracker
wp:docPr/@id must be unique across all parts in a docx,
otherwise Word can't open the docx. This problem is
difficult to track down if you aren't aware of it,
so this class attempts to keep track of Ids in use,
and dispense unique values.
There is one DocPropIdTracker per package.
Relies on Docx4jUnmarshallerListener so is susceptible
to those cases where that listener is not listening.
- Since:
- 11.4.6
- Author:
- jharrop
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidderegisterPart(Part part) If its been unmarshalled, we'll already know about any docPr ids it may contain, so forget about it.longIf this throws an exception, you'll have to create an Id on your own.voidregisterId(long num) voidregisterPart(Part part) Keep track of parts which are yet to be unmarshalled.
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
DrawingPropsIdTracker
public DrawingPropsIdTracker()
-
-
Method Details
-
registerPart
Keep track of parts which are yet to be unmarshalled.- Parameters:
part-
-
deregisterPart
If its been unmarshalled, we'll already know about any docPr ids it may contain, so forget about it.- Parameters:
part-
-
registerId
public void registerId(long num) -
generateId
If this throws an exception, you'll have to create an Id on your own.- Returns:
- Throws:
Docx4JException
-