public class Placeholder
extends java.lang.Object
startUmlDiagram.{packageName}.{diagramName}.endUml startUmlAttribute.{className}.{attributeName}.endUml startUmlFile..endUml startUmlPresenceConditions.{packageName}.endUml (IEC 61850-7-3, for presence conditions table) startUmlFCs.{packageName}.endUml (IEC 61850-7-3 and IEC 61850-7-2, for FC table) startUmlTrgOps.{packageName}.endUml (IEC 61850-7-2, for TrgOp table) startUmlAbbreviations.{packageName}.endUml (IEC 61850-7-4, for DO abbreviations table) startUmlSclEnums.{packageName}.endUml (IEC 61850-7-4, 7-3, for enums as XML) startUmlPackage.{packageName}.endUml startUmlDataIndex.{packageName}.endUml (for IEC 61850-7-4,3, for data semantics tables) startUmlLNMapPackage.{packageName}.endUml (for IEC 61850-7-4, for function/LN map tables)The tokens enlosed in curly braces are the names of UML elements designating what needs to be inserted in place of the whole above string.
This format avoids us the need to define bookmarks in the input document (tedious and error-prone) and makes it simple to sequentially search the input document and insert the text and diagrams as they come.
Usage
Instance of kind Placeholder.Kind.UNSUPPORTED
always returns non-null error that you may want to use
to replace the placeholder to indicate failure. Instances of kind Placeholder.Kind.FILE
are the
simplest as they need not parse anything, so no errors and no saved tokens.
The instances of other kinds do need to parse the placeholder and will have tokens set as follows:
Placeholder.Kind.PRES_CONDITIONS
, Placeholder.Kind.ABBREVIATIONS
, Placeholder.Kind.SCL_ENUMS
, Placeholder.Kind.PACKAGE
, Placeholder.Kind.LNMAP_PACKAGE
, Placeholder.Kind.DATA_INDEX
, Placeholder.Kind.FCS
,
Placeholder.Kind.TRGOPS
) or
Placeholder.Kind.ATTRIBUTE
, Placeholder.Kind.DIAGRAM
).
Important: To have correct headings and paragraph formats, ensure you use the following placeholders in a heading paragraph:
Modifier and Type | Class and Description |
---|---|
static class |
Placeholder.Kind |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MS_PATTERN |
static java.lang.String |
PH_LETTERS |
Constructor and Description |
---|
Placeholder(java.lang.String text) |
Placeholder(java.lang.String text,
int figureCountBefore,
int tableCountBefore) |
Modifier and Type | Method and Description |
---|---|
int |
addFigure()
Returns the index to be used to reference the added figure caption.
|
int |
addTable()
Returns the index to be used to reference the added table caption.
|
java.lang.String |
getErrorText()
Returns null if there are no parsing errors, the error message otherwise.
|
int |
getFigureCount()
Returns the last figure caption index by the current end of the range.
|
int |
getFigureCountBefore()
Returns number of figures (i.e., found captions starting with "Figure") before this
placeholder.
|
java.lang.String |
getFirstToken() |
Placeholder.Kind |
getKind() |
java.lang.String |
getReplacedText()
Returns the replacement text, as set by the user with
setReplacedText(String) . |
java.lang.String |
getSecondToken() |
static java.util.List<java.lang.String> |
getSupportedFormats() |
int |
getTableCount()
Returns the last table caption index by the current end of the range.
|
int |
getTableCountBefore()
Returns number of tables (i.e., found captions starting with "Table") before this
placeholder.
|
java.lang.String |
getText()
Returns the placeholder text.
|
void |
incrementFigureBefore()
Increments the number of figures before this placeholder.
|
void |
incrementTableBefore()
Increments the number of tables before this placeholder.
|
void |
setReplacedText(java.lang.String replacedText)
Use this setter to track progress and status of placeholder replacement.
|
java.lang.String |
toString() |
void |
updateModelErrorText()
Use this setter when finder could not find valid tokens in the model (e.g., format of the
placeholder is ok, but the names do not match elements in the model).
|
public static final java.lang.String PH_LETTERS
public static final java.lang.String MS_PATTERN
public Placeholder(java.lang.String text)
public Placeholder(java.lang.String text, int figureCountBefore, int tableCountBefore)
public static java.util.List<java.lang.String> getSupportedFormats()
public java.lang.String getText()
public Placeholder.Kind getKind()
public java.lang.String getFirstToken()
public java.lang.String getSecondToken()
public java.lang.String getErrorText()
public void updateModelErrorText()
public void setReplacedText(java.lang.String replacedText)
public int getFigureCountBefore()
public int getTableCountBefore()
public java.lang.String getReplacedText()
setReplacedText(String)
.
Initial value is null and is never changed by this class itself.public void incrementFigureBefore()
public void incrementTableBefore()
public int addFigure()
public int getFigureCount()
public int addTable()
public int getTableCount()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2009-2015 Tatjana (Tanja) Kostic