se.biltmore.tools.odttoapt.maven.plugin.models
Class APTSpaces

java.lang.Object
  extended by se.biltmore.tools.odttoapt.maven.plugin.models.APT
      extended by se.biltmore.tools.odttoapt.maven.plugin.models.APTText
          extended by se.biltmore.tools.odttoapt.maven.plugin.models.APTSpaces
All Implemented Interfaces:
IgnoreChildren, NonParentSpaceReceiver

public class APTSpaces
extends APTText

This represents a set of spaces in a paragraph. This has nothing to do with an APT formatting.

Since we are converting from an XML format and since parsers like the SAX parser trims away white space the ODF people decided to represent spaces at the beginning of a line with a <text:s text:c="5"/> element where the attribute specifies the number of spaces.

Such an element maps directly to this class. It is an APTText subclass an can be added to an APTParagraph as any other APTText. It will return the specified amount of spaces as its value. It will also prefix the spaces with a new line ('\n') since this type of spaces only exist at the beginning of a line.


Field Summary
private  String spaces
          The spaces this object represents.
 
Constructor Summary
APTSpaces(int count)
          Creates a new APTSpaces instance.
 
Method Summary
 String getUnformattedValue()
          Returns the unformatted value.
 String getValue()
          Returns the value.
 
Methods inherited from class se.biltmore.tools.odttoapt.maven.plugin.models.APTText
addSpace, getAPTTextValue
 
Methods inherited from class se.biltmore.tools.odttoapt.maven.plugin.models.APT
done, formatText, getParent, hasValue, isAllowFormat, isLink, setAllowFormat, setLink, setParent, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

spaces

private String spaces
The spaces this object represents.

Constructor Detail

APTSpaces

public APTSpaces(int count)
Creates a new APTSpaces instance.

Parameters:
count - The number of spaces this instance represents.
Method Detail

getUnformattedValue

public String getUnformattedValue()
Returns the unformatted value.

Overrides:
getUnformattedValue in class APTText

getValue

public String getValue()
Returns the value.

Overrides:
getValue in class APTText


Copyright © 2009-2010 Biltmore Group AB. All Rights Reserved.