|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDocument
ch.elexis.text.model.SimpleStructuredDocument
public class SimpleStructuredDocument
SimpleStructuredText is an XML format to define structured texts. To simplify interpretation for different readers with different capabilities, text and structure are strictly separated. For backward compatibility, SSD will read the earlier Samdas format transparently
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()
|
|
SimpleStructuredDocument(boolean bUseLegacyMode)
Constructor for full backward compatibility. |
Method Summary | |
---|---|
void |
addRange(SSDRange range)
Ad a new Range. |
int |
checkPosition(int pos)
check where near the given position an insert is possible |
SSDRange |
findRange(int position)
Find a range that lives at a given position |
java.lang.String[] |
getLegalLineDelimiters()
|
java.lang.String |
getPlaintext()
Return the contents as plaintext (i.e. without any markups or xrefs) |
java.util.List<SSDRange> |
getRanges()
Return all ranges |
java.lang.String |
getSubstring(GenericRange r)
Return a portion of Text without formatting |
void |
load(java.lang.Object param)
load the contents through a predefined IPersistenceProvider |
void |
loadText(java.lang.String input,
boolean bAppend)
Parse an input String. |
boolean |
removeRange(int pos)
|
void |
replace(int pos,
int len,
java.lang.String replacement)
Insert or replace or remove some text |
boolean |
save(boolean bCreateHeader,
java.lang.Object param)
save the contents through a predefined IPersistenceProvider. |
void |
setPersistenceProvider(IPersistenceProvider ipp)
Set a custom IPersistenceProvider. |
java.lang.String |
toXML(boolean bCreateHeader)
Convert the contents to a SimpleStructuredDocument XML file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static final java.lang.String GENERATOR
public static final java.lang.String ELEM_ROOT
public static final java.lang.String ELEM_TEXT
public static final java.lang.String ELEM_RECORD
public static final Namespace ns
public static final Namespace nsxsi
public static final Namespace nsschema
Constructor Detail |
---|
public SimpleStructuredDocument()
public SimpleStructuredDocument(boolean bUseLegacyMode)
bUseLegacyMode
- if true, will write Samdas. If false: Will read SSD and Samdas, but always write
SSD.Method Detail |
---|
public void setPersistenceProvider(IPersistenceProvider ipp)
ipp
- The IPersistenceProviderpublic void load(java.lang.Object param) throws PersistenceException, ElexisException
param
- Parameter for the IPersistenceProvider (implementation dependent; can be null)
PersistenceException
- if no IPersistencProvider is present or the IPersistenceProvider fails
ElexisException
- if the contents from the IPersistenceProvider could not be parsed correctlypublic boolean save(boolean bCreateHeader, java.lang.Object param) throws PersistenceException
bCreateHeader
- create heaxer information in the XMLparam
- parameter for the IPersistenceProvider (implementation dependent, can be null)
PersistenceException
- if the IPersistenceProvider is not present or failspublic void loadText(java.lang.String input, boolean bAppend) throws ElexisException
input
- bAppend
- if true, new input will appended. If false, current contents will be erased first.
ElexisException
- if an XML input could not be parsedpublic java.lang.String getPlaintext()
public java.lang.String getSubstring(GenericRange r)
r
- a GenericRange describing the text range to retrieve. If the GenericRange extends
beyond the Text end, it will be adjusted. If the Range start is less than zero, an
empty String is returned.
public java.lang.String toXML(boolean bCreateHeader)
bCreateHeader
- if false, a representation without header information is created
public void replace(int pos, int len, java.lang.String replacement)
replacement
- the text to insert. if ins is null, nothing will be insertedpos
- start position for insert. If pos is larger than text length, it will be appended
at the end. if pos is negative, nothing will be inserted.len
- length of the text to remove before inserting. if len is 0, nothing will be
removed.public void addRange(SSDRange range)
range
- public boolean removeRange(int pos)
public java.util.List<SSDRange> getRanges()
public SSDRange findRange(int position)
position
- an offset in the raw text
public int checkPosition(int pos)
public java.lang.String[] getLegalLineDelimiters()
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |