Package Torello.JavaDoc
Class SummaryTableHTML<ENTITY extends Declaration>
- java.lang.Object
-
- Torello.JavaDoc.SummaryTableHTML<ENTITY>
-
- Type Parameters:
ENTITY
- This will take one of five type's:Method
,Constructor
,Field
,EnumConstant
,AnnotationElem
. The html contained by this class must directly correspond to the HTMl contained by a detail section of one of these five entities.
public class SummaryTableHTML<ENTITY extends Declaration> extends java.lang.Object
Optional-Extension Class of a Basic-Upgrade:
Running a Standard-Upgrade on a Java-Doc Web-Page Directory-Tree only requires building an instance of classUpgrade
, and executing itsupgrade()
method!
The Standard-Upgrade Process will insert CSS-Tags, Hi-Lite Properly-Marked Code-Snippet<DIV>'s
, Hi-Lite all Method-Bodies & Field-Declarations, and even create Navigation-Menu Links. If more fine-grained control is needed, this class provides direct access to the Java Doc Web-Page HTML.
Accessing this Class:
This class may be accessed by utilizing a configuration method in classUpgrade
, specifically calling:
Upgrade.setExtraTasks(Consumer<JavaDocHTMLFile> handler)
... with a handler (ajava.util.function.Consumer
instance) that receives aJavaDocHTMLFile
instance.
ClassJavaDocHTMLFile
provides access to every HTML Component on a Java-Doc Web-Page. If programmatic changes to a Java-Doc Web-Page are needed, these Reflection-API classes make it easy to change, update, remove & add-to the HTML on these pages. Simply registering a handler with theUpgrader
, make the necessary improvements, and they will be incorporated into the final-output HTML-Page.
Again, classJavaDocHTMLFile
has getters for:HeaderFooterHTML
,SummaryTableHTML
andReflHTML
Alternatively:
Creating an instance of one of the two offered "User-Processor" classes - both of which have several listener/handler methods - is also a great way to access the Reflection-HTML API. These two Java Interfaces are:
This class stores the HTML for a Summary-Table - which is the table at the top of a Java Doc Page listing all of one type of entities present in the CIET/Type.This Class May be Used to Programmatically Modify JavaDoc HTML
Modifying JavaDoc HTML can be done using:JavaDocHTMLFile
,SummaryTableHTML
,ReflHTML
andHeaderFooterHTML
.
To get instances of these classes, just register a listener with the Upgrader using:Upgrade.setExtraTasks
This is optional, as the Standard Upgrader-Features do not necessitate use of this class.
There are several possible Summary-Tables, inclusive of:- Method Summaries
- Field Summaries
- Constructor Summaries
- Enum Constant Summaries
- Optional Annotation Element Summaries
- Requires Annotation Element Summaries
- Inner-Class Summaries
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/SummaryTableHTML.java
- Open New Browser-Tab: Torello/JavaDoc/SummaryTableHTML.java
-
-
Field Summary
Serializable ID Modifier and Type Field protected static long
serialVersionUID
Summary-Table Type, as the Entity 'enum' Modifier and Type Field Entity
tableType
HTML <TABLE>
and</TABLE>
Tag DefinitionsModifier and Type Field TagNodeIndex
tableClose
TagNodeIndex
tableOpen
-
Method Summary
Retrieve Table-Row Data, by Row-Index Modifier and Type Method ReflHTML<ENTITY>
getDetailElement(int rowIndex)
ENTITY
getRowEntity(int rowIndex)
Vector<HTMLNode>
getTableRow(int rowIndex)
Retrieve Additional Table-Row Data, by Row-Index Modifier and Type Method Ret2<ReflHTML<ENTITY>,
Vector<HTMLNode>>getDetailAndRow(int rowIndex)
Ret2<ENTITY,Vector<HTMLNode>>
getEntityAndRow(int rowIndex)
Get the Number of Rows in this Summary-Table Modifier and Type Method int
numRows()
int
numSignatureRows()
int
numTitleBarRows()
Iterate Summary-Table Row-Data Modifier and Type Method Iterator<ENTITY>
rowEntityIterator()
Iterator<Vector<HTMLNode>>
tableRowIterator()
Get a Stream containing the Summary-Table Row-Data Modifier and Type Method Stream<ENTITY>
rowEntityStream()
Stream<Vector<HTMLNode>>
tableRowStream()
Retrieve a Vector containing all Summary-Table Row-Information Modifier and Type Method Vector<Ret2<ENTITY,
Vector<HTMLNode>>>getEntityAndRowVector()
Vector<Ret2<ReflHTML<ENTITY>,
Vector<HTMLNode>>>getReflAndRowVector()
Find a Table-Row for a Field, Enum-Constant or Annotation-Element Summary-Table (by name) Modifier and Type Method int
find(String name)
Find Table-Row(s) for Method or Constructor Summary-Tables, by name Modifier and Type Method IntStream
findAll(String methodOrCtorName)
IntStream
findAll(String methodOrCtorName, int numParams)
int
findFirst(String methodOrCtorName)
int
findFirst(String methodOrCtorName, int numParams)
Quick Debugging Printer & toString()
Modifier and Type Method void
debugPrint(Appendable a)
String
debugPrintDense(int numCharsWide)
String
toString()
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final long serialVersionUID = 1;
-
tableType
public final Entity tableType
Indicates what type of Summary-Table this is (Methods, Fields, Constructor's, etc).- Code:
- Exact Field Declaration Expression:
public final Entity tableType;
-
tableOpen
public final TagNodeIndex tableOpen
The opening<TABLE>
tag, for a Summary-Section Table- Code:
- Exact Field Declaration Expression:
public final TagNodeIndex tableOpen;
-
tableClose
public final TagNodeIndex tableClose
The closing</TABLE>
tag, for a Summary-Section Table- Code:
- Exact Field Declaration Expression:
public final TagNodeIndex tableClose;
-
-
Method Detail
-
numRows
public int numRows()
Retrieve the total number of Table-Rows in the Summary-Table.- Returns:
- The number of HTML
<TR>...</TR>
elements in this Summary-Table - Code:
- Exact Method Body:
return tableRows.size();
-
numTitleBarRows
public int numTitleBarRows()
Retrieve the number of Table-Rows that have Title-Bars in this Summary-Table.- Returns:
- The number of HTML
<TR>...</TR>
elements in this Summary-Table which contain Title-Bars, rather than entity/member signature URL-Links. - Code:
- Exact Method Body:
int counter = 0; for (ENTITY e : rowEntities) if (e == null) counter++; return counter;
-
numSignatureRows
public int numSignatureRows()
Retrieve the number of Entity/Member Signatures which occupy a Table-Row in this Summary-Table- Returns:
- The number of HTML
<TR>...</TR>
elements in this Summary-Table which contain entity/member signature URL-Links. - Code:
- Exact Method Body:
int counter = 0; for (ENTITY e : rowEntities) if (e != null) counter++; return counter;
-
getDetailElement
public ReflHTML<ENTITY> getDetailElement(int rowIndex)
If you have a chosen / desired HTML Summary-Table Row (with a selected summary element/item) - you may pass the table-row index of that item to retrieve therowIndex
th instance ofReflHTML
that contains the Detail-Element Parsed-HTML corresponding to that row.- Parameters:
rowIndex
- Any one of the Summary-HTML Rows. Each summary-table row corresponds to exactly one of the Detail-Element HTML Segments / Snippets.
For instance, the Method Summary-Table of most CIET/Types contains a method named'toString()'
. If this method were located on row-idex'10'
- if it were the10
th method on the Method Summary-Table, this method would retrieve theReflHTML<Method>
containing the detailed explanation of'toString()'
as parsed & reflected HTML.
If this parameter points to a Table-Row that contains an Orange-Colored Title-Bar (generated by the Summary-Sorters), rather than an Entity/Member Signature, then this method will return null.- Returns:
- The parsed detailed HTML explanation for the Summary-Table item chosen by parameter
'rowIndex'
.
IMPORTANT: When parameter'rowIndex'
is passed a value that is not out of bounds for the'rowEntities'
vector, but is a row that contains an orange Title-Bar, in such cases there is no detail-member (no instance ofReflHTML
) to return. When a'rowIndex'
for a Title-Bar row is passed, this method will return null, gracefully. - Throws:
java.lang.IndexOutOfBoundsException
- IfrowIndex
is not properly chosen as per the number of rows in the table. If there are'10'
rows-items in this table, then therowIndex
parameter should be between'0'
and'9'
.- Code:
- Exact Method Body:
// Look up the "rowIndex" row in the "rowEntities" vector which just contains the list of // rows on this Summary HTML Table. The "ENTITY" is one of the 5 reflected-HTML classes // used by this package (Method, Field, Constructor etc...) ENTITY selectedEntityMember = rowEntities.elementAt(rowIndex); // Some rows contain only title information. In such cases, there is no detail-element // associated with this table-row. It is just a title!! When the user has passed a title // row to parameter 'rowIndex', just return null. if (selectedEntityMember == null) return null; // Use JavaDocHTMLFile.findReflHTML(int, Class) to get the ReflHTML needed. // NOTE: this.tableType.upgraderReflectionClass <==> ENTITY.class return (ReflHTML<ENTITY>) jdhf.findReflHTML (selectedEntityMember.id, this.tableType.upgraderReflectionClass);
-
getTableRow
public java.util.Vector<HTMLNode> getTableRow(int rowIndex)
Retrieve thei
th HTML<TR>
(row) fromthis
Summary-Table
NOTE: Not every row in a Summary-Table is guaranteed to have Parsed-HTML for an entity/member signature. When a user requests that Summary-Table's be sorted into categories or sections, then a Summary-Table will also have Title-Bar rows.
If'rowIndex'
is pointing to a Title-Bar, then the parsed HTML for that Title-Bar is returned. In all other cases, the entity/member 'signature' is returned as a result from a call to this method.- Parameters:
rowIndex
- The row number to retrieve- Returns:
- All HTML between the
<TR>
and the</TR>
for one table-summary row. - Throws:
java.lang.IndexOutOfBoundsException
- If'rowIndex'
is not within the bounds of the list of rows- Code:
- Exact Method Body:
return tableRows.elementAt(rowIndex);
-
getRowEntity
public ENTITY getRowEntity(int rowIndex)
Retrieve thei
th entity. The returned instance will be one of the six subclasses of classDeclaration
, as decided by the type-parameterENTITY
.
NOTE: Not every row in a Summary-Table is guaranteed to have Parsed-HTML for an entity/member signature. When a user requests that Summary-Table's be sorted into categories or sections, then a Summary-Table will also have Title-Bar rows.
If'rowIndex'
is pointing to a Title-Bar, this method will return null since their is no reflected entity/member object to return for a Title-Bar. In all other cases (when'rowIndex'
points to one of the entity/member signature rows), the reflection-object for that entity is returned.- Parameters:
rowIndex
- The entity-number (row-number) to retrieve fromthis
Summary-Table.- Returns:
- The refected-information for one Summary-Table row.
- Throws:
java.lang.IndexOutOfBoundsException
- If'rowIndex'
is not within the bounds of the list of rows- Code:
- Exact Method Body:
return rowEntities.elementAt(rowIndex);
-
getEntityAndRow
public Ret2<ENTITY,java.util.Vector<HTMLNode>> getEntityAndRow (int rowIndex)
Retrieve both the row-HTML and the reflected-entity information for thei
th row inthis
Summary-Table.
Not every row in a Summary-Table is guaranteed to have a Member Signature. When Summary-Table's are sorted into categories or sections, then a Summary-Table may also have a Title-Bar row. It is (hopefully) obvious that a Title-Bar row would not contain an associated'ENTITY'
(Method, Field, Constructor, etc...).- Parameters:
rowIndex
- The entity-number / row-number to retrieve fromthis
Summary-Table.- Returns:
- An instance of
Ret2
:-
Ret2.a
, of type'ENTITY'
(this class sole type-parameter). If parameter'rowIndex'
points to a 'Title-Bar' row, rather than a CIET/Type row, thenRet2.a
will contain null. -
Ret2.b
, of typeVector<HTMLNode>
. This will usually contain a Member/Entity Signature, as parsed HTML. If parameter'rowIndex'
is indicating a Title-Bar Row, then the parsed HTML returned will contain that Title-Bar.
-
- Throws:
java.lang.IndexOutOfBoundsException
- If'rowIndex'
is not within the bounds of the list of rows- Code:
- Exact Method Body:
return new Ret2<>(rowEntities.elementAt(rowIndex), tableRows.elementAt(rowIndex));
-
getDetailAndRow
public Ret2<ReflHTML<ENTITY>,java.util.Vector<HTMLNode>> getDetailAndRow (int rowIndex)
Retrieve both the row-HTML and and the corresponding / matching instance ofReflHTML
for thei
th row inthis
Summary-Table
Not every row in a Summary-Table is guaranteed to have a Member Signature. When Summary-Table's are sorted into categories or sections, then a Summary-Table may also have a Title-Bar row. It is (hopefully) obvious that a Title-Bar row would not contain an associated'ReflHTML'
HTML Data-Object either.- Parameters:
rowIndex
- The entity-number / row-number to retrieve fromthis
Summary-Table.- Returns:
- An instance of
Ret2
:-
Ret2.a
, of type'ReflHTML<ENTITY>'
. Note that theSummaryTableHTML
Type-Parameter is this class sole Type-parameter. If parameter'rowIndex'
points to a 'Title-Bar' row, rather than a CIET/Type row, thenRet2.a
will contain null. -
Ret2.b
, of typeVector<HTMLNode>
. If parameter'rowIndex'
is indicating a Title-Bar Row, then the parsed HTML returned will contain that Title-Bar.
-
- Throws:
java.lang.IndexOutOfBoundsException
- Ifi
is not within the bounds of the list of rows- See Also:
getDetailElement(int)
- Code:
- Exact Method Body:
return new Ret2<>(getDetailElement(rowIndex), tableRows.elementAt(rowIndex));
-
tableRowIterator
public java.util.Iterator<java.util.Vector<HTMLNode>> tableRowIterator()
AnIterator
that iteratesthis
Summary-Table's rows, as Vectorized-HTML- Returns:
- An iterator of HTML-Rows for
this
instance of the Summary-Table. - Code:
- Exact Method Body:
return new RemoveUnsupportedIterator<>(tableRows.iterator());
-
rowEntityIterator
public java.util.Iterator<ENTITY> rowEntityIterator()
AnIterator
that iteratesthis
Summary-Table's rows, as instances of the reflected information classENTITY
(this class' sole type-parameter). This includesMethod
,Field
,Constructor
andNestedType
etc...- Returns:
- An iterator of entities contained by
this
Summary-Table. - Code:
- Exact Method Body:
return new RemoveUnsupportedIterator<>(rowEntities.iterator());
-
tableRowStream
public java.util.stream.Stream<java.util.Vector<HTMLNode>> tableRowStream()
AStream
that containsthis
Summary-Table's rows, as Vectorized-HTML- Returns:
- A stream of HTML-Rows for
this
Summary-Table. - Code:
- Exact Method Body:
return tableRows.stream();
-
rowEntityStream
public java.util.stream.Stream<ENTITY> rowEntityStream()
AStream
that contains all Summary-Table row-entities, as instances of the reflected information classENTITY
(this class' sole type-parameter).
Remember, thatENTITY
, a Generic Type-Parameter, will be one of the six concrete subclasses of classDeclaration
. This includesMethod
,Field
,Constructor
andNestedType
etc...- Returns:
- A stream of entities contained by
this
Summary-Table. - Code:
- Exact Method Body:
return rowEntities.stream();
-
getEntityAndRowVector
public java.util.Vector<Ret2<ENTITY,java.util.Vector<HTMLNode>>> getEntityAndRowVector ()
Retrieve aVector
that contains every Summary-Table row. The specific contents of thisVector
are instances ofRet2
, which contain both the reflected-entity information (instance of type-parameterENTITY
) and the Vectorized-HTML for the table-row, as well.- Returns:
- A Vector containing instances of
Ret2
: - Code:
- Exact Method Body:
Vector<Ret2<ENTITY, Vector<HTMLNode>>> ret = new Vector<>(rowEntities.size()); for (int rowIndex=0; rowIndex < rowEntities.size(); rowIndex++) ret.add(new Ret2<>(rowEntities.elementAt(rowIndex), tableRows.elementAt(rowIndex))); return ret;
-
getReflAndRowVector
public java.util.Vector<Ret2<ReflHTML<ENTITY>,java.util.Vector<HTMLNode>>> getReflAndRowVector ()
Retrieve the entire list of table-rows in this HTML Summary-Table into aVector
.- Returns:
- A Vector containing instances of
Ret2
:-
Ret2.a
, of typeReflHTML
When a Table-Row holds an entity/member signature URL, this will hold the reflected and parsed HTML for that Detail-Element. For Table-Rows that have a Title-Bar, thisRet2
field will be null. -
Ret2.b
, of typeVector<HTMLNode>
For rows in this table that have Title-Bars, this Vectorized-HTML will hold the Title-Bar HTML. For rows in this table containing actual entity/member signature URL links (to a Detail Element), this field will hold the that Member-Signature HTML.
-
- Code:
- Exact Method Body:
Vector<Ret2<ReflHTML<ENTITY>, Vector<HTMLNode>>> ret = new Vector<>(rowEntities.size()); for (int rowIndex=0; rowIndex < rowEntities.size(); rowIndex++) ret.add(new Ret2<>(getDetailElement(rowIndex), tableRows.elementAt(rowIndex))); return ret;
-
find
public int find(java.lang.String name)
Retrieves the first Entity/Member whose name matchesname
. When searching aSummaryTableHTML<Field>
(orEnumConstant
orAnnotationElem
), the name of the entity/member will uniquely identify it amongst the others in the table.
Because of Java's function overloading, there may be many cases where a member'name'
is not sufficient to uniquely identify it. It such cases, this method will just return the index of the first match.- Parameters:
name
- The name of the entity / member, as ajava.lang.String
- Returns:
- The index of the HTML table-row that contains this entity. If this Summary-Table
does not have any member-signatures by that name, then
-1
is returned. - Code:
- Exact Method Body:
for (int i=0; i < rowEntities.size(); i++) if (rowEntities.elementAt(i).name.equals(name)) return i; return -1;
-
findFirst
public int findFirst(java.lang.String methodOrCtorName)
Retrieves the first Entity/Member whose name matches'methodOrCtorName'
.
NOTE: This method should only be invoked onMethod
orConstructor
Summary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName
- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisString
should be the same as the CIET/Type class-name whose summaries you are searching.- Returns:
- The index of the first HTML Table-Row that matches this entity. If this
Summary-Table does not have any Member-Signatures by that name, then
-1
is returned. - Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); for (int i=0; i < rowEntities.size(); i++) if (rowEntities.elementAt(i).name.equals(methodOrCtorName)) return i; return -1;
-
findFirst
public int findFirst(java.lang.String methodOrCtorName, int numParams)
Retrieves the first Entity/Member whose name matches'methodOrCtorName'
, and accepts'numParams'
parameters.
NOTE: This method should only be invoked onMethod
orConstructor
Summary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName
- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisString
should be the same as the CIET/Type class-name whose summaries you are searching.- Returns:
- The index of the first HTML Table-Row that matches this entity. If this
Summary-Table does not have any Member-Signatures with that name and accepting the specified
number of parameters, then
-1
is returned. - Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.java.lang.IllegalArgumentException
- If the value passed to the'numParams'
parameter is less than '1', then this method will throw an exception.Callable's
cannot accept a negative number of arguments, and to find a zero-argumentCallable
, the standardfind(String name)
method should be used.- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); CHECK_NUM_PARAMS(numParams); for (int i=0; i < rowEntities.size(); i++) { ENTITY e = rowEntities.elementAt(i); if (e.name.equals(methodOrCtorName) && (((Callable) e).numParameters() == numParams)) return i; } return -1;
-
findAll
public java.util.stream.IntStream findAll (java.lang.String methodOrCtorName)
Retrieves all Entities/Member Table-Row Indices whose name matches'methodOrCtorName'
.
NOTE: This method should only be invoked onMethod
orConstructor
Summary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName
- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisString
should be the same as the CIET/Type class-name whose summaries you are searching.- Returns:
- A Java IntStream of all indices for table-rows that match. If no matches are found, then
the empty-stream is returned.
Remember that a Java Int-Stream is easily & quickly converted to anint[]
-Array using the classIntStream
method'toArray()'
.
Example:
int[] tableRows = methodSummTable.findAll("someMethodName").toArray();
- Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); IntStream.Builder b = IntStream.builder(); for (int i=0; i < rowEntities.size(); i++) if (rowEntities.elementAt(i).name.equals(methodOrCtorName)) b.accept(i); return b.build();
-
findAll
public java.util.stream.IntStream findAll (java.lang.String methodOrCtorName, int numParams)
Retrieves the first Entity/Member Table-Row Index whose name matches'methodOrCtorName'
, and accepts'numParams'
parameters.
NOTE: This method should only be invoked onMethod
orConstructor
Summary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName
- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisString
should be the same as the CIET/Type class-name whose summaries you are searching.numParams
- This parameter should identify how many params are accepted by theCallable
(Method
orConstructor
) for which you are searching.
NOTE: If you are attempting to find a zero-argumentMethod
orConstructor
, the name of thatCallable
would uniquely identify it amongst otherCallable's
of the same name. OnlyCallable's
that accept at least one parameter can be overloaded!
To find a zero-argumentCallable
, please use the method:find(String name)
. This method will throw anIllegalArgumentException
if the value passed to this parameter is less than'1'
- Returns:
- A Java IntStream of all indices for table-rows that match. If no matches are found, then
the empty-stream is returned.
Remember that a Java Int-Stream is easily & quickly converted to anint[]
-Array using the classIntStream
method'toArray()'
.
Example:
int[] tableRows = methodSummTable.findAll("someMethodName", 1).toArray();
- Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.java.lang.IllegalArgumentException
- If the value passed to the'numParams'
parameter is less than '1', then this method will throw an exception.Callable's
cannot accept a negative number of arguments, and to find a zero-argumentCallable
, the standardfind(String name)
method should be used.- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); CHECK_NUM_PARAMS(numParams); IntStream.Builder b = IntStream.builder(); for (int i=0; i < rowEntities.size(); i++) { ENTITY e = rowEntities.elementAt(i); if (e.name.equals(methodOrCtorName) && (((Callable) e).numParameters() == numParams)) b.accept(i); } return b.build();
-
debugPrint
public void debugPrint(java.lang.Appendable a)
Prints an abbreviated-version of the contents of this instance, to a user-providedAppendable
. If the HTML requires more than four lines of text, only the first four lines are printed.- Parameters:
a
- This may be any Java Appendable. If anIOException
is thrown while writing to thisAppendable
, it will be caught an wrapped in anIllegalArgumentException
, with theIOException
set as thecause
.- Throws:
java.lang.IllegalArgumentException
- If'a'
throws anIOException
- See Also:
StrPrint.firstNLines(String, int)
,Util.pageToString(Vector)
,StrIndent.indent(String, int)
- Code:
- Exact Method Body:
try { if (tableType != null) a.append (BCYAN + "this.tableType: " + RESET + this.tableType.toString() + "\n"); else a.append(BRED + "this.tableType is null" + RESET); if (tableOpen != null) a.append (BCYAN + "this.tableOpen: " + RESET + this.tableOpen.n.str + "\n"); else a.append(BRED + "this.tableOpen is null" + RESET); if (tableClose != null) a.append (BCYAN + "this.tableClose: " + RESET + this.tableClose.n.str + "\n"); else a.append(BRED + "this.tableClose is null" + RESET); if (cinzelH3 != null) a.append (BCYAN + "this.cinzelH3: " + RESET + this.cinzelH3.n.str + "\n"); else a.append(BRED + "this.cinzelH3 is null" + RESET); if (headerRow != null) a.append( STARS + BCYAN + "this.headerRow:" + RESET + STARS + StrPrint.firstNLines(Util.pageToString(headerRow), 4) + '\n' ); for (int i=0; i < tableRows.size(); i++) a.append( BCYAN + "TABLE ROW " + (i+1) + RESET + '\n' + BGREEN + "HTML:\n" + RESET + StrIndent.indent (Util.pageToString(tableRows.elementAt(i)).replace("\n", "\\n"), 4) + '\n' + BGREEN + "ENTITY:\n" + RESET + StrIndent.indent (rowEntities.elementAt(i).toString(PF.UNIX_COLORS | PF.JOW_INSTEAD), 4) + '\n' ); } catch (java.io.IOException ioe) { throw new IllegalArgumentException( ioe ); }
-
debugPrintDense
public java.lang.String debugPrintDense(int numCharsWide)
A really great way to view the contents of this class - in just one page of text.- Parameters:
numCharsWide
- The maximum line width to be printed to terminal. This number must be between 60 and 150, or else an exception shall throw.- Returns:
- The contents of this class-instance, as a
String
- Throws:
java.lang.IllegalArgumentException
- If the parameter 'numCharsWide' was not passed a value within the aforementioned range.- See Also:
StrPrint.printListAbbrev(Iterable, int, int, boolean, boolean, boolean)
,StrPrint.printListAbbrev(Iterable, IntTFunction, int, int, boolean, boolean, boolean)
- Code:
- Exact Method Body:
if ((numCharsWide < 60) || (numCharsWide > 150)) throw new IllegalArgumentException ("Parameter 'numCharsWide' wasn't passed a value between 60 and 150: " + numCharsWide); return "rowEntities.size(): " + rowEntities.size() + '\n' + "rowEntities Vector Contents:" + // '\n' is automatically added StrPrint.printListAbbrev(rowEntities, numCharsWide, 4, false, true, true) + '\n' + "tableRows.size(): " + tableRows.size() + '\n' + "tableRows Vector Contents:" + // '\n' is automatically added StrPrint.printListAbbrev( tableRows, (int i, Vector<HTMLNode> tableRow) -> Util.pageToString(tableRow), numCharsWide, 4, false, true, true );
-
toString
public java.lang.String toString()
Converts the contents of this class into aString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- A Printable-
String
- See Also:
debugPrintDense(int)
- Code:
- Exact Method Body:
return "tableType: " + tableType + '\n' + "tableOpen: " + tableOpen.toString() + '\n' + "tableClose: " + tableClose.toString() + '\n' + "headerRow: " + StrPrint.abbrevEndRDSF(Util.pageToString(headerRow), 120, false) + '\n' + debugPrintDense(120);
-
-