Package org.apache.poi.xwpf.usermodel
Class XWPFNumbering
java.lang.Object
org.apache.poi.ooxml.POIXMLDocumentPart
org.apache.poi.xwpf.usermodel.XWPFNumbering
- Author:
- Philipp Epp
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptioncreate a new XWPFNumbering object for use in a new documentXWPFNumbering
(PackagePart part) create a new styles object with an existing document -
Method Summary
Modifier and TypeMethodDescriptionaddAbstractNum
(XWPFAbstractNum abstractNum) add a new AbstractNum and return its AbstractNumIDaddNum
(BigInteger abstractNumID) Add a new num with an abstractNumIDvoid
addNum
(BigInteger abstractNumID, BigInteger numID) Add a new num with an abstractNumID and a numIDadd a new number to the numbering documentprotected void
commit()
save and commit numberinggetAbstractNum
(BigInteger abstractNumID) get AbstractNum by abstractNumIDgetAbstractNumID
(BigInteger numID) return the abstractNumID If the AbstractNumID not exists return nullgetIdOfAbstractNum
(XWPFAbstractNum abstractNum) Compare AbstractNum with abstractNums of this numbering document.getNum
(BigInteger numID) get Num by NumIDboolean
numExist
(BigInteger numID) Checks whether number with numID existsprotected void
read numbering form an existing packageboolean
removeAbstractNum
(BigInteger abstractNumID) remove an existing abstractNumvoid
setNumbering
(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumbering numbering) Sets the ctNumberingMethods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommited, onDocumentCreate, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommited, toString
-
Field Details
-
abstractNums
-
nums
-
-
Constructor Details
-
XWPFNumbering
create a new styles object with an existing document- Throws:
IOException
OpenXML4JException
- Since:
- POI 3.14-Beta1
-
XWPFNumbering
public XWPFNumbering()create a new XWPFNumbering object for use in a new document
-
-
Method Details
-
onDocumentRead
read numbering form an existing package- Overrides:
onDocumentRead
in classPOIXMLDocumentPart
- Throws:
IOException
- a subclass may throw an IOException when a document is read
-
commit
save and commit numbering- Overrides:
commit
in classPOIXMLDocumentPart
- Throws:
IOException
- a subclass may throw an IOException if the changes can't be committed
-
setNumbering
public void setNumbering(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumbering numbering) Sets the ctNumbering- Parameters:
numbering
-
-
numExist
Checks whether number with numID exists- Parameters:
numID
-- Returns:
- boolean true if num exist, false if num not exist
-
addNum
add a new number to the numbering document- Parameters:
num
-
-
addNum
Add a new num with an abstractNumID- Returns:
- return NumId of the added num
-
addNum
Add a new num with an abstractNumID and a numID- Parameters:
abstractNumID
-numID
-
-
getNum
get Num by NumID- Parameters:
numID
-- Returns:
- abstractNum with NumId if no Num exists with that NumID null will be returned
-
getAbstractNum
get AbstractNum by abstractNumID- Parameters:
abstractNumID
-- Returns:
- abstractNum with abstractNumId if no abstractNum exists with that abstractNumID null will be returned
-
getIdOfAbstractNum
Compare AbstractNum with abstractNums of this numbering document. If the content of abstractNum equals with an abstractNum of the List in numbering the BigInteger Value of it will be returned. If no equal abstractNum is existing null will be returned- Parameters:
abstractNum
-- Returns:
- BigInteger
-
addAbstractNum
add a new AbstractNum and return its AbstractNumID- Parameters:
abstractNum
-
-
removeAbstractNum
remove an existing abstractNum- Parameters:
abstractNumID
-- Returns:
- true if abstractNum with abstractNumID exists in NumberingArray, false if abstractNum with abstractNumID not exists
-
getAbstractNumID
return the abstractNumID If the AbstractNumID not exists return null- Parameters:
numID
-- Returns:
- abstractNumID
-