public abstract class AbstractObjectDoc extends java.lang.Object implements ObjectDoc
Modifier and Type | Field and Description |
---|---|
private TextDescription |
_description |
private DocgenConfig |
_docgenCfg |
private java.lang.String |
_headingText |
private RawData |
_rawData |
private static org.apache.log4j.Level |
CTOR_LOG_LEVEL |
Modifier | Constructor and Description |
---|---|
protected |
AbstractObjectDoc(DocgenConfig docgenCfg,
UmlObject o,
java.lang.String what,
TextDescription description,
TextDescription htmlDescription,
boolean ignoreDesc,
java.lang.String headingText)
"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 java.lang.String |
createDocId(UmlObject o,
java.lang.String ending) |
protected void |
filterClasses(UmlPackage p,
java.util.Collection<UmlClass> retainedNatives) |
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) |
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. |
private static final org.apache.log4j.Level CTOR_LOG_LEVEL
private final DocgenConfig _docgenCfg
private final java.lang.String _headingText
private final TextDescription _description
private final RawData _rawData
protected AbstractObjectDoc(DocgenConfig docgenCfg, UmlObject o, java.lang.String what, TextDescription description, TextDescription htmlDescription, boolean ignoreDesc, java.lang.String headingText)
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.protected static void log(org.apache.log4j.Logger logger, java.lang.String message)
protected final java.lang.String createDocId(UmlObject o, java.lang.String ending)
protected 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 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-2015 Tatjana (Tanja) Kostic