Elexis API documentation as of September 4 2011

ch.elexis.text.model
Class SimpleStructuredDocument

java.lang.Object
  extended by ch.elexis.text.model.SimpleStructuredDocument

public class SimpleStructuredDocument
extends java.lang.Object

SimpleStructuredText is an XML format to define structured texts. To simplify interpretation for different readers with different capabilities, text and structure are strictly separated.

Author:
gerry

Field Summary
static java.lang.String ELEM_RECORD
           
static java.lang.String ELEM_ROOT
           
static java.lang.String ELEM_TEXT
           
static java.lang.String GENERATOR
           
static Namespace ns
           
static Namespace nsschema
           
static Namespace nsxsi
           
static java.lang.String VERSION
           
 
Constructor Summary
SimpleStructuredDocument()
           
 
Method Summary
 void addRange(SSDRange r)
           
 java.lang.String getPlaintext()
           
 java.util.List<SSDRange> getRanges()
           
 void insertText(java.lang.String ins, int pos)
          Insert some text
 void loadText(java.lang.String input, boolean bAppend)
          Parse an input String.
 java.lang.String remove(int pos, int len)
          remove some text
 java.lang.String toXML(boolean bCreateHeader)
          Convert the contents to a SimpleStructuredDocument file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

GENERATOR

public static final java.lang.String GENERATOR
See Also:
Constant Field Values

ELEM_ROOT

public static final java.lang.String ELEM_ROOT
See Also:
Constant Field Values

ELEM_TEXT

public static final java.lang.String ELEM_TEXT
See Also:
Constant Field Values

ELEM_RECORD

public static final java.lang.String ELEM_RECORD
See Also:
Constant Field Values

ns

public static final Namespace ns

nsxsi

public static final Namespace nsxsi

nsschema

public static final Namespace nsschema
Constructor Detail

SimpleStructuredDocument

public SimpleStructuredDocument()
Method Detail

loadText

public void loadText(java.lang.String input,
                     boolean bAppend)
              throws ElexisException
Parse an input String. Can parse plain text, Samdas or SimpleStructuredDocument

Parameters:
input -
bAppend - if true, new input will appended. If false, current contents will be erased first.
Throws:
ElexisException - if an XML input could not be parsed

getPlaintext

public java.lang.String getPlaintext()

toXML

public java.lang.String toXML(boolean bCreateHeader)
Convert the contents to a SimpleStructuredDocument file.

Parameters:
bCreateHeader - if false, a representation without header information is created
Returns:

insertText

public void insertText(java.lang.String ins,
                       int pos)
Insert some text

Parameters:
ins - the text to insert
pos - start position for insert. If pos is larger than text length, it will be appended at the end. ig pos is negative, nothing will be inserted. If ins is null, nothing will be inserted.

remove

public java.lang.String remove(int pos,
                               int len)
remove some text

Parameters:
pos - position from which to remove
len - length of text to remove
Returns:
the removed String

addRange

public void addRange(SSDRange r)

getRanges

public java.util.List<SSDRange> getRanges()

Elexis API documentation as of September 4 2011

Copyright 2005-2010 by Gerry Weirich, Elexis