Package de.unirostock.sems.bives.markup
Class MarkupDocument
- java.lang.Object
-
- de.unirostock.sems.bives.markup.MarkupDocument
-
public class MarkupDocument extends Object
The Class MarkupDocument representing a generic document that can be encoded in different formats using Typesetters.- Author:
- Martin Scharm
- See Also:
Typesetting
-
-
Constructor Summary
Constructors Constructor Description MarkupDocument(String headline)
Instantiates a new markup document.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(String header)
Adds a header.void
addSection(MarkupSection section)
Adds a section.static String
attribute(String s)
Highlights an attribute.static String
delete(String s)
Highlights a delete.List<String>
getHeader()
Gets the header.String
getHeadline()
Gets the headline.List<MarkupSection>
getSections()
Gets the sections.static String
highlight(String s)
Highlights a string, e.g.static String
insert(String s)
Highlights an insert.static String
math(String s)
Container for unchanged math.static String
math(String s, boolean original)
Container for modified math.static String
multiply()
Produces a multiply symbol.static String
replaceAllMaths(String s, String pre, String post)
Replaces all math stuff, doesn't matter if inserted or deleted.static String
replaceAttributes(String s, String pre, String post)
Replaces attributes.static String
replaceDeletes(String s, String pre, String post)
Replaces deletes.static String
replaceHighlights(String s, String pre, String post)
Replaces highlights.static String
replaceInserts(String s, String pre, String post)
Replaces inserts.static String
replaceModifiedMaths(String s, String pre, String post)
Replaces modified math.static String
replaceMultiplication(String s, String replacement)
Replaces multiplication.static String
replaceOriginalMaths(String s, String pre, String post)
Replaces original math.static String
replaceRightArrow(String s, String replacement)
Replaces right arrow.static String
replaceSupplementals(String s, String pre, String post)
Replaces supplementary information.static String
replaceUnchangedMaths(String s, String pre, String post)
Replaces math that hasn't changed.static String
rightArrow()
Produces a right arrow.static String
supplemental(String s)
Highlights supplementary information.
-
-
-
Constructor Detail
-
MarkupDocument
public MarkupDocument(String headline)
Instantiates a new markup document.- Parameters:
headline
- the headline
-
-
Method Detail
-
addHeader
public void addHeader(String header)
Adds a header.- Parameters:
header
- the header to add
-
addSection
public void addSection(MarkupSection section)
Adds a section.- Parameters:
section
- the section
-
highlight
public static final String highlight(String s)
Highlights a string, e.g. a special word or phrase.- Parameters:
s
- the string to highlight- Returns:
- the highlighted string
-
insert
public static final String insert(String s)
Highlights an insert.- Parameters:
s
- the string to highlight- Returns:
- the highlighted string
-
delete
public static final String delete(String s)
Highlights a delete.- Parameters:
s
- the string to highlight- Returns:
- the highlighted string
-
supplemental
public static final String supplemental(String s)
Highlights supplementary information.- Parameters:
s
- the string to highlight- Returns:
- the highlighted string
-
attribute
public static final String attribute(String s)
Highlights an attribute.- Parameters:
s
- the string to highlight- Returns:
- the highlighted string
-
math
public static final String math(String s)
Container for unchanged math.- Parameters:
s
- the string representing math- Returns:
- the container containing the math
-
math
public static final String math(String s, boolean original)
Container for modified math.- Parameters:
s
- the string representing mathoriginal
- the is that the original document?- Returns:
- the container containing the math
-
rightArrow
public static final String rightArrow()
Produces a right arrow. (e.g. for chemical reactions)- Returns:
- the right arrow
-
multiply
public static final String multiply()
Produces a multiply symbol. (e.g. * )- Returns:
- the multiply symbol
-
getSections
public List<MarkupSection> getSections()
Gets the sections.- Returns:
- the sections
-
getHeadline
public String getHeadline()
Gets the headline.- Returns:
- the headline
-
replaceHighlights
public static final String replaceHighlights(String s, String pre, String post)
Replaces highlights.- Parameters:
s
- the string containing highlightspre
- the opening, e.g. <em>post
- the closing, e.g. </em>- Returns:
- the final string
-
replaceInserts
public static final String replaceInserts(String s, String pre, String post)
Replaces inserts.- Parameters:
s
- the string containing insertspre
- the opening, e.g. <ins>post
- the closing, e.g. </ins>- Returns:
- the final string
-
replaceDeletes
public static final String replaceDeletes(String s, String pre, String post)
Replaces deletes.- Parameters:
s
- the string containing deletespre
- the opening, e.g. <del>post
- the closing, e.g. </del>- Returns:
- the final string
-
replaceSupplementals
public static final String replaceSupplementals(String s, String pre, String post)
Replaces supplementary information.- Parameters:
s
- the string containing supp infopre
- the opening, e.g. <supp>post
- the closing, e.g. </supp>- Returns:
- the final string
-
replaceAttributes
public static final String replaceAttributes(String s, String pre, String post)
Replaces attributes.- Parameters:
s
- the string containing attributespre
- the opening, e.g. <attr>post
- the closing, e.g. </attr>- Returns:
- the final string
-
replaceModifiedMaths
public static final String replaceModifiedMaths(String s, String pre, String post)
Replaces modified math.- Parameters:
s
- the string containing modified mathpre
- the opening, e.g. <inserted math>post
- the closing, e.g. </inserted math>- Returns:
- the final string
-
replaceOriginalMaths
public static final String replaceOriginalMaths(String s, String pre, String post)
Replaces original math.- Parameters:
s
- the string containing original mathpre
- the opening, e.g. <deleted math>post
- the closing, e.g. </deleted math>- Returns:
- the final string
-
replaceAllMaths
public static final String replaceAllMaths(String s, String pre, String post)
Replaces all math stuff, doesn't matter if inserted or deleted.- Parameters:
s
- the string containing inserted or deleted mathpre
- the opening, e.g. <my math tag>post
- the closing, e.g. </my math tag>- Returns:
- the final string
-
replaceUnchangedMaths
public static final String replaceUnchangedMaths(String s, String pre, String post)
Replaces math that hasn't changed.- Parameters:
s
- the string containing mathpre
- the opening, e.g. <unchanged math>post
- the closing, e.g. </unchanged math>- Returns:
- the final string
-
replaceMultiplication
public static final String replaceMultiplication(String s, String replacement)
Replaces multiplication.- Parameters:
s
- the string containing multiplicationsreplacement
- the replacement, e.g. "*"- Returns:
- the final string
-
-