org.ow2.weblab.core.extended.util
Class TextUtil

java.lang.Object
  extended by org.ow2.weblab.core.extended.util.TextUtil

public class TextUtil
extends java.lang.Object

A very simple util class that enable to handle LinearSegment and Text.

Author:
Cassidian WebLab Team
Date:
2008-01-23

Method Summary
static java.lang.String getSegmentText(Text text, LinearSegment segment)
          Extract the String covered in text by segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSegmentText

public static java.lang.String getSegmentText(Text text,
                                              LinearSegment segment)
                                       throws WebLabCheckedException
Extract the String covered in text by segment. This cannot work in the case of a Text that do not have content (and uses a TextContent object instead).

Parameters:
text - The Text section in which we look for content.
segment - The Segment defining the position of the text to retrieve. segment must be contained by the List>Segment< of text.
Returns:
the String content of the Text at the position defined by the Segment
Throws:
WebLabCheckedException


Copyright © 2004-2010. All Rights Reserved.