public abstract class AbstractPropertiesDoc extends AbstractObjectDoc implements PropertiesDoc
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractPropertiesDoc.CellText |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_captionText |
private TableSpec |
_colSpec |
private java.util.List<EntryDoc> |
_entryDocs |
private int |
_headingEntriesCount |
private java.lang.String |
_introText |
private java.lang.String |
_tableName |
INHERITED_FROM
Modifier | Constructor and Description |
---|---|
protected |
AbstractPropertiesDoc(DocgenConfig docgenCfg,
UmlObject object,
java.lang.String what,
java.lang.String introText,
java.lang.String captionText,
TableSpec colSpec,
java.lang.String tableName)
Creates an instance with a
EntryDoc.Kind.tableName entry (if
tableName is not null) and
EntryDoc.Kind.columnLabels entry (from
colSpec ) in the list of entries; use when you want to add
EntryDoc.Kind.data (and optionally,
EntryDoc.Kind.groupSubhead ) entries one by
one, after some complex processing. |
protected |
AbstractPropertiesDoc(DocgenConfig docgenCfg,
UmlObject object,
java.lang.String what,
TextDescription description,
TextDescription htmlDescription,
boolean ignoreDesc,
java.lang.String headingText,
java.lang.String introText,
java.lang.String captionText,
TableSpec colSpec,
java.lang.String tableName)
Same as
AbstractPropertiesDoc(DocgenConfig, UmlObject, String, String, String, TableSpec, String)
, but with explicit text and html documentation parameters; this is to support chained
construction for the needs of testing where we don't have UML objects but want to print
descriptions. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addEntry(EntryDoc entryDoc)
Returns whether
entryDoc has been successfully added. |
protected AbstractPropertiesDoc.CellText |
deduceCellText(java.lang.String prefix,
TextDescription raw,
TextDescription html,
UmlObject o) |
protected AbstractPropertiesDoc.CellText |
deduceCellText(java.lang.String prefix,
UmlObject o)
Selects the description to retain, according to configuration.
|
private void |
ensureValid(EntryDoc.Kind kind) |
protected void |
filterAssociationEnds(UmlClass c,
java.util.Collection<UmlAssociationEnd.AssociationEndPair> retainedNatives,
java.util.Collection<UmlAssociationEnd.AssociationEndPair> retainedInheriteds) |
protected void |
filterAttributes(UmlClass c,
java.util.Collection<UmlAttribute> retainedNatives,
java.util.Collection<UmlAttribute> retainedInheriteds) |
protected void |
filterOperations(UmlClass c,
java.util.Collection<UmlOperation> retainedNatives,
java.util.Collection<UmlOperation> retainedInheriteds) |
java.lang.String |
getCaptionText()
Returns text that describes the caption (e.g., "Table 23 - [captionText]").
|
java.lang.String[][] |
getCellValues()
Returns the full table values, including heading rows (table name and column names), any
potential sub-head and the actual rows with values.
|
int |
getColumnCount()
Returns number of columns for the table; must be same as
TableSpec.colCount() from
the columns spec returned by PropertiesDoc.getTableSpec() . |
java.util.List<? extends EntryDoc> |
getDataEntryDocs()
Returns (unmodifiable list of) data entries only.
|
protected static java.lang.String |
getDeprecatedTextAsPrefix(UmlObject o)
Returns empty string if attribute is not deprecated, otherwise formatted text ending with
white space.
|
java.util.List<? extends EntryDoc> |
getEntryDocs()
Returns (unmodifiable list of) all entries.
|
TextDescription.TextKind[] |
getFormats()
Returns array of applied formattings for the formattable cells in every row
i . |
int |
getHeadingEntriesCount()
Returns the number of header entries (
EntryDoc.Kind.tableName or
EntryDoc.Kind.columnLabels ) in this instance. |
protected static java.lang.String |
getInitValAsPrefix(UmlAttribute attr)
Returns the formatted initial value detail (const/default/range) to be used as prefix.
|
protected static java.lang.String |
getInitValAsSuffix(UmlAttribute attr)
Returns the formatted initial value detail (const/initial/range) to be used as suffix.
|
java.lang.String |
getIntroText()
Returns text that will introduce the table (e.g.
|
int |
getRowCount()
Returns number of rows for the table.
|
EntryDoc.Kind[] |
getRowKinds()
Returns kinds for rows from
PropertiesDoc.getCellValues() . |
java.lang.String |
getTableName()
Returns the name of the table; this will be the first heading row, when non-null.
|
TableSpec |
getTableSpec()
Returns columns specification.
|
protected void |
initRawData(EntryDoc entry,
UmlObject property)
Initialises raw data for a native property (tag, name, alias+ID, desc+ID, informative,
deprecated, inheritedFrom).
|
private void |
initRawData(EntryDoc entry,
UmlObject property,
boolean isInherited,
java.lang.String baseTypeName)
Initialises raw data (tag, "name",
alias+ID, desc+ID, informative, deprecated, inheritedFrom).
|
protected void |
initRawData(EntryDoc entry,
UmlObject property,
java.lang.String baseTypeName)
Initialises raw data for an inherited property (tag, name, alias+ID, desc+ID, informative,
deprecated, inheritedFrom).
|
boolean |
notEmpty()
Returns whether there are any non-heading entries (
EntryDoc.Kind.groupSubhead or
EntryDoc.Kind.data ) in this instance. |
private boolean |
toSkip(UmlAssociationEnd otherEnd,
OwningWg classOwner) |
protected boolean |
toSkipInherited(UmlObject o)
Returns whether inherited object
o needs to be skipped, according to
configuration. |
java.lang.String |
toString() |
copyCell, copyNonEmptyCell, createDocId, filterClasses, getCell, getCells, getDescription, getDocgenCfg, getHeadingText, hasKey, log, putCell, putCellNonEmpty, toSkip, useHtml
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDescription, getDocgenCfg, getHeadingText
copyCell, copyNonEmptyCell, getCell, getCells, hasKey, putCell, putCellNonEmpty
private final java.lang.String _introText
private final java.lang.String _captionText
private final TableSpec _colSpec
private final java.lang.String _tableName
private final java.util.List<EntryDoc> _entryDocs
private int _headingEntriesCount
protected AbstractPropertiesDoc(DocgenConfig docgenCfg, UmlObject object, java.lang.String what, java.lang.String introText, java.lang.String captionText, TableSpec colSpec, java.lang.String tableName)
EntryDoc.Kind.tableName
entry (if
tableName
is not null) and
EntryDoc.Kind.columnLabels
entry (from
colSpec
) in the list of entries; use when you want to add
EntryDoc.Kind.data
(and optionally,
EntryDoc.Kind.groupSubhead
) entries one by
one, after some complex processing.docgenCfg
- object
- what
- introText
- captionText
- colSpec
- tableName
- protected AbstractPropertiesDoc(DocgenConfig docgenCfg, UmlObject object, java.lang.String what, TextDescription description, TextDescription htmlDescription, boolean ignoreDesc, java.lang.String headingText, java.lang.String introText, java.lang.String captionText, TableSpec colSpec, java.lang.String tableName)
AbstractPropertiesDoc(DocgenConfig, UmlObject, String, String, String, TableSpec, String)
, but with explicit text and html documentation parameters; this is to support chained
construction for the needs of testing where we don't have UML objects but want to print
descriptions.docgenCfg
- object
- what
- description
- htmlDescription
- ignoreDesc
- headingText
- introText
- captionText
- colSpec
- tableName
- protected void initRawData(EntryDoc entry, UmlObject property)
entry
- property
- protected void initRawData(EntryDoc entry, UmlObject property, java.lang.String baseTypeName)
entry
- property
- baseTypeName
- name of base type from which this property gets inherited.private void initRawData(EntryDoc entry, UmlObject property, boolean isInherited, java.lang.String baseTypeName)
entry
- property
- isInherited
- if true, desc+ID are not set, because this would violate identity constraint in
the doc schema for an existing property description; the stylesheet simply must
deduce it.baseTypeName
- name of base type (from which this property gets inherited); meaningful if
isInherited = true
.protected final AbstractPropertiesDoc.CellText deduceCellText(java.lang.String prefix, UmlObject o)
protected final AbstractPropertiesDoc.CellText deduceCellText(java.lang.String prefix, TextDescription raw, TextDescription html, UmlObject o)
protected final boolean addEntry(EntryDoc entryDoc)
entryDoc
has been successfully added.private void ensureValid(EntryDoc.Kind kind)
protected final void filterAttributes(UmlClass c, java.util.Collection<UmlAttribute> retainedNatives, java.util.Collection<UmlAttribute> retainedInheriteds)
protected final void filterAssociationEnds(UmlClass c, java.util.Collection<UmlAssociationEnd.AssociationEndPair> retainedNatives, java.util.Collection<UmlAssociationEnd.AssociationEndPair> retainedInheriteds)
private final boolean toSkip(UmlAssociationEnd otherEnd, OwningWg classOwner)
protected final void filterOperations(UmlClass c, java.util.Collection<UmlOperation> retainedNatives, java.util.Collection<UmlOperation> retainedInheriteds)
protected final boolean toSkipInherited(UmlObject o)
o
needs to be skipped, according to
configuration.public java.lang.String toString()
toString
in class AbstractObjectDoc
protected static final java.lang.String getDeprecatedTextAsPrefix(UmlObject o)
protected static java.lang.String getInitValAsSuffix(UmlAttribute attr)
protected static final java.lang.String getInitValAsPrefix(UmlAttribute attr)
public final boolean notEmpty()
PropertiesDoc
EntryDoc.Kind.groupSubhead
or
EntryDoc.Kind.data
) in this instance. Use this one to determine whether to print
table at all.notEmpty
in interface PropertiesDoc
public final java.lang.String getIntroText()
PropertiesDoc
getIntroText
in interface PropertiesDoc
public final java.lang.String getCaptionText()
PropertiesDoc
getCaptionText
in interface PropertiesDoc
public final int getHeadingEntriesCount()
PropertiesDoc
EntryDoc.Kind.tableName
or
EntryDoc.Kind.columnLabels
) in this instance.getHeadingEntriesCount
in interface PropertiesDoc
public final java.util.List<? extends EntryDoc> getEntryDocs()
PropertiesDoc
getEntryDocs
in interface PropertiesDoc
public java.util.List<? extends EntryDoc> getDataEntryDocs()
PropertiesDoc
getDataEntryDocs
in interface PropertiesDoc
public final java.lang.String getTableName()
PropertiesDoc
getTableName
in interface PropertiesDoc
public final TableSpec getTableSpec()
PropertiesDoc
PropertiesDoc.getTableName()
is null, labels from the columns
spec (or the corresponding entry) will be the first and only heading row, otherwise the
second heading row.getTableSpec
in interface PropertiesDoc
public final int getRowCount()
PropertiesDoc
getRowCount
in interface PropertiesDoc
public final int getColumnCount()
PropertiesDoc
TableSpec.colCount()
from
the columns spec returned by PropertiesDoc.getTableSpec()
.getColumnCount
in interface PropertiesDoc
public final java.lang.String[][] getCellValues()
PropertiesDoc
getCellValues
in interface PropertiesDoc
public final EntryDoc.Kind[] getRowKinds()
PropertiesDoc
PropertiesDoc.getCellValues()
.getRowKinds
in interface PropertiesDoc
public TextDescription.TextKind[] getFormats()
PropertiesDoc
i
.
If the formattable cell in a row contains no formatting at all, returns null at index
i
. If no row contains formatting, returns null.
The formattable column index j
is always the same for this table, and can be
obtained from TableSpec.getFmtIdx()
. This helps optimise writing content in a format
other than raw text.
getFormats
in interface PropertiesDoc
Copyright 2009-2015 Tatjana (Tanja) Kostic