public class FOText extends FONode implements CharSequence, TextFragment
FONode.FONodeIterator, FONode.GatherContextInfoFunctionFO_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, warningTextequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic 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 FONodedata - 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 FONodeparent - 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 FONodepList - the PropertyListFOPException - if there was an error when
processing the PropertyListpublic 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 FONodeFOPException - if there's a problem during processingpublic void finalizeNode()
FOEventHandler.
The method is called by the default FONode.endOfNode()
implementation.finalizeNode in class FONodepublic boolean willCreateArea()
public CharIterator charIterator()
FONodeCharIterator over all characters in this nodecharIterator in class FONodeprotected 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()
TextFragmentgetIterator in interface TextFragmentpublic int getBeginIndex()
TextFragmentgetBeginIndex in interface TextFragmentpublic int getEndIndex()
TextFragmentgetEndIndex in interface TextFragmentpublic String getLanguage()
TextFragmentgetLanguage in interface TextFragmentpublic String getScript()
TextFragmentgetScript in interface TextFragmentpublic int getBidiLevel()
TextFragmentgetBidiLevel in interface TextFragmentpublic String toString()
toString in interface CharSequencetoString in class Objectpublic String getLocalName()
getLocalName in class FONodepublic String getNormalNamespacePrefix()
getNormalNamespacePrefix in class FONodeprotected String gatherContextInfo()
gatherContextInfo in class FONodepublic char charAt(int position)
charAt in interface CharSequencecharAt in interface TextFragmentpublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencesubSequence in interface TextFragmentpublic int length()
length in interface CharSequencepublic void resetBuffer()
java.nio.CharBufferpublic boolean isDelimitedTextRangeBoundary(int boundary)
FONodeisDelimitedTextRangeBoundary in class FONodeboundary - one of {EN_BEFORE, EN_AFTER, or EN_BOTH} enumeration constantspublic void setStructureTreeElement(StructureTreeElement structureTreeElement)
FONodesetStructureTreeElement in class FONodestructureTreeElement - set.public StructureTreeElement getStructureTreeElement()
FONodegetStructureTreeElement in class FONodepublic 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)
FONodecollectDelimitedTextRanges in class FONoderanges - a stack of delimited text rangescurrentRange - the current range or null (if none)Copyright © 2023 Apache Software Foundation. All rights reserved.