Class ParagraphFragment
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.storage.macro.inlinebody.ParagraphFragment
-
- All Implemented Interfaces:
Fragment
public class ParagraphFragment extends Object implements Fragment
Represents a paragraph fragment.You can add
InlineMacroFragments to this fragment as well as merge other paragraph fragments into it under certain conditions (seecanMerge(ParagraphFragment).
-
-
Constructor Summary
Constructors Constructor Description ParagraphFragment(XMLEventFactory xmlEventFactory)ParagraphFragment(XMLEventReader xmlEventReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Fragment fragment)Add a fragment to this paragraph fragment.Set<Attribute>attributes()List<XMLEvent>bodyEvents()booleancanMerge(ParagraphFragment paragraphFragment)True if the specified paragraph fragment can be merged into the current paragraph fragment.List<XMLEvent>events()booleanisAutoCursorTarget()
-
-
-
Constructor Detail
-
ParagraphFragment
public ParagraphFragment(XMLEventFactory xmlEventFactory)
-
ParagraphFragment
public ParagraphFragment(XMLEventReader xmlEventReader) throws XMLStreamException
- Throws:
XMLStreamException
-
-
Method Detail
-
add
public void add(Fragment fragment)
Add a fragment to this paragraph fragment.- Parameters:
fragment- the fragment to add.
-
canMerge
public boolean canMerge(ParagraphFragment paragraphFragment)
True if the specified paragraph fragment can be merged into the current paragraph fragment. This will only be possible if: (a) the last fragment added to the paragraph is an inline macro fragment AND (b) the attributes of the specified paragraph and this paragraph are equal- Parameters:
paragraphFragment- the paragraph fragment to merge- Returns:
- True if the specified paragraph fragment can be merged, false otherwise.
-
bodyEvents
public List<XMLEvent> bodyEvents()
- Returns:
- a read-only list of xml events constituting the body of the paragraph fragment (i.e. excluding the start and end paragraph events)
-
isAutoCursorTarget
public boolean isAutoCursorTarget()
-
-