Package ro.sync.ecss.extensions.api
Class ProfilingConditionalTextProvider
java.lang.Object
ro.sync.ecss.extensions.api.ProfilingConditionalTextProvider
Profiling/Conditional Text is a way to mark elements meant to appear in some renditions
of the document, but not in others. It differs from one variant of the document to another,
while unconditional elements appear in all document versions.
This class provides custom support for Profiling/Conditional Text.
This class provides custom support for Profiling/Conditional Text.
- Since:
- 13.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetXMLFragmentForContentProfiling
(int startOffset, int endOffset, AuthorAccess authorAccess) This method is used when the document content between startOffset and endOffset must be profiled.boolean
This method is used to decide if the profiling attributes will be set directly on the element.
-
Constructor Details
-
ProfilingConditionalTextProvider
public ProfilingConditionalTextProvider()
-
-
Method Details
-
getXMLFragmentForContentProfiling
public String getXMLFragmentForContentProfiling(int startOffset, int endOffset, AuthorAccess authorAccess) This method is used when the document content between startOffset and endOffset must be profiled. The returned XML fragment is used to wrap the content included in the given offset interval.
The first leaf of the XML fragment will be the destination of the text to surround. The profiling attributes will be set on the first element of the XML fragment.- Parameters:
startOffset
- The start offset of the document content that must be profiled.endOffset
- The end offset of the document content that must be profiled.authorAccess
- Access class to the author functions.- Returns:
- The XML fragment to wrap the profiled document content with.
If this fragment is
null
the interval will not be profiled. - Since:
- 13.2
-
shouldAddProfilingDirectlyOnElement
This method is used to decide if the profiling attributes will be set directly on the element. If this method returnsfalse
, the selected contetn will be wrapped in an XML fragment given bygetXMLFragmentForContentProfiling(int, int, AuthorAccess)
.- Parameters:
element
- The element to be analyzed.- Returns:
true
to set the profiling attributes directly on the element,false
to set the profiling on an XML fragment that will wrap the content of the element.- Since:
- 22
-