public class FOText extends FONode implements CharSequence, TextFragment
FONode.FONodeIterator, FONode.GatherContextInfoFunction
FO_URI, FOX_URI, locator, log, nodeChangeBarList, parent, siblings, startOfNodeChangeBarList
Constructor and Description |
---|
FOText(FONode parent)
Creates a new FO text node.
|
Modifier and Type | Method and Description |
---|---|
int |
bidiLevelAt(int position)
Obtain bidirectional level of character at
specified position, which must be a non-negative integer
less than the length of this FO.
|
void |
bind(PropertyList pList)
Bind the given
PropertyList to this node
Does nothing by default. |
protected void |
characters(char[] data,
int start,
int length,
PropertyList list,
Locator locator)
Adds characters.
|
char |
charAt(int position)
Obtain character at specified index within this fragment's sub-sequence,
where index 0 corresponds to beginning index in overal text source, and
subSequenceIndex must be less than ending index - beginning index.
|
CharIterator |
charIterator()
Return a
CharIterator over all characters in this node |
FONode |
clone(FONode parent,
boolean removeChildren)
Performs a shallow cloning operation, sets the clone's parent,
and optionally cleans the list of child nodes
|
protected Stack<DelimitedTextRange> |
collectDelimitedTextRanges(Stack<DelimitedTextRange> ranges,
DelimitedTextRange currentRange)
Collect the sequence of delimited text ranges, where each new
range is pushed onto RANGES, where default implementation collects ranges
of child nodes.
|
protected void |
createBlockPointers(Block ancestorBlock)
This method is run as part of the ancestor Block's flushText(), to
create xref pointers to the previous FOText objects within the same Block
|
void |
endOfNode()
Primarily used for making final content model validation checks
and/or informing the
FOEventHandler that the end of this FO
has been reached. |
void |
finalizeNode()
Finalize this node.
|
protected String |
gatherContextInfo()
Gathers context information for the getContextInfo() method.
|
Length |
getBaseLineShift() |
int |
getBeginIndex()
Obtain beginning index (inclusive) of sub-sequence of fragment in overall text source.
|
int |
getBidiLevel()
Obtain associated bidi level (if known) or -1 if not.
|
int[] |
getBidiLevels()
Obtain bidirectional level of each character
represented by this FOText.
|
int[] |
getBidiLevels(int start,
int end)
Obtain bidirectional level of each character over
interval [start,end).
|
CharSequence |
getCharSequence()
Return the array of characters for this instance.
|
Color |
getColor() |
CommonFont |
getCommonFont() |
CommonHyphenation |
getCommonHyphenation() |
String |
getCountry() |
int |
getEndIndex()
Obtain ending index (exclusive) of sub-sequence of fragment in overall text source.
|
CharacterIterator |
getIterator()
Obtain reference to underlying iterator.
|
KeepProperty |
getKeepTogether() |
String |
getLanguage()
Obtain associated language (if designated) or "none" if not.
|
Property |
getLetterSpacing() |
SpaceProperty |
getLineHeight() |
String |
getLocalName()
Returns the local name (i.e.
|
String |
getNormalNamespacePrefix()
Returns the normally used namespace prefix for this node
|
String |
getScript()
Obtain associated script (if designated) or "auto" if not.
|
StructureTreeElement |
getStructureTreeElement()
Returns the structure tree element associated to this object.
|
CommonTextDecoration |
getTextDecoration() |
int |
getWhitespaceTreatment() |
Property |
getWordSpacing() |
int |
getWrapOption() |
boolean |
isDelimitedTextRangeBoundary(int boundary)
Determine if node has a delimited text range boundary.
|
int |
length() |
void |
resetBuffer()
Resets the backing
java.nio.CharBuffer |
void |
setBidiLevel(int level,
int start,
int end)
Set bidirectional level over interval [start,end).
|
void |
setStructureTreeElement(StructureTreeElement structureTreeElement)
Sets the structure tree element.
|
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
boolean |
willCreateArea()
Check if this text node will create an area.
|
addCharacters, addChildNode, attachSiblings, canHaveMarkers, clone, collectDelimitedTextRanges, createPropertyList, decorateWithContextInfo, errorText, getBuilderContext, getChangeBarList, getChildNodes, getChildNodes, getContentHandlerFactory, getContextInfo, getContextInfoAlt, getExtensionAttachment, getFOEventHandler, getFOValidationEventProducer, getLocator, getLocatorString, getLogger, getName, getName, getNameId, getNamespaceURI, getNodePrefix, getNodeString, getParent, getRoot, getUserAgent, inMarker, invalidChildError, invalidChildError, invalidPropertyValueError, isBidiRangeBlockItem, isChangeBarElement, missingChildElementError, missingChildElementError, missingPropertyError, nodesOutOfOrderError, nodesOutOfOrderError, notSupportedChildError, processNode, removeChild, setLocator, startOfNode, tooManyNodesError, tooManyNodesError, tooManyNodesError, validateChildNode, validateChildNode, warningText
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
public FOText(FONode parent)
parent
- FONode that is the parent of this objectprotected void characters(char[] data, int start, int length, PropertyList list, Locator locator) throws FOPException
#PCDATA
content.characters
in class FONode
data
- array of characters containing text to be addedstart
- starting array element to addlength
- number of elements to addlist
- currently applicable PropertyListlocator
- location in the XSL-FO source file.FOPException
- if there's a problem during processingpublic CharSequence getCharSequence()
public FONode clone(FONode parent, boolean removeChildren) throws FOPException
clone
in class FONode
parent
- the intended parent of the cloneremoveChildren
- if true, clean the list of child nodesFOPException
- if there's a problem while cloning the nodepublic void bind(PropertyList pList) throws FOPException
PropertyList
to this node
Does nothing by default. Subclasses should override this method
in case they want to use the properties available on the
PropertyList
.bind
in class FONode
pList
- the PropertyList
FOPException
- if there was an error when
processing the PropertyList
public void endOfNode() throws FOPException
FOEventHandler
that the end of this FO
has been reached.
The default implementation simply calls FONode.finalizeNode()
, without
sending any event to the FOEventHandler
.
Note: the recommended way to override this method in subclasses is
super.endOfNode(); // invoke finalizeNode()
getFOEventHandler().endXXX(); // send endOfNode() notification
endOfNode
in class FONode
FOPException
- if there's a problem during processingpublic void finalizeNode()
FOEventHandler
.
The method is called by the default FONode.endOfNode()
implementation.finalizeNode
in class FONode
public boolean willCreateArea()
public CharIterator charIterator()
FONode
CharIterator
over all characters in this nodecharIterator
in class FONode
protected void createBlockPointers(Block ancestorBlock)
ancestorBlock
- the ancestor fo:blockpublic CommonFont getCommonFont()
public CommonHyphenation getCommonHyphenation()
public Color getColor()
public KeepProperty getKeepTogether()
public Property getLetterSpacing()
public SpaceProperty getLineHeight()
public int getWhitespaceTreatment()
public Property getWordSpacing()
public int getWrapOption()
public CommonTextDecoration getTextDecoration()
public Length getBaseLineShift()
public String getCountry()
public CharacterIterator getIterator()
TextFragment
getIterator
in interface TextFragment
public int getBeginIndex()
TextFragment
getBeginIndex
in interface TextFragment
public int getEndIndex()
TextFragment
getEndIndex
in interface TextFragment
public String getLanguage()
TextFragment
getLanguage
in interface TextFragment
public String getScript()
TextFragment
getScript
in interface TextFragment
public int getBidiLevel()
TextFragment
getBidiLevel
in interface TextFragment
public String toString()
toString
in interface CharSequence
toString
in class Object
public String getLocalName()
getLocalName
in class FONode
public String getNormalNamespacePrefix()
getNormalNamespacePrefix
in class FONode
protected String gatherContextInfo()
gatherContextInfo
in class FONode
public char charAt(int position)
charAt
in interface CharSequence
charAt
in interface TextFragment
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
subSequence
in interface TextFragment
public int length()
length
in interface CharSequence
public void resetBuffer()
java.nio.CharBuffer
public boolean isDelimitedTextRangeBoundary(int boundary)
FONode
isDelimitedTextRangeBoundary
in class FONode
boundary
- one of {EN_BEFORE, EN_AFTER, or EN_BOTH} enumeration constantspublic void setStructureTreeElement(StructureTreeElement structureTreeElement)
FONode
setStructureTreeElement
in class FONode
structureTreeElement
- set.public StructureTreeElement getStructureTreeElement()
FONode
getStructureTreeElement
in class FONode
public void setBidiLevel(int level, int start, int end)
level
- the resolved levelstart
- the starting index of intervalend
- the ending index of intervalpublic int[] getBidiLevels()
public int[] getBidiLevels(int start, int end)
start
- the starting index of intervalend
- the ending index of intervalpublic int bidiLevelAt(int position) throws IndexOutOfBoundsException
position
- an offset position into FO's charactersIndexOutOfBoundsException
- if position is not non-negative integer
or is greater than or equal to lengthprotected Stack<DelimitedTextRange> collectDelimitedTextRanges(Stack<DelimitedTextRange> ranges, DelimitedTextRange currentRange)
FONode
collectDelimitedTextRanges
in class FONode
ranges
- a stack of delimited text rangescurrentRange
- the current range or null (if none)Copyright © 2025 Apache Software Foundation. All rights reserved.