public abstract class AbstractObjectDoc extends java.lang.Object implements ObjectDoc
Modifier | Constructor and Description |
---|---|
protected |
AbstractObjectDoc(DocgenConfig docgenCfg,
UmlObject o,
java.lang.String what,
TextDescription description,
TextDescription htmlDescription,
boolean ignoreDesc,
java.lang.String headingText,
java.lang.String bookmarkID,
BookmarkRegistry bmRegistry)
"Centralised" constructor, allowing for instantiation both with and without a UML object, and
with and without descriptions, as follows:
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
copyCell(RawData src,
java.lang.String key)
Copies value for
key existing in src , into this provider; no-op if
src does not contain the key . |
java.lang.String |
copyNonEmptyCell(RawData src,
java.lang.String key)
Copies non-empty value for
key existing in src , into this provider;
no-op if src does not contain the key , or if it contains the
key but the value for that key is empty. |
protected static java.lang.String |
createDocId(UmlObject obj,
java.lang.String ending) |
protected static java.lang.String |
deduceBookmark(BookmarkRegistry bmRegistry,
UmlObject obj) |
protected void |
filterClasses(UmlPackage p,
java.util.Collection<UmlClass> retainedNatives) |
BookmarkRegistry |
getBmRegistry()
Returns the populated bookmark registry.
|
java.lang.String |
getBookmarkID()
Returns an ID guaranteed to be unique for the model; usable for referencing such as e.g.,
hyperlinks (as anchor id in HTML or bookmark in Word) or references (as id in XML).
|
java.lang.String |
getCell(java.lang.String key)
Returns value for key, null if key does not exist or if
key is null. |
java.util.Map<java.lang.String,java.lang.String> |
getCells()
Returns potentially empty map of key/value pairs.
|
TextDescription |
getDescription()
This default implementation returns what has been explicitly initialised in the call to the
constructor.
|
DocgenConfig |
getDocgenCfg()
Returns document generation specific configuration.
|
java.lang.String |
getHeadingText()
Returns text to be used for chapter heading for this model element; may be empty.
|
boolean |
hasKey(java.lang.String key)
If true,
key is present. |
protected static void |
log(org.apache.log4j.Logger logger,
java.lang.String message) |
protected java.lang.String |
prepareForHyperlink(UmlObject targetObj)
If hyperlink option is enabled, creates a hyperlink placeholder for
targetObj
whose text will be written instead of name, to be replaced by a hyperlink in additional pass. |
protected java.lang.String |
prepareForHyperlinkAdjustedName(UmlObject targetObj,
java.lang.String nameToDisplay)
Same as
prepareForHyperlink(UmlObject) except that it creates the hyperlink
placeholder with |
java.lang.String |
putCell(java.lang.String key,
java.lang.String value)
Adds the
value for key . |
java.lang.String |
putCellNonEmpty(java.lang.String key,
java.lang.String value)
Adds the
value for key if value is not empty. |
protected boolean |
toSkip(UmlObject o)
Returns whether to skip object
o , according to configuration. |
java.lang.String |
toString() |
protected boolean |
useHtml(TextDescription htmlDescription)
Returns true if printing HTML is enabled and
htmlDescription is not empty. |
protected AbstractObjectDoc(DocgenConfig docgenCfg, UmlObject o, java.lang.String what, TextDescription description, TextDescription htmlDescription, boolean ignoreDesc, java.lang.String headingText, java.lang.String bookmarkID, BookmarkRegistry bmRegistry)
If object
is non-null (and ignoreDesc=false
), its text and HTML
description fields will be used, and raw data will be added for object name, alias,
description (as HTML) and heading text; if ignoreDesc=true
, no description raw
data will be added.
If object
is null, no raw data will be created at all; if
ignoreDesc=false
, the explicit description
and
htmlDescription
will be used instead.
Instance description (returned by getDescription()
) retained will be in HTML format
only if configuration enables HTML printing and htmlDescription
is not empty.
Otherwise, the text description is retained. If ignoreDesc=true
, returned values
are just empty text or HTML description.
docgenCfg
- non-null document generation specific configuration.o
- (possibly null) UML object.what
- (possibly null) describes kind of properties of object
; used to
ensure unique aliases, descriptions, etc. when an object may have multiple groups
of properties (in particular, class with its attributes, associations and
operations).description
- (possibly null) text format description.htmlDescription
- (possibly null) HTML format description.ignoreDesc
- whether to ignore description altogether.headingText
- (possibly null) heading text, to be used as chapter title.bookmarkID
- (possibly null) bookmark ID.bmRegistry
- non-null (but potentially empty) bookmark registry.protected static void log(org.apache.log4j.Logger logger, java.lang.String message)
protected static final java.lang.String createDocId(UmlObject obj, java.lang.String ending)
protected static java.lang.String deduceBookmark(BookmarkRegistry bmRegistry, UmlObject obj)
protected final java.lang.String prepareForHyperlink(UmlObject targetObj)
targetObj
whose text will be written instead of name, to be replaced by a hyperlink in additional pass.
Otherwise, returns the name of targetObj
.protected final java.lang.String prepareForHyperlinkAdjustedName(UmlObject targetObj, java.lang.String nameToDisplay)
prepareForHyperlink(UmlObject)
except that it creates the hyperlink
placeholder withprotected final boolean useHtml(TextDescription htmlDescription)
htmlDescription
is not empty.protected final boolean toSkip(UmlObject o)
o
, according to configuration.protected final void filterClasses(UmlPackage p, java.util.Collection<UmlClass> retainedNatives)
public final DocgenConfig getDocgenCfg()
ObjectDoc
getDocgenCfg
in interface ObjectDoc
public final java.lang.String getHeadingText()
ObjectDoc
getHeadingText
in interface ObjectDoc
public TextDescription getDescription()
getDescription
in interface ObjectDoc
public BookmarkRegistry getBmRegistry()
ObjectDoc
getBmRegistry
in interface ObjectDoc
public final java.lang.String getBookmarkID()
ObjectDoc
getBookmarkID
in interface ObjectDoc
public java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String putCell(java.lang.String key, java.lang.String value)
RawData
value
for key
.public final java.lang.String copyCell(RawData src, java.lang.String key)
RawData
key
existing in src
, into this provider; no-op if
src
does not contain the key
.public final java.lang.String copyNonEmptyCell(RawData src, java.lang.String key)
RawData
key
existing in src
, into this provider;
no-op if src
does not contain the key
, or if it contains the
key
but the value for that key is empty.copyNonEmptyCell
in interface RawData
public final java.lang.String putCellNonEmpty(java.lang.String key, java.lang.String value)
RawData
value
for key
if value
is not empty.putCellNonEmpty
in interface RawData
key
- non-null, non-empty key.value
- non-null, potentially empty value for the key.public final boolean hasKey(java.lang.String key)
RawData
key
is present.public final java.util.Map<java.lang.String,java.lang.String> getCells()
RawData
Copyright 2009-2016 Tatjana (Tanja) Kostic