com.atlassian.confluence.content.render.xhtml.storage.macro.inlinebody
Class ParagraphFragment

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.storage.macro.inlinebody.ParagraphFragment
All Implemented Interfaces:
Fragment

public class ParagraphFragment
extends java.lang.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 (see canMerge(ParagraphFragment).


Constructor Summary
ParagraphFragment(javax.xml.stream.XMLEventFactory xmlEventFactory)
           
ParagraphFragment(javax.xml.stream.XMLEventReader xmlEventReader)
           
 
Method Summary
 void add(Fragment fragment)
          Add a fragment to this paragraph fragment.
 java.util.Set<javax.xml.stream.events.Attribute> attributes()
           
 java.util.List<javax.xml.stream.events.XMLEvent> bodyEvents()
           
 boolean canMerge(ParagraphFragment paragraphFragment)
          True if the specified paragraph fragment can be merged into the current paragraph fragment.
 java.util.List<javax.xml.stream.events.XMLEvent> events()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParagraphFragment

public ParagraphFragment(javax.xml.stream.XMLEventFactory xmlEventFactory)

ParagraphFragment

public ParagraphFragment(javax.xml.stream.XMLEventReader xmlEventReader)
                  throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.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 java.util.List<javax.xml.stream.events.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)

events

public java.util.List<javax.xml.stream.events.XMLEvent> events()
Specified by:
events in interface Fragment
Returns:
a read-only list of xml events representing this paragraph fragment.

attributes

public java.util.Set<javax.xml.stream.events.Attribute> attributes()
Returns:
a read-only set of attributes on this paragraph fragment


Copyright © 2003-2014 Atlassian. All Rights Reserved.