Package org.apache.poi.xwpf.usermodel
Class XWPFNumbering
- java.lang.Object
-
- org.apache.poi.ooxml.POIXMLDocumentPart
-
- org.apache.poi.xwpf.usermodel.XWPFNumbering
-
- Direct Known Subclasses:
XWPFNumberingShim
public class XWPFNumbering extends POIXMLDocumentPart
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Constructor Summary
Constructors Constructor Description XWPFNumbering()
create a new XWPFNumbering object for use in a new documentXWPFNumbering(PackagePart part)
create a new styles object with an existing document
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigInteger
addAbstractNum(XWPFAbstractNum abstractNum)
add a new AbstractNum and return its AbstractNumIDjava.math.BigInteger
addNum(java.math.BigInteger abstractNumID)
Add a new num with an abstractNumIDvoid
addNum(java.math.BigInteger abstractNumID, java.math.BigInteger numID)
Add a new num with an abstractNumID and a numIDjava.math.BigInteger
addNum(XWPFNum num)
add a new number to the numbering documentXWPFAbstractNum
getAbstractNum(java.math.BigInteger abstractNumID)
get AbstractNum by abstractNumIDjava.math.BigInteger
getAbstractNumID(java.math.BigInteger numID)
return the abstractNumID If the AbstractNumID not exists return nulljava.math.BigInteger
getIdOfAbstractNum(XWPFAbstractNum abstractNum)
Compare AbstractNum with abstractNums of this numbering document.XWPFNum
getNum(java.math.BigInteger numID)
get Num by NumIDboolean
numExist(java.math.BigInteger numID)
Checks whether number with numID existsboolean
removeAbstractNum(java.math.BigInteger abstractNumID)
remove an existing abstractNumvoid
setNumbering(CTNumbering numbering)
Sets the ctNumbering-
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, setCommited, toString
-
-
-
-
Constructor Detail
-
XWPFNumbering
public XWPFNumbering(PackagePart part) throws java.io.IOException, OpenXML4JException
create a new styles object with an existing document- Throws:
java.io.IOException
OpenXML4JException
- Since:
- POI 3.14-Beta1
-
XWPFNumbering
public XWPFNumbering()
create a new XWPFNumbering object for use in a new document
-
-
Method Detail
-
setNumbering
public void setNumbering(CTNumbering numbering)
Sets the ctNumbering- Parameters:
numbering
-
-
numExist
public boolean numExist(java.math.BigInteger numID)
Checks whether number with numID exists- Parameters:
numID
-- Returns:
- boolean true if num exist, false if num not exist
-
addNum
public java.math.BigInteger addNum(XWPFNum num)
add a new number to the numbering document- Parameters:
num
-
-
addNum
public java.math.BigInteger addNum(java.math.BigInteger abstractNumID)
Add a new num with an abstractNumID- Returns:
- return NumId of the added num
-
addNum
public void addNum(java.math.BigInteger abstractNumID, java.math.BigInteger numID)
Add a new num with an abstractNumID and a numID- Parameters:
abstractNumID
-numID
-
-
getNum
public XWPFNum getNum(java.math.BigInteger numID)
get Num by NumID- Parameters:
numID
-- Returns:
- abstractNum with NumId if no Num exists with that NumID null will be returned
-
getAbstractNum
public XWPFAbstractNum getAbstractNum(java.math.BigInteger abstractNumID)
get AbstractNum by abstractNumID- Parameters:
abstractNumID
-- Returns:
- abstractNum with abstractNumId if no abstractNum exists with that abstractNumID null will be returned
-
getIdOfAbstractNum
public java.math.BigInteger getIdOfAbstractNum(XWPFAbstractNum abstractNum)
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
public java.math.BigInteger addAbstractNum(XWPFAbstractNum abstractNum)
add a new AbstractNum and return its AbstractNumID- Parameters:
abstractNum
-
-
removeAbstractNum
public boolean removeAbstractNum(java.math.BigInteger abstractNumID)
remove an existing abstractNum- Parameters:
abstractNumID
-- Returns:
- true if abstractNum with abstractNumID exists in NumberingArray, false if abstractNum with abstractNumID not exists
-
getAbstractNumID
public java.math.BigInteger getAbstractNumID(java.math.BigInteger numID)
return the abstractNumID If the AbstractNumID not exists return null- Parameters:
numID
-- Returns:
- abstractNumID
-
-